-
admin
2024-04-18 e70fb4b691d0411cb6de676256160255a153cada
提交 | 用户 | 时间
e57a89 1 package com.jcdm.web.controller.system;
2
3 import org.springframework.beans.factory.annotation.Autowired;
4 import org.springframework.web.bind.annotation.PostMapping;
5 import org.springframework.web.bind.annotation.RequestBody;
6 import org.springframework.web.bind.annotation.RestController;
7 import com.jcdm.common.core.controller.BaseController;
8 import com.jcdm.common.core.domain.AjaxResult;
9 import com.jcdm.common.core.domain.model.RegisterBody;
10 import com.jcdm.common.utils.StringUtils;
11 import com.jcdm.framework.web.service.SysRegisterService;
12 import com.jcdm.system.service.ISysConfigService;
13
14 /**
15  * 注册验证
16  * 
17  * @author JC
18  */
19 @RestController
20 public class SysRegisterController extends BaseController
21 {
22     @Autowired
23     private SysRegisterService registerService;
24
25     @Autowired
26     private ISysConfigService configService;
27
28     @PostMapping("/register")
29     public AjaxResult register(@RequestBody RegisterBody user)
30     {
31         if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
32         {
33             return error("当前系统没有开启注册功能!");
34         }
35         String msg = registerService.register(user);
36         return StringUtils.isEmpty(msg) ? success() : error(msg);
37     }
38 }