package cn.cslg.pas.controller;


import cn.cslg.pas.common.core.annotation.Permission;
import cn.cslg.pas.common.core.base.Constants;
import cn.cslg.pas.common.utils.Response;
import cn.cslg.pas.common.model.vo.PatentCustomFieldSettingVO;
import cn.cslg.pas.common.utils.auth.checkAuth;
import cn.cslg.pas.service.PatentLabelService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Lazy;
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;

/**
 * <p>
 * 专利信息标签表 前端控制器
 * </p>
 *
 * @author 王岩
 * @since 2022-03-07
 */
@Tag(name = "专题库标签")
@RestController
@RequestMapping(Constants.API_VERSION_V2 + "/patent/label")
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
public class PatentLabelController {

    private final PatentLabelService patentLabelService;

    @checkAuth(FunId = "/workspace/details/addLabel")
    @Permission(roles = {2})
    @PostMapping
    @Operation(summary = "更新标签")
    public String update(@RequestBody PatentCustomFieldSettingVO params) {
        patentLabelService.updatePatentLabel(params);
        return Response.success(true);
    }
}

