liding
2 天以前 bd46f203b0d30a3d33b7c51ae9a528e4807477e1
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
package com.ruoyi.basic.controller;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.Result;
import com.ruoyi.basic.pojo.StandardMethod;
import com.ruoyi.basic.service.StandardMethodService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
 
import java.io.IOException;
 
@Api(tags = "标准方法")
@RestController
@RequestMapping("/standardMethod")
@AllArgsConstructor
public class StandardMethodController {
 
    private StandardMethodService standardMethodService;
 
    @ApiOperation(value = "获取标准方法列表")
    @GetMapping("/selectStandardMethodList")
    public Result selectStandardMethodList(Page page,StandardMethod standardMethod)  {
        return Result.success(standardMethodService.selectStandardMethodList(page, standardMethod));
    }
 
    @ApiOperation(value = "获取标准方法枚举")
    @GetMapping("/selectStandardMethods")
    public Result selectStandardMethods(){
        return Result.success(standardMethodService.selectStandardMethods());
    }
 
    @ApiOperation(value = "添加标准方法")
    @PostMapping("/addStandardMethod")
    public Result addStandardMethod(@RequestBody StandardMethod standardMethod) {
        return Result.success(standardMethodService.addStandardMethod(standardMethod));
    }
 
    @ApiOperation(value = "删除标准方法")
    @DeleteMapping("/delStandardMethod")
    public Result<?> delStandardMethod(Integer id) {
        return Result.success(standardMethodService.delStandardMethod(id));
    }
 
    @ApiOperation(value = "修改标准方法")
    @PostMapping("/upStandardMethod")
    public Result<?> upStandardMethod(@RequestBody StandardMethod standardMethod) {
        return Result.success(standardMethodService.upStandardMethod(standardMethod));
    }
 
    @ApiOperation(value = "获取行业选项")
    @GetMapping("/selectIndustryOptions")
    public Result selectIndustryOptions() {
        return Result.success(standardMethodService.selectIndustryOptions());
    }
 
    @ApiOperation(value = "查询标准附件")
    @GetMapping("/selectAttachments")
    public Result selectAttachments(Integer standardMethodId) {
        return Result.success(standardMethodService.selectAttachments(standardMethodId));
    }
 
    @ApiOperation(value = "上传标准附件")
    @PostMapping("/uploadAttachment")
    public Result uploadAttachment(@RequestParam("standardMethodId") Integer standardMethodId,
                                   @RequestParam("file") MultipartFile file) {
        return Result.success(standardMethodService.uploadAttachment(standardMethodId, file));
    }
 
    @ApiOperation(value = "删除标准附件")
    @DeleteMapping("/deleteAttachment")
    public Result deleteAttachment(Long id) {
        return Result.success(standardMethodService.deleteAttachment(id));
    }
 
}