package org.jeecg.modules.eam.controller; import io.swagger.annotations.Api; import org.jeecg.common.api.vo.Result; import org.jeecg.modules.eam.service.IdentityService; 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("/eam/sysIdentity") @Api(value = "单号生成器 前端控制器") public class IdentityController { @Autowired @Lazy private IdentityService 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); } }