|
@@ -0,0 +1,94 @@
|
|
|
|
+package com.caimei365.user.controller;
|
|
|
|
+
|
|
|
|
+import com.caimei365.user.model.JsonModel;
|
|
|
|
+import com.caimei365.user.utils.ValidateUtil;
|
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
+
|
|
|
|
+public class AllApi {
|
|
|
|
+
|
|
|
|
+ //club
|
|
|
|
+ /**
|
|
|
|
+ * 微信授权登录
|
|
|
|
+ *
|
|
|
|
+ * @param code 微信授权code
|
|
|
|
+ * @param encryptedData 微信加密数据
|
|
|
|
+ * @param iv 加密算法的初始向量
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/authorization")
|
|
|
|
+ public JsonModel authorizationLogin(String code, String encryptedData, String iv, HttpServletRequest request) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 邀请码授权登录
|
|
|
|
+ * @param invitationCode 邀请码
|
|
|
|
+ * @param nickName 微信昵称
|
|
|
|
+ * @param headimgurl 微信头像
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/invitationCode")
|
|
|
|
+ public JsonModel invitationCode(OperationVo operation, HttpServletRequest request) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 普通机构入驻(注册)
|
|
|
|
+ * @param source 注册来源: 0网站 1小程序
|
|
|
|
+ * @param userName 用户名
|
|
|
|
+ * @param bindMobile 企业绑定手机号
|
|
|
|
+ * @param password 密码
|
|
|
|
+ * @param passWordConfirm 用户确认密码
|
|
|
|
+ * @param activationCode 【已废弃】
|
|
|
|
+ * @param isAgreed 是否同意勾选同意协议,1是,其他否
|
|
|
|
+ */
|
|
|
|
+ @Idempotent(prefix="idempotent_club", keys={"#user"}, expire=5)
|
|
|
|
+ @PostMapping("/common")
|
|
|
|
+ public JsonModel commonClub(UserVo user, OperationVo operationVo, String isAgreed, HttpServletRequest request) {
|
|
|
|
+ return clubService.commonClub(user, operationVo, isAgreed, request);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 供应商注册
|
|
|
|
+ * @param source 注册来源: 0网站 1小程序
|
|
|
|
+ * @param bindMobile 企业绑定手机号
|
|
|
|
+ * @param email 邮箱
|
|
|
|
+ * @param mobileCode 手机验证码
|
|
|
|
+ * @param password 密码
|
|
|
|
+ * @param passWordConfirm 用户确认密码
|
|
|
|
+ * @param name 组织名称
|
|
|
|
+ * @param linkMan 联系人
|
|
|
|
+ * @param sname 供应商公司简称
|
|
|
|
+ * @param provinceID 省
|
|
|
|
+ * @param cityID 市
|
|
|
|
+ * @param townID 所在县区Id
|
|
|
|
+ * @param address 地址
|
|
|
|
+ * @param socialCreditCode 统一社会信用代码
|
|
|
|
+ * @param businessLicenseImage 营业执照
|
|
|
|
+ * @param firstShopType 医疗=1和非医疗=2
|
|
|
|
+ * @param secondShopType 医疗的二级分类 一类器械=1、二类器械 =2、三类器械=3、其他=4 /// 1和非医疗没有二级分类
|
|
|
|
+ * @param mainpro 主打项目
|
|
|
|
+ * @param isAgreed 是否同意勾选同意协议,1是,其他否
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/register")
|
|
|
|
+ public JsonModel register(UserVo user, ShopVo shop, String isAgreed) {
|
|
|
|
+ JsonModel model = JsonModel.newInstance();
|
|
|
|
+ if (null == user || null == shop || StringUtils.isBlank(user.getBindMobile()) || StringUtils.isBlank(shop.getMobileCode())) {
|
|
|
|
+ return model.error("参数异常");
|
|
|
|
+ }
|
|
|
|
+ JsonForm jsonForm = ValidateUtil.wwwValidateMobile(user.getBindMobile());
|
|
|
|
+ if (!jsonForm.isReturn_code()) {
|
|
|
|
+ return model.error(jsonForm.getReturn_message());
|
|
|
|
+ }
|
|
|
|
+ if (!user.getPassword().equals(user.getPassWordConfirm())) {
|
|
|
|
+ return model.error("两次输入的密码不一致");
|
|
|
|
+ }
|
|
|
|
+ if (!"1".equals(isAgreed)) {
|
|
|
|
+ return model.error("请勾选同意协议");
|
|
|
|
+ }
|
|
|
|
+ return supplierService.register(user, shop);
|
|
|
|
+ }
|
|
|
|
+}
|