cuilei
8 天以前 be784e31cdf09d66c37f811db84e1a6e2bfed8d2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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);
  }
}