lyh
2025-01-17 ea704e018a27c26ef6deeaea4adc8a28b4d0b27e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package org.jeecg.modules.dnc.controller;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.modules.dnc.entity.Button;
import org.jeecg.modules.dnc.entity.ObjectBase;
import org.jeecg.modules.dnc.request.ObjectBaseRequest;
import org.jeecg.modules.dnc.response.CommonCode;
import org.jeecg.modules.dnc.response.QueryPageResponseResult;
import org.jeecg.modules.dnc.response.ResponseResult;
import org.jeecg.modules.dnc.service.IObjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
@Slf4j
@Api(tags = "Dnc对象管理")
@RestController
@RequestMapping("/ucenter/obj")
public class ObjectController  {
    @Autowired
    private IObjectService objectService;
 
    @AutoLog(value = "Dnc对象管理-新增管理对象信息")
    @ApiOperation(value = "Dnc对象管理-新增管理对象信息", notes = "Dnc对象管理-新增管理对象信息")
    @PostMapping("/add")
    public ResponseResult addObject(@RequestBody ObjectBase objectBase) {
        boolean b = objectService.addObject(objectBase);
        if(b) {
            return new ResponseResult(CommonCode.SUCCESS);
        }
        return new ResponseResult(CommonCode.FAIL);
    }
 
    @AutoLog(value = "Dnc对象管理-编辑对象")
    @ApiOperation(value = "Dnc对象管理-编辑对象", notes = "Dnc对象管理-编辑对象")
    @PutMapping("/edit/{id}")
    public ResponseResult editObject(@PathVariable("id") String id,@RequestBody ObjectBase objectBase) {
        boolean b = objectService.editObject(id,objectBase);
        if(b) {
            return new ResponseResult(CommonCode.SUCCESS);
        }
        return new ResponseResult(CommonCode.FAIL);
    }
 
    @AutoLog(value = "Dnc对象管理-分页查询对象")
    @ApiOperation(value = "Dnc对象管理-分页查询对象", notes = "Dnc对象管理-分页查询对象")
    @GetMapping("/find/page/{page}/{size}")
    public QueryPageResponseResult<ObjectBase> findByPageList(@PathVariable("page") int page, @PathVariable("size") int size, ObjectBaseRequest objectRequest) {
        return objectService.findPageList(page,size,objectRequest);
    }
 
    @AutoLog(value = "Dnc对象管理-删除对象")
    @ApiOperation(value = "Dnc对象管理-删除对象", notes = "Dnc对象管理-删除对象")
    @DeleteMapping("/delete")
    public ResponseResult deleteObjectById(@RequestParam("id") String id) {
        boolean b = objectService.deleteObjectById(id);
        if(b) {
            return new ResponseResult(CommonCode.SUCCESS);
        }
        return new ResponseResult(CommonCode.FAIL);
    }
 
    @AutoLog(value = "Dnc对象管理-指派对象的操作按钮")
    @ApiOperation(value = "Dnc对象管理-指派对象的操作按钮", notes = "Dnc对象管理-指派对象的操作按钮")
    @PostMapping("/assign/button/{objectId}")
    public ResponseResult assignButton(@PathVariable("objectId") String objectId, @RequestBody List<Button> buttonList) {
        boolean b = objectService.assignButton(objectId, buttonList);
        if(b) {
            return new ResponseResult(CommonCode.SUCCESS);
        }
        return new ResponseResult(CommonCode.FAIL);
    }
}