4
hao
2025-04-16 c5fb1fbcbb2bf4d511773d348f9ef625855c61fc
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
77
78
79
80
81
82
83
package com.web.standard.controller;
 
 
import com.app.base.data.ApiResponseResult;
import com.web.standard.entity.Standard;
import com.web.standard.service.StandardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * 看板标准化
 * @author l
 */
@Api(description = "看板标准化")
@RestController
@RequestMapping(value= "/standard")
public class StandardController {
 
 
    @Autowired
    private StandardService standardService;
 
 
    @ApiOperation(value="看板标准化列表", notes="看板标准化列表")
    @RequestMapping(value = "/getStandardList", method = RequestMethod.GET)
    public ApiResponseResult getStandardlist() {
        try {
            Sort sort = new Sort(Sort.Direction.DESC,"id");
            return standardService.getStandardList();
        } catch (Exception e) {
            return ApiResponseResult.failure(e.getMessage());
        }
    }
 
 
    @ApiOperation(value="根据id查看看板标准化模板", notes="根据id查看板标准化模板")
    @RequestMapping(value = "/getStandardById", method = RequestMethod.GET)
    public ApiResponseResult getStandardById(Long id) {
        try {
            return standardService.getStandardById(id);
        } catch (Exception e) {
            return ApiResponseResult.failure(e.getMessage());
        }
    }
 
    @ApiOperation(value="添加板标准化模板", notes="添加板标准化模板")
    @RequestMapping(value = "/addStandard", method = RequestMethod.POST)
    public ApiResponseResult addStandard(Standard standard) {
        try {
            return standardService.addStandard(standard);
        } catch (Exception e) {
            return ApiResponseResult.failure(e.getMessage());
        }
    }
 
 
    @ApiOperation(value="修改看板标准化模板", notes="修改板标准化模板")
    @RequestMapping(value = "/updateStandard", method = RequestMethod.POST)
    public ApiResponseResult updateStandard(Standard standard) {
        try {
            return standardService.updateStandard(standard);
        } catch (Exception e) {
            return ApiResponseResult.failure(e.getMessage());
        }
    }
 
    @ApiOperation(value="删除", notes="删除")
    @RequestMapping(value = "/deleteStandard", method = RequestMethod.POST)
    public ApiResponseResult deleteStandard(Long id) {
        try {
            return standardService.deleteStandard(id);
        } catch (Exception e) {
            return ApiResponseResult.failure(e.getMessage());
        }
    }
}