feat:载具信息新增
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package cn.code.nl.module.base.controller.api;
|
||||
package cn.code.nl.module.base.api;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.module.base.api.codegen.CodeGenApi;
|
||||
import cn.code.nl.module.base.api.codegen.dto.CodeGenerateReqDTO;
|
||||
import cn.code.nl.module.base.service.codegen.CodeGenService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -26,7 +27,7 @@ import static cn.code.nl.framework.common.pojo.CommonResult.success;
|
||||
@RestController
|
||||
@RequestMapping("/rpc-api/base/code-gen")
|
||||
@Validated
|
||||
public class CodeGenController {
|
||||
public class CodeGenController implements CodeGenApi {
|
||||
|
||||
@Resource
|
||||
private CodeGenService codeGenService;
|
||||
@@ -36,6 +37,7 @@ public class CodeGenController {
|
||||
*/
|
||||
@PostMapping("/generate")
|
||||
@Operation(summary = "生成编码")
|
||||
@Override
|
||||
public CommonResult<String> generate(@Valid @RequestBody CodeGenerateReqDTO reqDTO) {
|
||||
String code = codeGenService.generate(reqDTO.getRuleCode());
|
||||
return success(code);
|
||||
@@ -43,9 +45,9 @@ public class CodeGenController {
|
||||
|
||||
@GetMapping("/preview")
|
||||
@Operation(summary = "预览下一个编码(不消耗序号)")
|
||||
@Override
|
||||
public CommonResult<String> preview(@RequestParam("ruleCode") String ruleCode) {
|
||||
String code = codeGenService.preview(ruleCode);
|
||||
return success(code);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package cn.code.nl.module.base.dal.mysql.codegen;
|
||||
|
||||
import cn.code.nl.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.code.nl.module.base.dal.dataobject.codegen.CodeSequenceDO;
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -35,6 +36,7 @@ public interface CodeSequenceMapper extends BaseMapperX<CodeSequenceDO> {
|
||||
* @param maxValue 最大值上限
|
||||
* @return 更新行数
|
||||
*/
|
||||
@InterceptorIgnore(dataPermission = "true")
|
||||
int updateCurrentValueBySegment(@Param("ruleId") Long ruleId,
|
||||
@Param("resetKey") String resetKey,
|
||||
@Param("step") int step,
|
||||
|
||||
Reference in New Issue
Block a user