whycxzp
2021-04-06 664bbbfb5d115219ff53084f86bed8069c3f8bd0
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
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.pojo.DeviceType;
import com.whyc.service.DeviceTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * 设备类型及通用参数
 */
@RestController
@RequestMapping("deviceType")
@Api(tags = "设备类型及通用参数")
public class DeviceTypeController {
 
    @Autowired
    private DeviceTypeService service;
 
    @GetMapping("all")
    @ApiOperation(value = "查询所有设备类型")
    public Response<List<DeviceType>> getAll(){
        return service.getAll();
    }
 
    @GetMapping
    @ApiOperation(value = "查询设备类型的通用参数")
    public Response<DeviceType> get(@RequestParam Integer deviceTypeId){
        return service.get(deviceTypeId);
    }
 
    @PutMapping
    @ApiOperation(value = "修改设备类型参数")
    public Response update(@RequestBody DeviceType deviceType){
        return service.update(deviceType);
    }
 
}