package cn.iocoder.yudao.module.identity.api.businessrule;


import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.identity.api.businessrule.dto.BusinessRuleRespDTO;
import cn.iocoder.yudao.module.identity.enums.ApiConstants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


import javax.validation.Valid;

@FeignClient(name = ApiConstants.NAME)
@Api(tags = "RPC 服务 - 码规则")
public interface BusinessRuleApi {
    String PREFIX = ApiConstants.CONST + "/business-rule";

    @PostMapping(PREFIX + "/create")
    @ApiOperation("创建码规则")
    @OperateLog(enable = false) // 不记录操作日志
    CommonResult<Long> createBusinessRule(@Valid @RequestBody BusinessRuleRespDTO businessRule);

    @PostMapping(PREFIX + "/delBusinessRule")
    @ApiOperation("删除码规则")
    @ApiImplicitParam(name = "codeRuleId", value = "码规则ID", required = true, example = "1", dataTypeClass = Long.class)
    @OperateLog(enable = false) // 不记录操作日志
    CommonResult<Boolean> delBusinessRule(Long codeRuleId);
}
