Commit 246f7b3af4dcf132dd9a29f7208d81ba0dc9757b

Authored by weiliwhereareyou@163.com
1 parent 4e5ad84e

修改密码接口开发

Showing 18 changed files with 398 additions and 166 deletions
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/common/ErrorMessage.java
@@ -49,6 +49,7 @@ public final class ErrorMessage { @@ -49,6 +49,7 @@ public final class ErrorMessage {
49 public static final String USER_PASSWORD_WRONG = "原始密码输入错误,请重新输入"; 49 public static final String USER_PASSWORD_WRONG = "原始密码输入错误,请重新输入";
50 public static final String USER_MOBILE_EXIST = "手机号码已经存在,请重新输入"; 50 public static final String USER_MOBILE_EXIST = "手机号码已经存在,请重新输入";
51 public static final String USER_MOBILE_NOT_EXIST = "用户不存在,请重新输入"; 51 public static final String USER_MOBILE_NOT_EXIST = "用户不存在,请重新输入";
  52 + public static final String USER_UPDATE_INFO = "更新用户信息失败";
52 public static final String USER_CONSIGNEE_SET_DEFAULT_FAILED = "设置默认提货人失败"; 53 public static final String USER_CONSIGNEE_SET_DEFAULT_FAILED = "设置默认提货人失败";
53 public static final String USER_AUTH_USER_PASS = "您提交的身份证号已经被认证"; 54 public static final String USER_AUTH_USER_PASS = "您提交的身份证号已经被认证";
54 public static final String USER_AUTH_ENTERPRISE_PASS = "每个企业仅能注册一次"; 55 public static final String USER_AUTH_ENTERPRISE_PASS = "每个企业仅能注册一次";
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/login/SendVeriCodeReq.java
@@ -37,7 +37,7 @@ public class SendVeriCodeReq extends BaseReq { @@ -37,7 +37,7 @@ public class SendVeriCodeReq extends BaseReq {
37 /** 37 /**
38 * 消息类型 38 * 消息类型
39 */ 39 */
40 - @ApiModelProperty(value = "消息类型:1验证码登录,2注册,3找回密码",required = true) 40 + @ApiModelProperty(value = "消息类型:1验证码登录,2注册,3找回密码 ,4买家修改手机号",required = true)
41 private Integer msgType; 41 private Integer msgType;
42 42
43 43
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/user/UpdateMobileReq.java
1 package com.diligrp.mobsite.getway.domain.protocol.user; 1 package com.diligrp.mobsite.getway.domain.protocol.user;
2 2
3 import com.diligrp.mobsite.getway.domain.protocol.BaseReq; 3 import com.diligrp.mobsite.getway.domain.protocol.BaseReq;
  4 +import io.swagger.annotations.ApiModelProperty;
4 5
5 /** 6 /**
6 * <B>Description</B> 修改手机号码请求 <br /> 7 * <B>Description</B> 修改手机号码请求 <br />
@@ -14,14 +15,55 @@ import com.diligrp.mobsite.getway.domain.protocol.BaseReq; @@ -14,14 +15,55 @@ import com.diligrp.mobsite.getway.domain.protocol.BaseReq;
14 @SuppressWarnings("serial") 15 @SuppressWarnings("serial")
15 public class UpdateMobileReq extends BaseReq{ 16 public class UpdateMobileReq extends BaseReq{
16 /** 17 /**
17 - * 新手机号 18 + * 手机验证
18 */ 19 */
  20 + @ApiModelProperty(value = "验证码",required = true)
  21 + private String veriCode;
  22 + /**
  23 + * 手机号码
  24 + */
  25 + @ApiModelProperty(value = "新手机号码",required = true)
19 private String mobile; 26 private String mobile;
20 27
  28 +
  29 + /**
  30 + * get value of CheckVeriCodeReq.veriCode
  31 + * @return the veriCode
  32 + * @createTime Aug 12, 2014 8:06:20 PM
  33 + * @author wujianjun
  34 + */
  35 + public String getVeriCode() {
  36 + return veriCode;
  37 + }
  38 +
  39 + /**
  40 + * set value of CheckVeriCodeReq.veriCode
  41 + * @param veriCode the veriCode to set
  42 + * @createTime Aug 12, 2014 8:06:20 PM
  43 + * @author wujianjun
  44 + */
  45 + public void setVeriCode(String veriCode) {
  46 + this.veriCode = veriCode;
  47 + }
  48 +
  49 +
  50 + /**
  51 + * get value of CheckVeriCodeReq.mobile
  52 + * @return the mobile
  53 + * @createTime 2014年8月28日 下午5:39:56
  54 + * @author zhangshirui
  55 + */
21 public String getMobile() { 56 public String getMobile() {
22 return mobile; 57 return mobile;
23 } 58 }
24 59
  60 +
  61 + /**
  62 + * set value of CheckVeriCodeReq.mobile
  63 + * @param mobile the mobile to set
  64 + * @createTime 2014年8月28日 下午5:39:56
  65 + * @author zhangshirui
  66 + */
25 public void setMobile(String mobile) { 67 public void setMobile(String mobile) {
26 this.mobile = mobile; 68 this.mobile = mobile;
27 } 69 }
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/user/UpdateSellerInfoReq.java 0 → 100644
  1 +package com.diligrp.mobsite.getway.domain.protocol.user;
  2 +
  3 +import com.diligrp.mobsite.getway.domain.protocol.BaseReq;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +
  7 +/**
  8 + * <B>Description</B> 修改密码请求 <br />
  9 + * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
  10 + * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
  11 + * <B>Company</B> 地利集团
  12 + * @createTime Aug 12, 2014 8:07:31 PM
  13 + * @author wujianjun
  14 + */
  15 +@SuppressWarnings("serial")
  16 +public class UpdateSellerInfoReq extends BaseReq {
  17 +
  18 + /**
  19 + * 原密码
  20 + */
  21 + @ApiModelProperty(value = "原密码")
  22 + private String oldPassword;
  23 + /**
  24 + * 新的密码
  25 + */
  26 + @ApiModelProperty(value = "新密码")
  27 + private String password;
  28 +
  29 +
  30 + public String getOldPassword() {
  31 + return oldPassword;
  32 + }
  33 +
  34 + public void setOldPassword(String oldPassword) {
  35 + this.oldPassword = oldPassword;
  36 + }
  37 +
  38 + public String getPassword() {
  39 + return password;
  40 + }
  41 +
  42 + public void setPassword(String password) {
  43 + this.password = password;
  44 + }
  45 +}
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/user/UpdateSellerInfoResp.java 0 → 100644
  1 +package com.diligrp.mobsite.getway.domain.protocol.user;
  2 +
  3 +import com.diligrp.mobsite.getway.domain.protocol.BaseResp;
  4 +
  5 +
  6 +/**
  7 + * <B>Description</B> 修改密码响应 <br />
  8 + * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
  9 + * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
  10 + * <B>Company</B> 地利集团
  11 + * @createTime Aug 12, 2014 8:09:21 PM
  12 + * @author wujianjun
  13 + */
  14 +@SuppressWarnings("serial")
  15 +public class UpdateSellerInfoResp extends BaseResp {
  16 +
  17 + /**
  18 + * 更新成功
  19 + */
  20 + public static final Integer RESULT_FLAG_SUCCESS=1;
  21 +
  22 + /**
  23 + * 更新失败
  24 + */
  25 + public static final Integer RESULT_FLAG_FAILED=2;
  26 +
  27 + /**
  28 + * 更新结果
  29 + */
  30 +
  31 + private Integer resultFlag = RESULT_FLAG_SUCCESS;
  32 +
  33 +
  34 + /**
  35 + * get value of UpdatePasswordResp.resultFlag
  36 + * @return the resultFlag
  37 + * @createTime 2014年8月28日 下午3:12:31
  38 + * @author zhangshirui
  39 + */
  40 + public Integer getResultFlag() {
  41 + return resultFlag;
  42 + }
  43 +
  44 +
  45 + /**
  46 + * set value of UpdatePasswordResp.resultFlag
  47 + * @param resultFlag the resultFlag to set
  48 + * @createTime 2014年8月28日 下午3:12:31
  49 + * @author zhangshirui
  50 + */
  51 + public void setResultFlag(Integer resultFlag) {
  52 + this.resultFlag = resultFlag;
  53 + }
  54 +
  55 +
  56 +}
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/user/UpdateUserInfoReq.java
@@ -19,11 +19,11 @@ public class UpdateUserInfoReq extends BaseReq { @@ -19,11 +19,11 @@ public class UpdateUserInfoReq extends BaseReq {
19 */ 19 */
20 @ApiModelProperty(value = "新密码") 20 @ApiModelProperty(value = "新密码")
21 private String password; 21 private String password;
22 - /**  
23 - * 再次输入密码  
24 - */  
25 - @ApiModelProperty(value = "再次输入新密码")  
26 - private String oldPassword; 22 + ///**
  23 + // * 再次输入密码
  24 + // */
  25 + //@ApiModelProperty(value = "再次输入新密码")
  26 + //private String oldPassword;
27 /** 27 /**
28 * 性别 28 * 性别
29 */ 29 */
@@ -59,14 +59,6 @@ public class UpdateUserInfoReq extends BaseReq { @@ -59,14 +59,6 @@ public class UpdateUserInfoReq extends BaseReq {
59 this.password = password; 59 this.password = password;
60 } 60 }
61 61
62 - public String getOldPassword() {  
63 - return oldPassword;  
64 - }  
65 -  
66 - public void setOldPassword(String oldPassword) {  
67 - this.oldPassword = oldPassword;  
68 - }  
69 -  
70 public Integer getGender() { 62 public Integer getGender() {
71 return gender; 63 return gender;
72 } 64 }
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/PassportRPC.java
@@ -7,6 +7,7 @@ import com.diligrp.mobsite.getway.domain.protocol.login.LoginReq; @@ -7,6 +7,7 @@ import com.diligrp.mobsite.getway.domain.protocol.login.LoginReq;
7 import com.diligrp.mobsite.getway.domain.protocol.register.SellerRegisterReq; 7 import com.diligrp.mobsite.getway.domain.protocol.register.SellerRegisterReq;
8 import com.diligrp.mobsite.getway.domain.protocol.register.UserRegisterReq; 8 import com.diligrp.mobsite.getway.domain.protocol.register.UserRegisterReq;
9 import com.diligrp.mobsite.getway.domain.protocol.user.ModifyPwdReq; 9 import com.diligrp.mobsite.getway.domain.protocol.user.ModifyPwdReq;
  10 +import com.diligrp.mobsite.getway.domain.protocol.user.UpdateMobileReq;
10 import com.diligrp.mobsite.getway.rpc.base.BaseOutput; 11 import com.diligrp.mobsite.getway.rpc.base.BaseOutput;
11 import com.diligrp.mobsite.getway.rpc.base.BaseService; 12 import com.diligrp.mobsite.getway.rpc.base.BaseService;
12 13
@@ -38,8 +39,13 @@ public interface PassportRPC extends BaseService { @@ -38,8 +39,13 @@ public interface PassportRPC extends BaseService {
38 39
39 boolean verifySellerSmsCode(String mobile, String veriCode); 40 boolean verifySellerSmsCode(String mobile, String veriCode);
40 41
  42 + boolean verifyOldMobileAuthCode(String mobile, String veriCode);
  43 +
  44 +
41 boolean verifyBuyerSmsCode(String mobile, String veriCode); 45 boolean verifyBuyerSmsCode(String mobile, String veriCode);
42 46
43 47
44 BuyerInfoOutput authlogin(AuthLoginReq req); 48 BuyerInfoOutput authlogin(AuthLoginReq req);
  49 +
  50 + void updateMobile(UpdateMobileReq req);
45 } 51 }
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/SellerRPC.java
1 package com.diligrp.mobsite.getway.rpc; 1 package com.diligrp.mobsite.getway.rpc;
2 2
  3 +import com.b2c.myapp.common.api.sellerInfo.input.SellerInfoUpdateInput;
3 import com.b2c.myapp.common.api.sellerInfo.output.SellerInfoOutput; 4 import com.b2c.myapp.common.api.sellerInfo.output.SellerInfoOutput;
4 5
5 6
@@ -46,6 +47,8 @@ public interface SellerRPC { @@ -46,6 +47,8 @@ public interface SellerRPC {
46 47
47 SellerInfoOutput getSellerByMobile(String accountName); 48 SellerInfoOutput getSellerByMobile(String accountName);
48 49
  50 + Boolean updateSellerInfo(SellerInfoUpdateInput input);
  51 +
49 //ShopOutput getShopBySellerId(Long id); 52 //ShopOutput getShopBySellerId(Long id);
50 // 53 //
51 //ShopOutput getShopById(Long id); 54 //ShopOutput getShopById(Long id);
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/UserRPC.java
1 package com.diligrp.mobsite.getway.rpc; 1 package com.diligrp.mobsite.getway.rpc;
2 2
  3 +import com.b2c.myapp.common.api.buyerInfo.input.BuyerInfoUpdateInput;
3 import com.b2c.myapp.common.api.buyerInfo.output.BuyerInfoOutput; 4 import com.b2c.myapp.common.api.buyerInfo.output.BuyerInfoOutput;
4 import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerOutput; 5 import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerOutput;
5 -import com.diligrp.mobsite.getway.domain.protocol.AddCartProduct;  
6 -import com.diligrp.mobsite.getway.domain.protocol.cart.ModifyAmountReq;  
7 -  
8 -import java.util.List;  
9 6
10 7
11 /** 8 /**
@@ -19,28 +16,10 @@ import java.util.List; @@ -19,28 +16,10 @@ import java.util.List;
19 */ 16 */
20 public interface UserRPC { 17 public interface UserRPC {
21 18
22 - boolean addShoppingCart(List<AddCartProduct> cartProducts, Long userId);  
23 19
24 - /**  
25 - * 删除  
26 - * @param userId  
27 - * @param ids  
28 - * @return  
29 - * @createTime 2015年3月4日 下午6:46:54  
30 - * @author zhangshirui  
31 - */  
32 - boolean delCartByIds(Long userId, List<String> ids);  
33 20
34 21
35 - /**  
36 - * 验证用户名或者邮箱是否存在  
37 - *  
38 - * @param accountName  
39 - * @return  
40 - * @createTime 2014年8月27日 下午2:30:45  
41 - * @author zhangshirui  
42 - */  
43 - boolean checkAccountName(String accountName); 22 +
44 23
45 /** 24 /**
46 * 验证电话号码是否存在 25 * 验证电话号码是否存在
@@ -56,14 +35,7 @@ public interface UserRPC { @@ -56,14 +35,7 @@ public interface UserRPC {
56 BuyerInfoOutput checkMobile(String mobile); 35 BuyerInfoOutput checkMobile(String mobile);
57 36
58 37
59 - /**  
60 - * 修改进货单数量  
61 - * @param req  
62 - * @return  
63 - * @createTime 2015年3月9日 下午2:49:27  
64 - * @author zhangshirui  
65 - */  
66 - boolean modifyAmount(ModifyAmountReq req); 38 +
67 39
68 /** 40 /**
69 * 修改密码 41 * 修改密码
@@ -75,29 +47,12 @@ public interface UserRPC { @@ -75,29 +47,12 @@ public interface UserRPC {
75 */ 47 */
76 boolean modifyPwd(String accountName, String newPassword); 48 boolean modifyPwd(String accountName, String newPassword);
77 49
78 - /**  
79 - * 密码加密  
80 - * @param pwd  
81 - * @return  
82 - * @createTime 2014年9月19日 上午10:04:35  
83 - * @author zhangshirui  
84 - */  
85 - String getEncryptPwd(String pwd);  
86 -  
87 -  
88 -  
89 - /**  
90 - * 验证用户密码  
91 - * @param userId  
92 - * @param password  
93 - * @return  
94 - * @createTime 2015年6月24日 下午1:45:53  
95 - * @author zhangshirui  
96 - */  
97 - boolean checkPassword(Long userId, String password); 50 + Boolean updateUserInfo(BuyerInfoUpdateInput input);
98 51
99 52
100 BuyerInfoOutput getUserByMobile(String accountName); 53 BuyerInfoOutput getUserByMobile(String accountName);
101 54
102 ShopBuyerOutput getDepositCardAmount(Long shopBuyerId,Long buyerId); 55 ShopBuyerOutput getDepositCardAmount(Long shopBuyerId,Long buyerId);
  56 +
  57 +
103 } 58 }
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/impl/PassportRPCImpl.java
@@ -12,6 +12,7 @@ import com.diligrp.mobsite.getway.domain.protocol.login.SendVeriCodeReq; @@ -12,6 +12,7 @@ import com.diligrp.mobsite.getway.domain.protocol.login.SendVeriCodeReq;
12 import com.diligrp.mobsite.getway.domain.protocol.register.SellerRegisterReq; 12 import com.diligrp.mobsite.getway.domain.protocol.register.SellerRegisterReq;
13 import com.diligrp.mobsite.getway.domain.protocol.register.UserRegisterReq; 13 import com.diligrp.mobsite.getway.domain.protocol.register.UserRegisterReq;
14 import com.diligrp.mobsite.getway.domain.protocol.user.ModifyPwdReq; 14 import com.diligrp.mobsite.getway.domain.protocol.user.ModifyPwdReq;
  15 +import com.diligrp.mobsite.getway.domain.protocol.user.UpdateMobileReq;
15 import com.diligrp.mobsite.getway.rpc.PassportRPC; 16 import com.diligrp.mobsite.getway.rpc.PassportRPC;
16 import com.diligrp.mobsite.getway.rpc.base.BaseOutput; 17 import com.diligrp.mobsite.getway.rpc.base.BaseOutput;
17 import com.diligrp.mobsite.getway.rpc.base.impl.BaseServiceImpl; 18 import com.diligrp.mobsite.getway.rpc.base.impl.BaseServiceImpl;
@@ -251,6 +252,9 @@ public class PassportRPCImpl extends BaseServiceImpl implements PassportRPC { @@ -251,6 +252,9 @@ public class PassportRPCImpl extends BaseServiceImpl implements PassportRPC {
251 if (msgType== SendVeriCodeReq.MSG_TYPE_RETRIEVE_PASSWORD){ 252 if (msgType== SendVeriCodeReq.MSG_TYPE_RETRIEVE_PASSWORD){
252 output = super.httpGet("/api/forgot/sendBuyerForgotPasswordSMS/"+mobile, null, new TypeReference<BaseOutput<String>>(){}); 253 output = super.httpGet("/api/forgot/sendBuyerForgotPasswordSMS/"+mobile, null, new TypeReference<BaseOutput<String>>(){});
253 } 254 }
  255 + if (msgType== SendVeriCodeReq.MSG_TYPE_MODIFY_NEW_MOBILE){
  256 + output = super.httpGet("/api/user/sendBuyerSMS/"+mobile, null, new TypeReference<BaseOutput<String>>(){});
  257 + }
254 } catch (Exception e) { 258 } catch (Exception e) {
255 259
256 if (msgType== SendVeriCodeReq.MSG_TYPE_LOGIN){ 260 if (msgType== SendVeriCodeReq.MSG_TYPE_LOGIN){
@@ -262,6 +266,9 @@ public class PassportRPCImpl extends BaseServiceImpl implements PassportRPC { @@ -262,6 +266,9 @@ public class PassportRPCImpl extends BaseServiceImpl implements PassportRPC {
262 if (msgType== SendVeriCodeReq.MSG_TYPE_RETRIEVE_PASSWORD){ 266 if (msgType== SendVeriCodeReq.MSG_TYPE_RETRIEVE_PASSWORD){
263 log.error("error:调用passport买家忘记密码发送验证码短信失败",e); 267 log.error("error:调用passport买家忘记密码发送验证码短信失败",e);
264 } 268 }
  269 + if (msgType== SendVeriCodeReq.MSG_TYPE_MODIFY_NEW_MOBILE){
  270 + log.error("error:调用passport买家修改手机号发送验证码短信失败",e);
  271 + }
265 throw new ServiceException(); 272 throw new ServiceException();
266 } 273 }
267 274
@@ -276,7 +283,9 @@ public class PassportRPCImpl extends BaseServiceImpl implements PassportRPC { @@ -276,7 +283,9 @@ public class PassportRPCImpl extends BaseServiceImpl implements PassportRPC {
276 if (msgType== SendVeriCodeReq.MSG_TYPE_RETRIEVE_PASSWORD){ 283 if (msgType== SendVeriCodeReq.MSG_TYPE_RETRIEVE_PASSWORD){
277 log.error("error:调用passport买家忘记密码发送验证码短信失败[mobile=,code,msg=]",new Object[]{mobile,output.getCode(),output.getResult()}); 284 log.error("error:调用passport买家忘记密码发送验证码短信失败[mobile=,code,msg=]",new Object[]{mobile,output.getCode(),output.getResult()});
278 } 285 }
279 - 286 + if (msgType== SendVeriCodeReq.MSG_TYPE_MODIFY_NEW_MOBILE){
  287 + log.error("error:调用passport买家修改手机号发送验证码短信失败[mobile=,code,msg=]",new Object[]{mobile,output.getCode(),output.getResult()});
  288 + }
280 throw new ServiceException(output.getCode(),output.getResult()); 289 throw new ServiceException(output.getCode(),output.getResult());
281 } 290 }
282 291
@@ -307,6 +316,27 @@ public class PassportRPCImpl extends BaseServiceImpl implements PassportRPC { @@ -307,6 +316,27 @@ public class PassportRPCImpl extends BaseServiceImpl implements PassportRPC {
307 316
308 317
309 @Override 318 @Override
  319 + public boolean verifyOldMobileAuthCode(String mobile, String veriCode) {
  320 + BaseOutput<String> output = null;
  321 + Map<String,String> params = new HashMap<String, String>();
  322 + params.put("phoneNumber", mobile);
  323 + params.put("code", veriCode);
  324 + try {
  325 + output = super.httpPost("/api/user/verifyBuyerSmsCode", params, null);
  326 + } catch (Exception e) {
  327 + log.error("error:买家修改手机号-校验短信验证码失败",e);
  328 + throw new ServiceException();
  329 + }
  330 +
  331 + if (output.getCode()!= 200){
  332 + log.error("error:买家修改手机号-校验短信验证码失败[mobile=,msg=]",mobile,output.getResult());
  333 + throw new ServiceException(output.getCode(),output.getResult());
  334 + }
  335 +
  336 + return output.getCode().equals(com.b2c.myapp.common.utils.ResultCode.OK);
  337 + }
  338 +
  339 + @Override
310 public boolean verifyBuyerSmsCode(String mobile, String veriCode) { 340 public boolean verifyBuyerSmsCode(String mobile, String veriCode) {
311 BaseOutput<String> output = null; 341 BaseOutput<String> output = null;
312 Map<String,String> params = new HashMap<String, String>(); 342 Map<String,String> params = new HashMap<String, String>();
@@ -352,4 +382,25 @@ public class PassportRPCImpl extends BaseServiceImpl implements PassportRPC { @@ -352,4 +382,25 @@ public class PassportRPCImpl extends BaseServiceImpl implements PassportRPC {
352 return buyerInfo; 382 return buyerInfo;
353 383
354 } 384 }
  385 +
  386 + @Override
  387 + public void updateMobile(UpdateMobileReq req) {
  388 + Map<String,String> params = new HashMap<>();
  389 + params.put("userId", req.getUserId()+"");
  390 + params.put("newPhoneNumber", req.getMobile());
  391 + params.put("code", req.getVeriCode());
  392 + BaseOutput<String > output = null;
  393 + try {
  394 + output = super.httpPost("/api/user/updateBuyerPhoneNumber", params, new TypeReference<BaseOutput<String>>(){});
  395 + } catch (Exception e) {
  396 + log.error("error:调用passport修改买家手机号接口失败",e);
  397 + throw new ServiceException();
  398 + }
  399 + if (output.getCode()!=ResultCode.SUCCESS){
  400 + log.error("error:调用passport修改买家手机号失败[mobile=,code=,msg=]",new Object[]{req.getMobile(),output.getCode(),output.getResult()});
  401 + throw new ServiceException(ResultCode.BUSINESS_FAILED,output.getResult());
  402 + }
  403 +
  404 +
  405 + }
355 } 406 }
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/impl/SellerRPCImpl.java
1 package com.diligrp.mobsite.getway.rpc.impl; 1 package com.diligrp.mobsite.getway.rpc.impl;
2 2
  3 +import com.b2c.myapp.common.api.sellerInfo.input.SellerInfoUpdateInput;
3 import com.b2c.myapp.common.api.sellerInfo.output.SellerInfoOutput; 4 import com.b2c.myapp.common.api.sellerInfo.output.SellerInfoOutput;
4 import com.b2c.myapp.common.utils.BaseOutput; 5 import com.b2c.myapp.common.utils.BaseOutput;
5 import com.b2c.myapp.sdk.MyAppClient; 6 import com.b2c.myapp.sdk.MyAppClient;
@@ -34,7 +35,7 @@ public class SellerRPCImpl implements SellerRPC { @@ -34,7 +35,7 @@ public class SellerRPCImpl implements SellerRPC {
34 @Resource 35 @Resource
35 private RedisUtil redisUtil; 36 private RedisUtil redisUtil;
36 @Resource 37 @Resource
37 - private MyAppClient userClient; 38 + private MyAppClient myAppClient;
38 @Resource 39 @Resource
39 private WebsiteClient websiteClient; 40 private WebsiteClient websiteClient;
40 @Resource 41 @Resource
@@ -49,7 +50,7 @@ public class SellerRPCImpl implements SellerRPC { @@ -49,7 +50,7 @@ public class SellerRPCImpl implements SellerRPC {
49 public SellerInfoOutput checkMobile(String mobile) { 50 public SellerInfoOutput checkMobile(String mobile) {
50 BaseOutput<SellerInfoOutput> output = null; 51 BaseOutput<SellerInfoOutput> output = null;
51 try { 52 try {
52 - output = userClient.getSellerInfoService().getSellerInfoByMobilePhone(mobile); 53 + output = myAppClient.getSellerInfoService().getSellerInfoByMobilePhone(mobile);
53 } catch (Exception e) { 54 } catch (Exception e) {
54 logger.error("检测电话号码接口挂掉:msg={}",e.getMessage()); 55 logger.error("检测电话号码接口挂掉:msg={}",e.getMessage());
55 throw new ServiceException(); 56 throw new ServiceException();
@@ -78,7 +79,7 @@ public class SellerRPCImpl implements SellerRPC { @@ -78,7 +79,7 @@ public class SellerRPCImpl implements SellerRPC {
78 BaseOutput<SellerInfoOutput> output = null; 79 BaseOutput<SellerInfoOutput> output = null;
79 boolean flag = false; 80 boolean flag = false;
80 try { 81 try {
81 - output = userClient.getSellerInfoService().getSellerInfoByMobilePhone(accountName); 82 + output = myAppClient.getSellerInfoService().getSellerInfoByMobilePhone(accountName);
82 } catch (Exception e) { 83 } catch (Exception e) {
83 logger.error("调用手机号查询卖家接口挂掉:msg={}",e.getMessage()); 84 logger.error("调用手机号查询卖家接口挂掉:msg={}",e.getMessage());
84 throw new ServiceException(); 85 throw new ServiceException();
@@ -96,6 +97,23 @@ public class SellerRPCImpl implements SellerRPC { @@ -96,6 +97,23 @@ public class SellerRPCImpl implements SellerRPC {
96 return output.getData(); 97 return output.getData();
97 } 98 }
98 99
  100 + @Override
  101 + public Boolean updateSellerInfo(SellerInfoUpdateInput input) {
  102 + BaseOutput<Boolean> output = null;
  103 + try {
  104 + output = myAppClient.getSellerInfoService().modify(input);
  105 + } catch (Exception e) {
  106 + logger.error("更新买家信息接口挂掉:msg={}",e.getMessage());
  107 + throw new ServiceException();
  108 + }
  109 +
  110 + if (output==null||!output.getCode().equals(com.b2c.myapp.common.utils.ResultCode.OK)){
  111 + logger.error("更新买家信息失败:[userId={},code={},result={}]",new Object[]{input.getAccountName(),output.getCode(),output.getResult()});
  112 + throw new ServiceException(ResultCode.BUSINESS_FAILED, ErrorMessage.USER_UPDATE_INFO);
  113 + }
  114 + return output.getData();
  115 + }
  116 +
99 //@Override 117 //@Override
100 //public ShopOutput getShopBySellerId(Long id) { 118 //public ShopOutput getShopBySellerId(Long id) {
101 // BaseOutput<ShopOutput> output = null; 119 // BaseOutput<ShopOutput> output = null;
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/impl/UserRPCImpl.java
1 package com.diligrp.mobsite.getway.rpc.impl; 1 package com.diligrp.mobsite.getway.rpc.impl;
2 2
  3 +import com.b2c.myapp.common.api.buyerInfo.input.BuyerInfoUpdateInput;
3 import com.b2c.myapp.common.api.buyerInfo.output.BuyerInfoOutput; 4 import com.b2c.myapp.common.api.buyerInfo.output.BuyerInfoOutput;
4 import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerOutput; 5 import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerOutput;
5 import com.b2c.myapp.common.utils.BaseOutput; 6 import com.b2c.myapp.common.utils.BaseOutput;
@@ -7,8 +8,6 @@ import com.b2c.myapp.sdk.MyAppClient; @@ -7,8 +8,6 @@ import com.b2c.myapp.sdk.MyAppClient;
7 import com.diligrp.mobsite.getway.domain.common.ErrorMessage; 8 import com.diligrp.mobsite.getway.domain.common.ErrorMessage;
8 import com.diligrp.mobsite.getway.domain.common.ResultCode; 9 import com.diligrp.mobsite.getway.domain.common.ResultCode;
9 import com.diligrp.mobsite.getway.domain.except.ServiceException; 10 import com.diligrp.mobsite.getway.domain.except.ServiceException;
10 -import com.diligrp.mobsite.getway.domain.protocol.AddCartProduct;  
11 -import com.diligrp.mobsite.getway.domain.protocol.cart.ModifyAmountReq;  
12 import com.diligrp.mobsite.getway.rpc.UserRPC; 11 import com.diligrp.mobsite.getway.rpc.UserRPC;
13 import com.diligrp.website.util.security.Validator; 12 import com.diligrp.website.util.security.Validator;
14 import org.slf4j.Logger; 13 import org.slf4j.Logger;
@@ -16,7 +15,6 @@ import org.slf4j.LoggerFactory; @@ -16,7 +15,6 @@ import org.slf4j.LoggerFactory;
16 import org.springframework.stereotype.Service; 15 import org.springframework.stereotype.Service;
17 16
18 import javax.annotation.Resource; 17 import javax.annotation.Resource;
19 -import java.util.List;  
20 18
21 19
22 /** 20 /**
@@ -39,20 +37,6 @@ public class UserRPCImpl implements UserRPC { @@ -39,20 +37,6 @@ public class UserRPCImpl implements UserRPC {
39 37
40 private static final Logger logger = LoggerFactory.getLogger(UserRPCImpl.class); 38 private static final Logger logger = LoggerFactory.getLogger(UserRPCImpl.class);
41 39
42 - @Override  
43 - public boolean addShoppingCart(List<AddCartProduct> cartProducts, Long userId) {  
44 - return false;  
45 - }  
46 -  
47 - @Override  
48 - public boolean delCartByIds(Long userId, List<String> ids) {  
49 - return false;  
50 - }  
51 -  
52 - @Override  
53 - public boolean checkAccountName(String accountName) {  
54 - return false;  
55 - }  
56 40
57 @Override 41 @Override
58 public BuyerInfoOutput checkMobile(String mobile) { 42 public BuyerInfoOutput checkMobile(String mobile) {
@@ -72,10 +56,6 @@ public class UserRPCImpl implements UserRPC { @@ -72,10 +56,6 @@ public class UserRPCImpl implements UserRPC {
72 return output.getData(); 56 return output.getData();
73 } 57 }
74 58
75 - @Override  
76 - public boolean modifyAmount(ModifyAmountReq req) {  
77 - return false;  
78 - }  
79 59
80 60
81 @Override 61 @Override
@@ -113,7 +93,7 @@ public class UserRPCImpl implements UserRPC { @@ -113,7 +93,7 @@ public class UserRPCImpl implements UserRPC {
113 93
114 if (output==null||!output.getCode().equals(com.b2c.myapp.common.utils.ResultCode.OK)){ 94 if (output==null||!output.getCode().equals(com.b2c.myapp.common.utils.ResultCode.OK)){
115 logger.error("买家查询储值卡余额失败:[userId={},code={},result={}]",new Object[]{buyerId,output.getCode(),output.getResult()}); 95 logger.error("买家查询储值卡余额失败:[userId={},code={},result={}]",new Object[]{buyerId,output.getCode(),output.getResult()});
116 - throw new ServiceException(); 96 + throw new ServiceException(ResultCode.BUSINESS_FAILED,output.getResult());
117 } 97 }
118 return output.getData(); 98 return output.getData();
119 } 99 }
@@ -124,13 +104,20 @@ public class UserRPCImpl implements UserRPC { @@ -124,13 +104,20 @@ public class UserRPCImpl implements UserRPC {
124 } 104 }
125 105
126 @Override 106 @Override
127 - public String getEncryptPwd(String pwd) {  
128 - return null;  
129 - } 107 + public Boolean updateUserInfo(BuyerInfoUpdateInput input) {
  108 + BaseOutput<Boolean> output = null;
  109 + try {
  110 + output = myAppClient.getBuyerInfoService().modify(input);
  111 + } catch (Exception e) {
  112 + logger.error("更新买家信息接口挂掉:msg={}",e.getMessage());
  113 + throw new ServiceException();
  114 + }
130 115
131 - @Override  
132 - public boolean checkPassword(Long userId, String password) {  
133 - return false; 116 + if (output==null||!output.getCode().equals(com.b2c.myapp.common.utils.ResultCode.OK)){
  117 + logger.error("更新买家信息失败:[userId={},code={},result={}]",new Object[]{input.getAccountName(),output.getCode(),output.getResult()});
  118 + throw new ServiceException(ResultCode.BUSINESS_FAILED, ErrorMessage.USER_UPDATE_INFO);
  119 + }
  120 + return output.getData();
134 } 121 }
135 122
136 123
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/user/UserService.java
@@ -110,4 +110,8 @@ public interface UserService { @@ -110,4 +110,8 @@ public interface UserService {
110 * @return 110 * @return
111 */ 111 */
112 GetDeliveryAddressResp getDeliveryAddresses(GetDeliveryAddressReq req); 112 GetDeliveryAddressResp getDeliveryAddresses(GetDeliveryAddressReq req);
  113 +
  114 + CheckVeriCodeResp checkOldMobileAuthCode(CheckVeriCodeReq req);
  115 +
  116 + UpdateMobileResp updateMobile(UpdateMobileReq req);
113 } 117 }
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/user/impl/UserServiceImpl.java
1 package com.diligrp.mobsite.getway.service.buyer.user.impl; 1 package com.diligrp.mobsite.getway.service.buyer.user.impl;
2 2
3 -import java.util.ArrayList;  
4 -import java.util.HashMap;  
5 -import java.util.List;  
6 -import java.util.Map;  
7 -  
8 -import javax.annotation.Resource;  
9 -  
10 -import org.slf4j.Logger;  
11 -import org.slf4j.LoggerFactory;  
12 -import org.springframework.beans.factory.annotation.Autowired;  
13 -import org.springframework.beans.factory.annotation.Value;  
14 -import org.springframework.stereotype.Service;  
15 - 3 +import com.b2c.myapp.common.api.buyerInfo.input.BuyerInfoUpdateInput;
16 import com.b2c.myapp.common.api.buyerInfo.output.BuyerInfoOutput; 4 import com.b2c.myapp.common.api.buyerInfo.output.BuyerInfoOutput;
17 import com.b2c.myapp.common.api.pickingInfo.output.PickingInfoOutput; 5 import com.b2c.myapp.common.api.pickingInfo.output.PickingInfoOutput;
18 import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerOutput; 6 import com.b2c.myapp.common.api.shopBuyer.output.ShopBuyerOutput;
@@ -23,33 +11,10 @@ import com.diligrp.mobsite.getway.domain.common.RedisKey; @@ -23,33 +11,10 @@ import com.diligrp.mobsite.getway.domain.common.RedisKey;
23 import com.diligrp.mobsite.getway.domain.common.ResultCode; 11 import com.diligrp.mobsite.getway.domain.common.ResultCode;
24 import com.diligrp.mobsite.getway.domain.except.ServiceException; 12 import com.diligrp.mobsite.getway.domain.except.ServiceException;
25 import com.diligrp.mobsite.getway.domain.protocol.PickInfo; 13 import com.diligrp.mobsite.getway.domain.protocol.PickInfo;
26 -import com.diligrp.mobsite.getway.domain.protocol.login.AuthLoginReq;  
27 -import com.diligrp.mobsite.getway.domain.protocol.login.CheckVeriCodeReq;  
28 -import com.diligrp.mobsite.getway.domain.protocol.login.CheckVeriCodeResp;  
29 -import com.diligrp.mobsite.getway.domain.protocol.login.LoginReq;  
30 -import com.diligrp.mobsite.getway.domain.protocol.login.LoginResp;  
31 -import com.diligrp.mobsite.getway.domain.protocol.login.LogoutReq;  
32 -import com.diligrp.mobsite.getway.domain.protocol.login.LogoutResp;  
33 -import com.diligrp.mobsite.getway.domain.protocol.login.SendVeriCodeReq;  
34 -import com.diligrp.mobsite.getway.domain.protocol.login.SendVeriCodeResp; 14 +import com.diligrp.mobsite.getway.domain.protocol.login.*;
35 import com.diligrp.mobsite.getway.domain.protocol.register.UserRegisterReq; 15 import com.diligrp.mobsite.getway.domain.protocol.register.UserRegisterReq;
36 import com.diligrp.mobsite.getway.domain.protocol.register.UserRegisterResp; 16 import com.diligrp.mobsite.getway.domain.protocol.register.UserRegisterResp;
37 -import com.diligrp.mobsite.getway.domain.protocol.user.GetDeliveryAddressReq;  
38 -import com.diligrp.mobsite.getway.domain.protocol.user.GetDeliveryAddressResp;  
39 -import com.diligrp.mobsite.getway.domain.protocol.user.GetDepositCardAmountReq;  
40 -import com.diligrp.mobsite.getway.domain.protocol.user.GetDepositCardAmountResp;  
41 -import com.diligrp.mobsite.getway.domain.protocol.user.GetRegisterNoReq;  
42 -import com.diligrp.mobsite.getway.domain.protocol.user.GetRegisterNoResp;  
43 -import com.diligrp.mobsite.getway.domain.protocol.user.GetRegisterNobyUidsReq;  
44 -import com.diligrp.mobsite.getway.domain.protocol.user.GetRegisterNobyUidsResp;  
45 -import com.diligrp.mobsite.getway.domain.protocol.user.GetUserInfoReq;  
46 -import com.diligrp.mobsite.getway.domain.protocol.user.GetUserInfoResp;  
47 -import com.diligrp.mobsite.getway.domain.protocol.user.ModifyPwdReq;  
48 -import com.diligrp.mobsite.getway.domain.protocol.user.ModifyPwdResp;  
49 -import com.diligrp.mobsite.getway.domain.protocol.user.SearchUserInfoReq;  
50 -import com.diligrp.mobsite.getway.domain.protocol.user.SearchUserInfoResp;  
51 -import com.diligrp.mobsite.getway.domain.protocol.user.UpdateUserInfoReq;  
52 -import com.diligrp.mobsite.getway.domain.protocol.user.UpdateUserInfoResp; 17 +import com.diligrp.mobsite.getway.domain.protocol.user.*;
53 import com.diligrp.mobsite.getway.domain.protocol.user.model.RegisterNoPlatform; 18 import com.diligrp.mobsite.getway.domain.protocol.user.model.RegisterNoPlatform;
54 import com.diligrp.mobsite.getway.manager.common.RegisterNoMapperManager; 19 import com.diligrp.mobsite.getway.manager.common.RegisterNoMapperManager;
55 import com.diligrp.mobsite.getway.rpc.PassportRPC; 20 import com.diligrp.mobsite.getway.rpc.PassportRPC;
@@ -57,8 +22,17 @@ import com.diligrp.mobsite.getway.rpc.PickInfoRPC; @@ -57,8 +22,17 @@ import com.diligrp.mobsite.getway.rpc.PickInfoRPC;
57 import com.diligrp.mobsite.getway.rpc.UserRPC; 22 import com.diligrp.mobsite.getway.rpc.UserRPC;
58 import com.diligrp.mobsite.getway.rpc.base.BaseOutput; 23 import com.diligrp.mobsite.getway.rpc.base.BaseOutput;
59 import com.diligrp.mobsite.getway.service.buyer.user.UserService; 24 import com.diligrp.mobsite.getway.service.buyer.user.UserService;
  25 +import com.diligrp.mobsite.getway.service.common.utils.DateUtils;
60 import com.diligrp.website.util.redis.impl.RedisUtilImpl; 26 import com.diligrp.website.util.redis.impl.RedisUtilImpl;
61 import com.diligrp.website.util.security.Validator; 27 import com.diligrp.website.util.security.Validator;
  28 +import org.slf4j.Logger;
  29 +import org.slf4j.LoggerFactory;
  30 +import org.springframework.beans.factory.annotation.Autowired;
  31 +import org.springframework.beans.factory.annotation.Value;
  32 +import org.springframework.stereotype.Service;
  33 +
  34 +import javax.annotation.Resource;
  35 +import java.util.*;
62 36
63 /** 37 /**
64 * <B>Description</B> 用户 服务层 <br /> 38 * <B>Description</B> 用户 服务层 <br />
@@ -241,7 +215,32 @@ public class UserServiceImpl implements UserService { @@ -241,7 +215,32 @@ public class UserServiceImpl implements UserService {
241 215
242 @Override 216 @Override
243 public UpdateUserInfoResp updateUserInfo(UpdateUserInfoReq req) { 217 public UpdateUserInfoResp updateUserInfo(UpdateUserInfoReq req) {
244 - return null; 218 + BuyerInfoUpdateInput input = new BuyerInfoUpdateInput();
  219 + input.setId(req.getUserId());
  220 + input.setMobilePhone(req.getMobile());
  221 + if (!Validator.isNull(req.getNickname())){
  222 + input.setAccountName(req.getNickname());
  223 + }
  224 + if (!Validator.isNull(req.getPassword())){
  225 + input.setAccountPwd(req.getPassword());
  226 + }
  227 +
  228 + if (!Validator.isNull(req.getBirth())){
  229 + try {
  230 + input.setBirthday(DateUtils.parseDate(req.getBirth(),DateUtils.DATE_FORMAT ));
  231 + } catch (Exception e) {
  232 + logger.error("日期转换错误",e);
  233 + throw new ServiceException();
  234 + }
  235 + }
  236 + if (!Validator.isNull(req.getGender())){
  237 + input.setSex(req.getGender());
  238 + }
  239 + if (!Validator.isNull(req.getHeadImg())){
  240 + input.setFace(req.getHeadImg());
  241 + }
  242 + userRPC.updateUserInfo(input);
  243 + return new UpdateUserInfoResp();
245 } 244 }
246 245
247 @Override 246 @Override
@@ -454,4 +453,18 @@ public class UserServiceImpl implements UserService { @@ -454,4 +453,18 @@ public class UserServiceImpl implements UserService {
454 resp.setPickInfo(pickInfo); 453 resp.setPickInfo(pickInfo);
455 return resp; 454 return resp;
456 } 455 }
  456 +
  457 + @Override
  458 + public CheckVeriCodeResp checkOldMobileAuthCode(CheckVeriCodeReq req) {
  459 + passportRPC.verifyOldMobileAuthCode(req.getMobile(), req.getVeriCode());
  460 +
  461 + return new CheckVeriCodeResp();
  462 + }
  463 +
  464 + @Override
  465 + public UpdateMobileResp updateMobile(UpdateMobileReq req) {
  466 + passportRPC.updateMobile(req);
  467 +
  468 + return new UpdateMobileResp();
  469 + }
457 } 470 }
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/seller/SellerUserService.java
@@ -45,4 +45,5 @@ public interface SellerUserService { @@ -45,4 +45,5 @@ public interface SellerUserService {
45 LogoutResp logout(LogoutReq req); 45 LogoutResp logout(LogoutReq req);
46 46
47 47
  48 + UpdateSellerInfoResp updateUserInfo(UpdateSellerInfoReq req);
48 } 49 }
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/seller/impl/SellerUserServiceImpl.java
1 package com.diligrp.mobsite.getway.service.seller.impl; 1 package com.diligrp.mobsite.getway.service.seller.impl;
2 2
  3 +import com.b2c.myapp.common.api.sellerInfo.input.SellerInfoUpdateInput;
3 import com.b2c.myapp.common.api.sellerInfo.output.SellerInfoOutput; 4 import com.b2c.myapp.common.api.sellerInfo.output.SellerInfoOutput;
4 import com.b2c.myapp.common.api.shop.output.ShopOutput; 5 import com.b2c.myapp.common.api.shop.output.ShopOutput;
5 import com.diligrp.mobsite.getway.domain.RegisterNoMapper; 6 import com.diligrp.mobsite.getway.domain.RegisterNoMapper;
@@ -12,9 +13,7 @@ import com.diligrp.mobsite.getway.domain.protocol.login.*; @@ -12,9 +13,7 @@ import com.diligrp.mobsite.getway.domain.protocol.login.*;
12 import com.diligrp.mobsite.getway.domain.protocol.register.*; 13 import com.diligrp.mobsite.getway.domain.protocol.register.*;
13 import com.diligrp.mobsite.getway.domain.protocol.saler.user.SellerLoginReq; 14 import com.diligrp.mobsite.getway.domain.protocol.saler.user.SellerLoginReq;
14 import com.diligrp.mobsite.getway.domain.protocol.saler.user.SellerLoginResp; 15 import com.diligrp.mobsite.getway.domain.protocol.saler.user.SellerLoginResp;
15 -import com.diligrp.mobsite.getway.domain.protocol.user.GetRegisterNoResp;  
16 -import com.diligrp.mobsite.getway.domain.protocol.user.ModifyPwdReq;  
17 -import com.diligrp.mobsite.getway.domain.protocol.user.ModifyPwdResp; 16 +import com.diligrp.mobsite.getway.domain.protocol.user.*;
18 import com.diligrp.mobsite.getway.manager.common.RegisterNoMapperManager; 17 import com.diligrp.mobsite.getway.manager.common.RegisterNoMapperManager;
19 import com.diligrp.mobsite.getway.rpc.PassportRPC; 18 import com.diligrp.mobsite.getway.rpc.PassportRPC;
20 import com.diligrp.mobsite.getway.rpc.SellerRPC; 19 import com.diligrp.mobsite.getway.rpc.SellerRPC;
@@ -294,7 +293,14 @@ public class SellerUserServiceImpl implements SellerUserService { @@ -294,7 +293,14 @@ public class SellerUserServiceImpl implements SellerUserService {
294 return resp; 293 return resp;
295 } 294 }
296 295
297 - 296 + @Override
  297 + public UpdateSellerInfoResp updateUserInfo(UpdateSellerInfoReq req) {
  298 + SellerInfoUpdateInput input = new SellerInfoUpdateInput();
  299 + input.setId(req.getUserId());
  300 + input.setMobilePhone(req.getPassword());
  301 + sellerRPC.updateSellerInfo(input);
  302 + return new UpdateSellerInfoResp();
  303 + }
298 304
299 305
300 } 306 }
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/user/UserController.java
@@ -227,6 +227,59 @@ public class UserController extends BaseApiController { @@ -227,6 +227,59 @@ public class UserController extends BaseApiController {
227 } 227 }
228 228
229 /** 229 /**
  230 + * 修改买家手机号:验证旧手机号验证码
  231 + *
  232 + * @createTime 2017年2月24日 下午10:55:03
  233 + * @author weili
  234 + */
  235 + @ApiOperation(value = "修改手机号:验证旧手机号验证码", httpMethod = "POST", notes = "验证手机收到的验证码", response = CheckVeriCodeResp.class)
  236 + @RequestMapping(value = "/checkOldMobileAuthCode", method = RequestMethod.POST)
  237 + @ResponseBody
  238 + public void checkOldMobileAuthCode(@RequestBody CheckVeriCodeReq temp) {
  239 + CheckVeriCodeReq req = super.getRequest(CheckVeriCodeReq.class);
  240 + try {
  241 + BeanValidator.validator(req);
  242 + CheckVeriCodeResp resp = userService.checkOldMobileAuthCode(req);
  243 + super.sendSuccessResp(resp);
  244 + } catch (ServiceException e) {
  245 + LOGGER.error(
  246 + String.format("Code=%s,ErrorMessage=%s,UserId=%s", e.getCode(), e.getMessage(), req.getUserId()),
  247 + e);
  248 + sendError(e.getCode(), e.getMessage());
  249 + } catch (Exception e) {
  250 + LOGGER.error("验证手机收到的验证码:", e);
  251 + super.sendError(e.getMessage());
  252 + }
  253 + }
  254 +
  255 +
  256 + /**
  257 + * 修改买家手机号
  258 + * @createTime 2017年2月24日 下午10:55:03
  259 + * @author weili
  260 + */
  261 + @ApiOperation(value = "修改买家手机号", httpMethod = "POST", notes = "验证手机收到的验证码", response = CheckVeriCodeResp.class)
  262 + @RequestMapping(value = "/updateMobile", method = RequestMethod.POST)
  263 + @ResponseBody
  264 + public void updateMobile (@RequestBody UpdateMobileReq temp) {
  265 + UpdateMobileReq req = super.getRequest(UpdateMobileReq.class);
  266 + try {
  267 + //BeanValidator.validator(req);
  268 + UpdateMobileResp resp = userService.updateMobile(req);
  269 + super.sendSuccessResp(resp);
  270 + } catch (ServiceException e) {
  271 + LOGGER.error(
  272 + String.format("Code=%s,ErrorMessage=%s,UserId=%s", e.getCode(), e.getMessage(), req.getUserId()),
  273 + e);
  274 + sendError(e.getCode(), e.getMessage());
  275 + } catch (Exception e) {
  276 + LOGGER.error("验证手机收到的验证码:", e);
  277 + super.sendError(e.getMessage());
  278 + }
  279 + }
  280 +
  281 +
  282 + /**
230 * 买家注册 283 * 买家注册
231 * 284 *
232 * @createTime 2014年8月28日 下午3:41:02 285 * @createTime 2014年8月28日 下午3:41:02
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/seller/user/SellerUserController.java
@@ -8,8 +8,7 @@ import com.diligrp.mobsite.getway.domain.protocol.register.SellerRegisterReq; @@ -8,8 +8,7 @@ import com.diligrp.mobsite.getway.domain.protocol.register.SellerRegisterReq;
8 import com.diligrp.mobsite.getway.domain.protocol.register.SellerRegisterResp; 8 import com.diligrp.mobsite.getway.domain.protocol.register.SellerRegisterResp;
9 import com.diligrp.mobsite.getway.domain.protocol.saler.user.SellerLoginReq; 9 import com.diligrp.mobsite.getway.domain.protocol.saler.user.SellerLoginReq;
10 import com.diligrp.mobsite.getway.domain.protocol.saler.user.SellerLoginResp; 10 import com.diligrp.mobsite.getway.domain.protocol.saler.user.SellerLoginResp;
11 -import com.diligrp.mobsite.getway.domain.protocol.user.ModifyPwdReq;  
12 -import com.diligrp.mobsite.getway.domain.protocol.user.ModifyPwdResp; 11 +import com.diligrp.mobsite.getway.domain.protocol.user.*;
13 import com.diligrp.mobsite.getway.service.seller.SellerUserService; 12 import com.diligrp.mobsite.getway.service.seller.SellerUserService;
14 import com.diligrp.mobsite.getway.web.api.base.BaseApiController; 13 import com.diligrp.mobsite.getway.web.api.base.BaseApiController;
15 import com.diligrp.mobsite.getway.web.utils.BeanValidator; 14 import com.diligrp.mobsite.getway.web.utils.BeanValidator;
@@ -270,29 +269,29 @@ public class SellerUserController extends BaseApiController { @@ -270,29 +269,29 @@ public class SellerUserController extends BaseApiController {
270 } 269 }
271 } 270 }
272 271
273 - ///**  
274 - // * 个人信息维护  
275 - // * @createTime 2016年8月24日 下午10:55:03  
276 - // * @author weili  
277 - // */  
278 - //@ApiOperation(value = "个人信息维护", httpMethod = "POST" ,response = UpdateUserInfoResp.class)  
279 - //@RequestMapping(value = "/updateUserInfo",method = RequestMethod.POST)  
280 - //@ResponseBody  
281 - //public void updateUserInfo(@RequestBody UpdateUserInfoReq temp){  
282 - // UpdateUserInfoReq req = super.getRequest(UpdateUserInfoReq.class);  
283 - // try {  
284 - // UpdateUserInfoResp resp = sellerUserService.updateUserInfo(req);  
285 - // super.sendSuccessResp(resp);  
286 - // } catch (ServiceException e){  
287 - // log.error(String.format("Code=%s,ErrorMessage=%s,UserId=%s",  
288 - // e.getCode(), e.getMessage(), req.getUserId()), e);  
289 - // sendError(e.getCode(), e.getMessage());  
290 - // } catch (Exception e) {  
291 - // log.error("个人信息维护:", e);  
292 - // super.sendError(e.getMessage());  
293 - // }  
294 - //  
295 - //} 272 + /**
  273 + * 卖家信息维护
  274 + * @createTime 2016年8月24日 下午10:55:03
  275 + * @author weili
  276 + */
  277 + @ApiOperation(value = "卖家信息维护", httpMethod = "POST" ,response = UpdateUserInfoResp.class)
  278 + @RequestMapping(value = "/updateSellerInfo",method = RequestMethod.POST)
  279 + @ResponseBody
  280 + public void updateSellerInfo(@RequestBody UpdateSellerInfoReq temp){
  281 + UpdateSellerInfoReq req = super.getRequest(UpdateSellerInfoReq.class);
  282 + try {
  283 + UpdateSellerInfoResp resp = sellerUserService.updateUserInfo(req);
  284 + super.sendSuccessResp(resp);
  285 + } catch (ServiceException e){
  286 + log.error(String.format("Code=%s,ErrorMessage=%s,UserId=%s",
  287 + e.getCode(), e.getMessage(), req.getUserId()), e);
  288 + sendError(e.getCode(), e.getMessage());
  289 + } catch (Exception e) {
  290 + log.error("个人信息维护:", e);
  291 + super.sendError(e.getMessage());
  292 + }
  293 +
  294 + }
296 295
297 296
298 297