package org.jeecg.modules.system.controller;
|
|
import io.swagger.annotations.Api;
|
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.modules.system.service.SysIdentityService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.context.annotation.Lazy;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RestController;
|
|
@RestController
|
@RequestMapping("/base/sysIdentity")
|
@Api(value = "单号生成器 前端控制器")
|
public class SysIdentityController {
|
@Autowired
|
@Lazy
|
private SysIdentityService sysIdentityService;
|
// 新增
|
@GetMapping("/getNumNew")
|
public Result<?> getNum(@RequestParam(name="type",required = true)String type,
|
@RequestParam(name="length",defaultValue = "4")Integer length) {
|
String serialNum = sysIdentityService.getNumByTypeAndLength(type, length);
|
return Result.ok(serialNum);
|
}
|
}
|