yangys
2024-03-27 e48aa2ac8dea1be5db11c63edf0b912c4ad5ce65
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
package com.qianwen.smartman.modules.tool.controller;
 
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import java.util.List;
import javax.validation.Valid;
import com.qianwen.core.boot.ctrl.BladeController;
import com.qianwen.core.scanner.modular.annotation.DeleteResource;
import com.qianwen.core.scanner.modular.annotation.GetResource;
import com.qianwen.core.scanner.modular.annotation.PostResource;
import com.qianwen.core.scanner.modular.stereotype.ApiResource;
import com.qianwen.core.secure.annotation.PreAuth;
import com.qianwen.core.tool.api.R;
import com.qianwen.smartman.modules.tool.convert.ToolParameterConvert;
import com.qianwen.smartman.modules.tool.entity.ToolParameter;
import com.qianwen.smartman.modules.tool.service.IToolParameterService;
import com.qianwen.smartman.modules.tool.vo.ToolParameterVO;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
@Api(value = "刀具参数管理", tags = {"刀具参数管理"})
@ApiResource({"blade-tool/tool-parameter"})
@RestController
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/tool/controller/ToolParameterController.class */
public class ToolParameterController extends BladeController {
    private final IToolParameterService toolParameterService;
 
    public ToolParameterController(final IToolParameterService toolParameterService) {
        this.toolParameterService = toolParameterService;
    }
 
    @ApiOperationSupport(order = 1)
    @GetResource({"/get/{id}"})
    @ApiOperation(value = "刀具参数详情", notes = "传入toolParameter")
    @PreAuth
    public R<ToolParameterVO> detail(@PathVariable String id) {
        ToolParameter toolParameter = (ToolParameter) this.toolParameterService.getById(id);
        return R.data(ToolParameterConvert.INSTANCE.convert(toolParameter));
    }
 
    @ApiOperationSupport(order = 2)
    @GetResource({"/list"})
    @ApiOperation(value = "刀具参数列表", notes = "传入map")
    @PreAuth
    public R<List<ToolParameterVO>> list(@RequestParam String keyWord) {
        return R.data(this.toolParameterService.list(keyWord));
    }
 
    @ApiOperationSupport(order = 3)
    @PostResource({"/save"})
    @ApiOperation(value = "刀具参数新增或者编辑", notes = "传入toolParameterVO")
    @PreAuth
    public R<ToolParameterVO> save(@Valid @RequestBody ToolParameterVO toolParameterVO) {
        return R.data(this.toolParameterService.save(toolParameterVO));
    }
 
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "刀具参数删除", notes = "传入ids")
    @PreAuth
    @DeleteResource({"/remove"})
    public R remove(@ApiParam(value = "主键", required = true) @RequestBody List<Long> ids) {
        if (ids.isEmpty()) {
            return R.status(false);
        }
        return R.status(this.toolParameterService.removeByIds(ids));
    }
}