lyh
2025-03-07 b864148d2a9afd5e1627b761da923cca8f8dfbd2
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
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.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.dnc.entity.DeviceType;
import org.jeecg.modules.dnc.service.IDeviceTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
@Slf4j
@Api(tags = "设备类信息")
@RestController
@RequestMapping("/nc/deviceType")
public class DeviceTypeController extends JeecgController<DeviceType, IDeviceTypeService> {
    @Autowired
    private IDeviceTypeService deviceTypeService;
 
    /**
     * 根据业务id查询设备类列表
     * @param businessId
     * @param type
     * @return
     */
    @AutoLog(value = "设备类信息-根据业务id查询设备类列表")
    @ApiOperation(value = "设备类信息-根据业务id查询设备类列表", notes = "设备类信息-根据业务id查询设备类列表")
    @GetMapping("/getByBusinessId")
    public Result<?> getByBusinessId(String businessId,String type){
        return deviceTypeService.getByBusinessId(businessId,type);
    }
 
    /**
     * 新增设备类
     * @param deviceType
     * @return
     */
    @AutoLog(value = "设备类信息-新增设备类")
    @ApiOperation(value = "设备类信息-新增设备类", notes = "设备类信息-新增设备类")
    @GetMapping("/add")
    public Result<?> add(DeviceType deviceType){
        return Result.OK(deviceTypeService.add(deviceType));
    }
 
    /**
     * 编辑设备类
     * @param deviceType
     * @return
     */
    @AutoLog(value = "设备类信息-编辑设备类")
    @ApiOperation(value = "设备类信息-编辑设备类", notes = "设备类信息-编辑设备类")
    @GetMapping("/edit")
    public Result<?> edit(DeviceType deviceType){
        return Result.OK(deviceTypeService.edit(deviceType));
    }
 
    /**
     * 根据id删除设备类
     * @param id
     * @return
     */
    @AutoLog(value = "设备类信息-根据id删除设备类")
    @ApiOperation(value = "设备类信息-根据id删除设备类", notes = "设备类信息-根据id删除设备类")
    @GetMapping("/delete")
    public Result<?> delete(@RequestBody String id){
        return Result.OK(deviceTypeService.delete(id));
    }
}