|
@@ -1,20 +1,83 @@
|
|
|
package com.dragoninfo.dcuc.authweb.restcontroller.sub;
|
|
|
|
|
|
import com.dragoninfo.dcuc.app.facade.sub.IAppColumnRelationFacaed;
|
|
|
+import com.dragoninfo.dcuc.app.vo.AppColumnDetailVo;
|
|
|
+import com.dragoninfo.dcuc.app.vo.AppColumnRelationPageVO;
|
|
|
+import com.dragoninfo.dcuc.app.vo.AppColumnRelationVO;
|
|
|
+import com.dragoninfo.dcuc.app.vo.AppColumnSaveVo;
|
|
|
+import com.dragoninfo.dcuc.authweb.restcontroller.sub.vo.data.FieldClaAcceptVo;
|
|
|
+import com.dragoninfo.dcuc.authweb.util.VersionUtils;
|
|
|
+import com.dragoninfo.duceap.core.response.Result;
|
|
|
+import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
|
|
|
+import com.dragonsoft.duceap.base.entity.search.SearchDTO;
|
|
|
+import com.dragonsoft.duceap.core.search.Searchable;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiModelProperty;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* @author mazq
|
|
|
* @date 2022/10/5
|
|
|
*/
|
|
|
+@Api(tags = {"字段分类关系接口"})
|
|
|
@RestController
|
|
|
+@RequestMapping(value = "/cloumnRelation/"+ VersionUtils.VERSION_UID)
|
|
|
public class ColumnRelationController {
|
|
|
|
|
|
@Autowired
|
|
|
private IAppColumnRelationFacaed appColumnRelationFacaed;
|
|
|
|
|
|
+ @ApiOperation(value = "关联关系分页列表")
|
|
|
+ @ApiImplicitParam(name = "Searchable", value = "Searchable 数据分级分页查询对象,查询条件 codeName like ")
|
|
|
+ @PostMapping(value = "search")
|
|
|
+ public Result<List<AppColumnRelationPageVO>> pageSearch(Searchable searchable) {
|
|
|
+ Page<AppColumnRelationPageVO> voPage = appColumnRelationFacaed.pageSearch(searchable.toSearchDTO());
|
|
|
+ List<AppColumnRelationPageVO> content = voPage.getContent();
|
|
|
+ return Result.success(voPage.getTotalElements(), content);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "关联关系详情")
|
|
|
+ @ApiImplicitParam(name = "id", value = "id")
|
|
|
+ @GetMapping(value = "detail")
|
|
|
+ public Result<AppColumnDetailVo> detail(@RequestParam("id") String id) {
|
|
|
+ AppColumnDetailVo vo = appColumnRelationFacaed.detail(id);
|
|
|
+ return Result.success(vo);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "关联关系删除")
|
|
|
+ @ApiImplicitParam(name = "id", value = "id")
|
|
|
+ @DeleteMapping(value = "deleteById")
|
|
|
+ public Result<Object> deleteById(@RequestParam("id") String id) {
|
|
|
+ appColumnRelationFacaed.deleteById(id);
|
|
|
+ return Result.success();
|
|
|
+ }
|
|
|
|
|
|
+ @ApiOperation(value = "关联关系新增")
|
|
|
+ @PostMapping(value = "relationAdd")
|
|
|
+ public Result<Object> relationAdd(@RequestBody AppColumnSaveVo saveVo) {
|
|
|
+ ResponseStatus responseStatus = appColumnRelationFacaed.relationAdd(saveVo);
|
|
|
+ if (ResponseStatus.SUCCESS_CODE.equals(responseStatus.getStatusCode())) {
|
|
|
+ return Result.success();
|
|
|
+ } else {
|
|
|
+ return Result.fail(ResponseStatus.FAIL_CODE, responseStatus.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ @ApiOperation(value = "关联关系修改")
|
|
|
+ @PostMapping(value = "relationUpdate")
|
|
|
+ public Result<Object> relationUpdate(@RequestBody AppColumnSaveVo saveVo) {
|
|
|
+ ResponseStatus responseStatus = appColumnRelationFacaed.relationUpdate(saveVo);
|
|
|
+ if (ResponseStatus.SUCCESS_CODE.equals(responseStatus.getStatusCode())) {
|
|
|
+ return Result.success();
|
|
|
+ } else {
|
|
|
+ return Result.fail(ResponseStatus.FAIL_CODE, responseStatus.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|