feat: 新增编码生成Feign API接口
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package cn.code.nl.module.base.api.codegen;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.module.base.api.codegen.dto.CodeGenerateReqDTO;
|
||||
import cn.code.nl.module.base.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* RPC 服务 - 编码生成
|
||||
*
|
||||
* @author zhouz
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC 服务 - 编码生成")
|
||||
public interface CodeGenApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/code-gen";
|
||||
|
||||
/**
|
||||
* 根据规则编码生成编码字符串
|
||||
*
|
||||
* @param reqDTO 生成请求
|
||||
* @return 生成的编码字符串
|
||||
*/
|
||||
@PostMapping(PREFIX + "/generate")
|
||||
@Operation(summary = "生成编码")
|
||||
CommonResult<String> generate(@Valid @RequestBody CodeGenerateReqDTO reqDTO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.code.nl.module.base.api.codegen.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 编码生成请求 DTO
|
||||
*
|
||||
* @author zhouz
|
||||
*/
|
||||
@Data
|
||||
public class CodeGenerateReqDTO {
|
||||
|
||||
/**
|
||||
* 规则编码
|
||||
*/
|
||||
@NotBlank(message = "规则编码不能为空")
|
||||
private String ruleCode;
|
||||
|
||||
/**
|
||||
* 业务字段参数(预留,二期 BIZ_FIELD 段使用)
|
||||
*/
|
||||
private Map<String, String> bizParams;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user