中国算力平台算力登记系统2.0
yanzhaofeige
5 days ago 1d25094b9f0e339d784e6f1b17c95c88c272dd45
commit | author | age
43dc29 1 package com.odcc.cpzidc.web.controller.system;
Y 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.odcc.cpzidc.common.core.controller.BaseController;
8 import com.odcc.cpzidc.common.core.domain.AjaxResult;
9 import com.odcc.cpzidc.common.core.domain.model.RegisterBody;
10 import com.odcc.cpzidc.common.utils.StringUtils;
11 import com.odcc.cpzidc.framework.web.service.SysRegisterService;
12 import com.odcc.cpzidc.system.service.ISysConfigService;
13
14 /**
15  * 注册验证
16  * 
17  * @author ruoyi
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 }