From 3c4fee1db116c11d4f04727cfe076d7c94daeaf2 Mon Sep 17 00:00:00 2001
From: yanzhaofeige <yanzhaofeige@qq.com>
Date: Mon, 30 Sep 2024 12:10:57 +0800
Subject: [PATCH] init

---
 cpzidc-admin/src/main/java/com/odcc/cpzidc/web/controller/system/SysRegisterController.java |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/cpzidc-admin/src/main/java/com/odcc/cpzidc/web/controller/system/SysRegisterController.java b/cpzidc-admin/src/main/java/com/odcc/cpzidc/web/controller/system/SysRegisterController.java
new file mode 100644
index 0000000..c0e5928
--- /dev/null
+++ b/cpzidc-admin/src/main/java/com/odcc/cpzidc/web/controller/system/SysRegisterController.java
@@ -0,0 +1,38 @@
+package com.odcc.cpzidc.web.controller.system;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+import com.odcc.cpzidc.common.core.controller.BaseController;
+import com.odcc.cpzidc.common.core.domain.AjaxResult;
+import com.odcc.cpzidc.common.core.domain.model.RegisterBody;
+import com.odcc.cpzidc.common.utils.StringUtils;
+import com.odcc.cpzidc.framework.web.service.SysRegisterService;
+import com.odcc.cpzidc.system.service.ISysConfigService;
+
+/**
+ * 注册验证
+ * 
+ * @author ruoyi
+ */
+@RestController
+public class SysRegisterController extends BaseController
+{
+    @Autowired
+    private SysRegisterService registerService;
+
+    @Autowired
+    private ISysConfigService configService;
+
+    @PostMapping("/register")
+    public AjaxResult register(@RequestBody RegisterBody user)
+    {
+        if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
+        {
+            return error("当前系统没有开启注册功能!");
+        }
+        String msg = registerService.register(user);
+        return StringUtils.isEmpty(msg) ? success() : error(msg);
+    }
+}

--
Gitblit v1.9.3