Compare commits
No commits in common. "62e952010e090e8468ed41fed4ba6399fbad2bbc" and "26e0038a0cfc9b33825e6a76669e92ccbe974845" have entirely different histories.
62e952010e
...
26e0038a0c
|
|
@ -1,38 +0,0 @@
|
||||||
package com.electromagnetic.industry.software.manage.controller;
|
|
||||||
|
|
||||||
import com.electromagnetic.industry.software.common.resp.ElectromagneticResult;
|
|
||||||
import com.electromagnetic.industry.software.common.util.ElectromagneticResultUtil;
|
|
||||||
import com.electromagnetic.industry.software.manage.pojo.models.EdFileRelation;
|
|
||||||
import com.electromagnetic.industry.software.manage.service.EdFileRelationService;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/data/ed/relation")
|
|
||||||
public class EdFileRelationController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
EdFileRelationService edFileRelationService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建文件关系
|
|
||||||
* @param relation
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@RequestMapping (value = "/create", method = RequestMethod.POST)
|
|
||||||
public ElectromagneticResult<?> createRelation (@RequestBody EdFileRelation relation) {
|
|
||||||
return ElectromagneticResultUtil.success(edFileRelationService.createRelation(relation));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 取消文件关系
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@RequestMapping (value = "/cancel/{id}", method = RequestMethod.GET)
|
|
||||||
public ElectromagneticResult<?> cancelRelation (@PathVariable("id") String id) {
|
|
||||||
return ElectromagneticResultUtil.success(edFileRelationService.cancelRelation(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
package com.electromagnetic.industry.software.manage.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.electromagnetic.industry.software.manage.pojo.models.EdFileRelation;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface EdFileRelationMapper extends BaseMapper<EdFileRelation> {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
package com.electromagnetic.industry.software.manage.pojo.models;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@TableName("ed_file_relation")
|
|
||||||
public class EdFileRelation {
|
|
||||||
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件1 主键id
|
|
||||||
*/
|
|
||||||
@TableField(value = "fileId1")
|
|
||||||
private String fileId1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件2 主键id
|
|
||||||
*/
|
|
||||||
@TableField(value = "fileId2")
|
|
||||||
private String fileId2;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关系描述
|
|
||||||
*/
|
|
||||||
private String relationship;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者 用户id
|
|
||||||
*/
|
|
||||||
@TableField(value = "created_by")
|
|
||||||
private String createdBy;
|
|
||||||
|
|
||||||
@TableField(value = "created_at", fill = FieldFill.INSERT)
|
|
||||||
private Date createdAt;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新者 用户id
|
|
||||||
*/
|
|
||||||
@TableField(value = "updated_by")
|
|
||||||
private String updatedBy;
|
|
||||||
|
|
||||||
@TableField(value = "updated_at", fill = FieldFill.UPDATE)
|
|
||||||
private Date updatedAt;
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
package com.electromagnetic.industry.software.manage.service;
|
|
||||||
|
|
||||||
import com.electromagnetic.industry.software.manage.pojo.models.EdFileRelation;
|
|
||||||
|
|
||||||
public interface EdFileRelationService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建文件关系
|
|
||||||
* @param edFileRelation
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
Boolean createRelation(EdFileRelation edFileRelation);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 取消文件关系
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
Boolean cancelRelation (String id);
|
|
||||||
}
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
package com.electromagnetic.industry.software.manage.service.serviceimpl;
|
|
||||||
|
|
||||||
import com.electromagnetic.industry.software.common.util.IdWorker;
|
|
||||||
import com.electromagnetic.industry.software.common.util.UserThreadLocal;
|
|
||||||
import com.electromagnetic.industry.software.manage.mapper.EdFileRelationMapper;
|
|
||||||
import com.electromagnetic.industry.software.manage.pojo.models.EdFileRelation;
|
|
||||||
import com.electromagnetic.industry.software.manage.service.EdFileRelationService;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
public class EdFileRelationServiceImpl implements EdFileRelationService {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
EdFileRelationMapper edFileRelationMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建文件关系
|
|
||||||
* @param edFileRelation
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Boolean createRelation (EdFileRelation edFileRelation) {
|
|
||||||
edFileRelation.setId(IdWorker.getSnowFlakeIdString());
|
|
||||||
edFileRelation.setCreatedBy(UserThreadLocal.getUserId());
|
|
||||||
return edFileRelationMapper.insert(edFileRelation)>0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 取消文件关系
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Boolean cancelRelation (String id) {
|
|
||||||
return edFileRelationMapper.deleteById(id)>0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue