李林
2023-10-07 658d4927d468c47208fd012d9128b09249c07eff
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
package com.chinaztt.mes.quality.controller;
 
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chinaztt.mes.common.wrapper.QueryWrapperUtil;
import com.chinaztt.mes.quality.dto.ZxLabelBindRelationDTO;
import com.chinaztt.mes.quality.entity.ZxLabelBindRelation;
import com.chinaztt.mes.quality.service.ZxLabelBindRelationService;
import com.chinaztt.ztt.common.core.util.R;
import com.chinaztt.ztt.common.log.annotation.SysLog;
import com.chinaztt.ztt.common.security.annotation.Inner;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * @Description : 中兴标签关系绑定
 * @ClassName : ZxLabelBindRelationController
 * @Author : sll
 * @Date: 2022-11-30  14:58
 */
@RestController
@AllArgsConstructor
@RequestMapping("/zxlabelbind")
@Api(value = "zxlabelbind", tags = "中兴标签关系绑定")
public class ZxLabelBindRelationController{
    private ZxLabelBindRelationService zxLabelBindRelationService;
 
    @ApiOperation(value = "新增中兴标签绑定关系", notes = "新增中兴标签绑定关系")
    @SysLog("新增中兴标签绑定关系")
    @PostMapping
    @PreAuthorize("@pms.hasPermission('quality_zx_label_bind_relation_add')" )
    public R addLabelRelation(@RequestBody ZxLabelBindRelationDTO zxLabelBindRelationDTO){
        return R.ok(zxLabelBindRelationService.addLabelRelation(zxLabelBindRelationDTO));
    }
 
    @ApiOperation(value = "删除中兴标签关系", notes = "删除中兴标签关系")
    @SysLog("删除中兴标签关系")
    @DeleteMapping
    @PreAuthorize("@pms.hasPermission('quality_zx_label_bind_relation_del')" )
    public R delLabelRelation(@RequestBody List<Long> ids){
        return R.ok(zxLabelBindRelationService.removeByIds(ids));
    }
 
    @ApiOperation(value = "分页查询", notes = "分页查询")
    @GetMapping("/page")
    public R qryLabelRelationPage(Page page,ZxLabelBindRelation zxLabelBindRelation){
        return R.ok(zxLabelBindRelationService.page(page, QueryWrapperUtil.gen(zxLabelBindRelation)));
    }
}