Explorar el Código

添加其他应用企业注册接口

wangmh hace 7 años
padre
commit
78af3adc27

+ 17 - 20
sso-common/src/main/java/com/uas/sso/util/AccountUtils.java

@@ -982,26 +982,23 @@ public class AccountUtils {
 		return result;
 	}
 
-//	/**
-//	 * 商城个人账号增加企业注册
-//	 *
-//	 * @param userSpaceDetail
-//	 * @throws Exception
-//	 */
-//	public static String applyAppForMall(UserSpaceDetail userSpaceDetail) throws Exception {
-//		String url = AccountConfig.getSpaceSaveUrl();
-//		String result = null;
-//		if (!StringUtils.isEmpty(url)) {
-//			ResponseWrap res = HttpUtil.doPost(url,
-//					new ModelMap("_operate", "registForMall")
-//					.addAttribute("detail", JSON.toJSON(userSpaceDetail)));
-//			if (!res.isSuccess())
-//				throw new Exception(res.getContent());
-//			else
-//				result = res.getContent();
-//		}
-//		return result;
-//	}
+	/**
+	 * 商城个人账号增加企业注册
+	 *
+	 * @param userSpaceView 企业信息
+	 * @throws Exception
+	 */
+	public static void register(UserSpaceView userSpaceView) throws Exception {
+		String url = AccountConfig.getSpaceSaveUrl();
+		if (!StringUtils.isEmpty(url)) {
+            url = url + "/register/other";
+            JSONObject data = JSON.parseObject(JSON.toJSONString(userSpaceView));
+            HttpUtil.ResponseWrap res = HttpUtil.doPost(url, data);
+			if (!res.isSuccess()) {
+                throw new Exception(res.getContent());
+            }
+		}
+	}
 //
 //	/**
 //	 * 设置hr账号

+ 5 - 1
sso-server/src/main/java/com/uas/sso/controller/UserspaceManagerController.java

@@ -602,7 +602,11 @@ public class UserspaceManagerController extends BaseController {
      * @param userspace 企业信息
      */
     @RequestMapping(value = "/register/other", method = RequestMethod.POST)
-    public void registerFromOther(Userspace userspace) {
+    public ModelMap registerFromOther(Userspace userspace) {
+        if (userspace == null) {
+            return error("参数错误");
+        }
         userspaceService.register(userspace);
+        return success();
     }
 }