gaoaoy
2024-02-29 2eb8407174662a82c7e5880da808b4b2484e9317
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
package com.yuanchu.mom.controller;
 
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.pojo.Laboratory;
import com.yuanchu.mom.service.LaboratoryService;
import com.yuanchu.mom.utils.JackSonUtil;
import com.yuanchu.mom.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.Map;
 
/**
 * 实验室管理(LaboratoryController)表控制层
 */
@Api(tags = "场所或设施")
@AllArgsConstructor
@RestController
@RequestMapping("/laboratoryScope")
public class LaboratoryController {
 
    private LaboratoryService laboratoryService;
 
    @ApiOperation(value = "查询实验室管理列表")
    @PostMapping("/selectItemParameter")
    public Result selectItemParameter(@RequestBody Map<String, Object> data) throws Exception {
        Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class);
        Laboratory itemParameter = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), Laboratory.class);
        return Result.success(laboratoryService.selectItemParameter(page, itemParameter));
    }
 
    @ApiOperation(value = "添加实验室参数")
    @PostMapping("/addParameter")
    public Result addParameter(@RequestBody Laboratory itemParameter) {
        return Result.success(laboratoryService.addParameter(itemParameter));
    }
 
    @ApiOperation(value = "删除实验室参数")
    @PostMapping("/delParameter")
    public Result<?> delParameter(Integer id) {
        return Result.success(laboratoryService.delParameter(id));
    }
 
    @ApiOperation(value = "修改实验室参数")
    @PostMapping("/upParameter")
    public Result<?> upParameter(@RequestBody Laboratory itemParameter) {
        return Result.success(laboratoryService.upParameter(itemParameter));
    }
}