Commit 278c70827889e5500a01d6423ad3d12f8046392f

Authored by weiliwhereareyou@163.com
1 parent 19148fe1

初始化工程-接口定义

mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/login/AuthLoginReq.java 0 → 100644
  1 +package com.diligrp.mobsite.getway.domain.protocol.login;
  2 +
  3 +import com.diligrp.mobsite.getway.domain.protocol.BaseReq;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +import javax.validation.constraints.NotNull;
  7 +
  8 +/**
  9 + * <B>Description</B> 登录请求 <br />
  10 + * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
  11 + * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
  12 + * <B>Company</B> 地利集团
  13 + * @createTime Aug 12, 2014 7:57:01 PM
  14 + * @author wujianjun
  15 + */
  16 +public class AuthLoginReq extends BaseReq {
  17 +
  18 + /**
  19 + * 会员名称
  20 + */
  21 + @NotNull(message = "账号不能为空")
  22 + @ApiModelProperty(value = "登录账号",required = true)
  23 + private String accountName;
  24 +
  25 + /**
  26 + * 验证码
  27 + */
  28 + @ApiModelProperty(value = "验证码",required = true)
  29 + private String authCode;
  30 +
  31 +
  32 + //极光ID
  33 + @ApiModelProperty(value = "极光ID")
  34 + private String registerNo;
  35 +
  36 +
  37 + public AuthLoginReq() {
  38 + }
  39 +
  40 + public String getRegisterNo() {
  41 + return registerNo;
  42 + }
  43 +
  44 + public void setRegisterNo(String registerNo) {
  45 + this.registerNo = registerNo;
  46 + }
  47 +
  48 + /**
  49 + * get value of LoginReq.accountName
  50 + * @return the accountName
  51 + * @createTime Aug 12, 2014 7:58:27 PM
  52 + * @author wujianjun
  53 + */
  54 + public String getAccountName() {
  55 + return accountName;
  56 + }
  57 +
  58 + /**
  59 + * set value of LoginReq.accountName
  60 + * @param accountName the accountName to set
  61 + * @createTime Aug 12, 2014 7:58:27 PM
  62 + * @author wujianjun
  63 + */
  64 + public void setAccountName(String accountName) {
  65 + this.accountName = accountName;
  66 + }
  67 +
  68 +
  69 +}
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/login/LoginReq.java
... ... @@ -28,14 +28,15 @@ public class LoginReq extends BaseReq {
28 28 @ApiModelProperty(value = "登录密码",required = true)
29 29 private String password;
30 30  
31   - /**
32   - * 密码
33   - */
34   - @ApiModelProperty(value = "验证码")
35   - private String authCode;
  31 + ///**
  32 + // * 验证码
  33 + // */
  34 + //@ApiModelProperty(value = "验证码")
  35 + //private String authCode;
36 36  
37 37  
38 38 //极光ID
  39 + @ApiModelProperty(value = "极光ID")
39 40 private String registerNo;
40 41  
41 42  
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/login/LoginResp.java
... ... @@ -57,7 +57,7 @@ public class LoginResp extends BaseResp {
57 57 /**
58 58 * 账户ID
59 59 */
60   - @ApiModelProperty(value = "账号")
  60 + @ApiModelProperty(value = "用户id")
61 61 private Long accountId;
62 62 /**
63 63 * 账户名
... ... @@ -69,25 +69,25 @@ public class LoginResp extends BaseResp {
69 69 */
70 70 @ApiModelProperty(value = "手机号码")
71 71 private String mobile;
72   - /**
73   - * 邮箱地址
74   - */
75   - @ApiModelProperty(value = "邮箱")
76   - private String email;
77   - /**
78   - * 1:个人用户, 2:企业用户
79   - */
80   - @ApiModelProperty(value = "用户类型:个人用户,2:企业用户")
81   - private Integer userType;
82   - /**
83   - * 1 登入 -1 登出 (出场验货专用)
84   - */
85   - private Integer accountState;
86   - /**
87   - * 真实姓名
88   - */
89   - @ApiModelProperty(value = "真实姓名")
90   - private String realName;
  72 + ///**
  73 + // * 邮箱地址
  74 + // */
  75 + //@ApiModelProperty(value = "邮箱")
  76 + //private String email;
  77 + ///**
  78 + // * 1:个人用户, 2:企业用户
  79 + // */
  80 + //@ApiModelProperty(value = "用户类型:个人用户,2:企业用户")
  81 + //private Integer userType;
  82 + ///**
  83 + // * 1 登入 -1 登出 (出场验货专用)
  84 + // */
  85 + //private Integer accountState;
  86 + ///**
  87 + // * 真实姓名
  88 + // */
  89 + //@ApiModelProperty(value = "真实姓名")
  90 + //private String realName;
91 91 /**
92 92 * 登录之后,passport返回
93 93 * 用于支付鉴权
... ... @@ -165,67 +165,9 @@ public class LoginResp extends BaseResp {
165 165 this.mobile = mobile;
166 166 }
167 167  
168   - /**
169   - * get value of LoginResp.email
170   - * @return the email
171   - * @createTime Aug 13, 2014 9:58:39 AM
172   - * @author wujianjun
173   - */
174   - public String getEmail() {
175   - return email;
176   - }
177   -
178   - /**
179   - * set value of LoginResp.email
180   - * @param email the email to set
181   - * @createTime Aug 13, 2014 9:58:39 AM
182   - * @author wujianjun
183   - */
184   - public void setEmail(String email) {
185   - this.email = email;
186   - }
187 168  
188   - /**
189   - * get value of LoginResp.userType
190   - * @return the userType
191   - * @createTime Aug 13, 2014 9:58:39 AM
192   - * @author wujianjun
193   - */
194   - public Integer getUserType() {
195   - return userType;
196   - }
197 169  
198   - /**
199   - * set value of LoginResp.userType
200   - * @param userType the userType to set
201   - * @createTime Aug 13, 2014 9:58:39 AM
202   - * @author wujianjun
203   - */
204   - public void setUserType(Integer userType) {
205   - this.userType = userType;
206   - }
207   -
208   - /**
209   - * get value of LoginResp.accountState
210   - * @return the accountState
211   - * @createTime Aug 13, 2014 9:58:39 AM
212   - * @author wujianjun
213   - */
214   - public Integer getAccountState() {
215   - return accountState;
216   - }
217   -
218   - /**
219   - * set value of LoginResp.accountState
220   - * @param accountState the accountState to set
221   - * @createTime Aug 13, 2014 9:58:39 AM
222   - * @author wujianjun
223   - */
224   - public void setAccountState(Integer accountState) {
225   - this.accountState = accountState;
226   - }
227   -
228   - public String getToken() {
  170 + public String getToken() {
229 171 return token;
230 172 }
231 173  
... ... @@ -234,17 +176,7 @@ public class LoginResp extends BaseResp {
234 176 this.token = token;
235 177 }
236 178  
237   -
238   - public String getRealName() {
239   - return realName;
240   - }
241   -
242   -
243   - public void setRealName(String realName) {
244   - this.realName = realName;
245   - }
246 179  
247   -
248 180 public String getHeadImg() {
249 181 return headImg;
250 182 }
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/register/SellerRegisterReq.java 0 → 100644
  1 +package com.diligrp.mobsite.getway.domain.protocol.register;
  2 +
  3 +import com.diligrp.mobsite.getway.domain.protocol.BaseReq;
  4 +import io.swagger.annotations.ApiModel;
  5 +import io.swagger.annotations.ApiModelProperty;
  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 7:48:27 PM
  13 + * @author wujianjun
  14 + */
  15 +@ApiModel(value = "请求参数")
  16 +public class SellerRegisterReq extends BaseReq {
  17 +
  18 + public static final int USER_TYPE_BUSINESS = 1;//市场商户,企业单位,个体经营,个人
  19 +
  20 + public static final int USER_TYPE_COMPANY = 2;
  21 +
  22 + public static final int USER_TYPE_PERSONMANAGE = 3;
  23 +
  24 + public static final int USER_TYPE_PERSON = 4;
  25 +
  26 + public static final int APPTYPE_SHEQU = 1;
  27 +
  28 + public static final int APPTYPE_LIANSUO = 2;
  29 +
  30 + /**
  31 + * 手机号码
  32 + */
  33 + @ApiModelProperty(value = "手机号码",required = true)
  34 + protected String mobile;
  35 +
  36 + /**
  37 + * 密码
  38 + */
  39 + @ApiModelProperty(value = "密码",required = true)
  40 + protected String password;
  41 +
  42 + /**
  43 + * 手机验证码
  44 + */
  45 + @ApiModelProperty(value = "手机验证码",required = true)
  46 + private String veriCode;
  47 +
  48 + /**
  49 + * 手机验证码
  50 + */
  51 + @ApiModelProperty(value = "app类型(1:社区店版,2:连锁店 ,默认传1)")
  52 + private Integer appType = APPTYPE_SHEQU;
  53 +
  54 +
  55 + public String getMobile() {
  56 + return mobile;
  57 + }
  58 +
  59 + public void setMobile(String mobile) {
  60 + this.mobile = mobile;
  61 + }
  62 +
  63 + public String getPassword() {
  64 + return password;
  65 + }
  66 +
  67 + public void setPassword(String password) {
  68 + this.password = password;
  69 + }
  70 +
  71 + public String getVeriCode() {
  72 + return veriCode;
  73 + }
  74 +
  75 + public void setVeriCode(String veriCode) {
  76 + this.veriCode = veriCode;
  77 + }
  78 +
  79 + public Integer getAppType() {
  80 + return appType;
  81 + }
  82 +
  83 + public void setAppType(Integer appType) {
  84 + this.appType = appType;
  85 + }
  86 +}
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/register/SellerRegisterResp.java 0 → 100644
  1 +package com.diligrp.mobsite.getway.domain.protocol.register;
  2 +
  3 +import com.diligrp.mobsite.getway.domain.protocol.BaseResp;
  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 7:48:58 PM
  13 + * @author wujianjun
  14 + */
  15 +@SuppressWarnings("serial")
  16 +public class SellerRegisterResp extends BaseResp {
  17 +
  18 + /**
  19 + * 注册结果
  20 + * 注册成功-1
  21 + */
  22 + public static final int RESULT_FLAG_SUCCESS=1;
  23 + /**
  24 + * 注册失败-2
  25 + */
  26 + public static final int RESULT_FLAG_FAILED=2;
  27 + /**
  28 + * 验证码错误-3
  29 + */
  30 + public static final int RESULT_FLAG_VERICODE_WRONG=3;
  31 + /**
  32 + * 手机号已经注册-4
  33 + */
  34 + public static final int RESULT_FLAG_PHONE_REGISTERED=4;
  35 + /**
  36 + * 账号已经被注册-5
  37 + */
  38 + public static final Integer RESULT_FLAG_ACCOUNTNAME_REGISTERED=5;
  39 +
  40 +
  41 + /**
  42 + * 注册结果
  43 + */
  44 + @ApiModelProperty(value = "注册结果")
  45 + private Integer resultFlag = RESULT_FLAG_SUCCESS;
  46 +
  47 + /**
  48 + * get value of RegisterPersonalResp.resultFlag
  49 + * @return the resultFlag
  50 + * @createTime 2014年8月28日 下午5:19:41
  51 + * @author zhangshirui
  52 + */
  53 + public Integer getResultFlag() {
  54 + return resultFlag;
  55 + }
  56 +
  57 + /**
  58 + * set value of RegisterPersonalResp.resultFlag
  59 + * @param resultFlag the resultFlag to set
  60 + * @createTime 2014年8月28日 下午5:19:41
  61 + * @author zhangshirui
  62 + */
  63 + public void setResultFlag(Integer resultFlag) {
  64 + this.resultFlag = resultFlag;
  65 + }
  66 +
  67 +}
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/user/ModifyPwdReq.java
... ... @@ -19,8 +19,8 @@ public class ModifyPwdReq extends BaseReq {
19 19 /**
20 20 * 验证码
21 21 */
22   - @ApiModelProperty(value = "验证码",required = true)
23   - private String authCode;
  22 + //@ApiModelProperty(value = "验证码",required = true)
  23 + //private String authCode;
24 24  
25 25 /**
26 26 * 新的密码
... ... @@ -28,11 +28,11 @@ public class ModifyPwdReq extends BaseReq {
28 28 @ApiModelProperty(value = "新密码",required = true)
29 29 private String password;
30 30  
31   - /**
32   - * 重复新密码
33   - */
34   - @ApiModelProperty(value = "重复新密码",required = true)
35   - private String repPassword;
  31 + ///**
  32 + // * 重复新密码
  33 + // */
  34 + //@ApiModelProperty(value = "重复新密码",required = true)
  35 + //private String repPassword;
36 36  
37 37 /**
38 38 * 手机号
... ... @@ -83,32 +83,32 @@ public class ModifyPwdReq extends BaseReq {
83 83 }
84 84  
85 85  
86   - /**
87   - * get value of ModifyPwdReq.authCode
88   - * @return the authCode
89   - * @createTime 2015年1月24日 下午4:50:08
90   - * @author zhangshirui
91   - */
92   - public String getAuthCode() {
93   - return authCode;
94   - }
  86 + ///**
  87 + // * get value of ModifyPwdReq.authCode
  88 + // * @return the authCode
  89 + // * @createTime 2015年1月24日 下午4:50:08
  90 + // * @author zhangshirui
  91 + // */
  92 + //public String getAuthCode() {
  93 + // return authCode;
  94 + //}
  95 + //
  96 + //
  97 + ///**
  98 + // * set value of ModifyPwdReq.authCode
  99 + // * @param authCode the authCode to set
  100 + // * @createTime 2015年1月24日 下午4:50:08
  101 + // * @author zhangshirui
  102 + // */
  103 + //public void setAuthCode(String authCode) {
  104 + // this.authCode = authCode;
  105 + //}
95 106  
96   -
97   - /**
98   - * set value of ModifyPwdReq.authCode
99   - * @param authCode the authCode to set
100   - * @createTime 2015年1月24日 下午4:50:08
101   - * @author zhangshirui
102   - */
103   - public void setAuthCode(String authCode) {
104   - this.authCode = authCode;
105   - }
106   -
107   - public String getRepPassword() {
108   - return repPassword;
109   - }
110   -
111   - public void setRepPassword(String repPassword) {
112   - this.repPassword = repPassword;
113   - }
  107 + //public String getRepPassword() {
  108 + // return repPassword;
  109 + //}
  110 + //
  111 + //public void setRepPassword(String repPassword) {
  112 + // this.repPassword = repPassword;
  113 + //}
114 114 }
... ...
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/seller/SellerRPC.java
1 1 package com.diligrp.mobsite.getway.rpc.seller;
2 2  
3 3 import com.b2c.myapp.common.api.buyerInfo.output.BuyerInfoOutput;
  4 +import com.b2c.myapp.common.api.sellerInfo.output.SellerInfoOutput;
4 5 import com.diligrp.mobsite.getway.domain.protocol.ConsigneeInfo;
5 6 import com.diligrp.mobsite.getway.domain.protocol.cart.ModifyAmountReq;
6 7  
... ... @@ -91,4 +92,6 @@ public interface SellerRPC {
91 92  
92 93  
93 94 BuyerInfoOutput getUserByMobile(String accountName);
  95 +
  96 + SellerInfoOutput getSellerByMobile(String accountName);
94 97 }
... ...
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/seller/impl/SellerRPCImpl.java
... ... @@ -150,4 +150,28 @@ public class SellerRPCImpl implements SellerRPC {
150 150 }
151 151 return output.getData();
152 152 }
  153 +
  154 + @Override
  155 + public SellerInfoOutput getSellerByMobile(String accountName) {
  156 + BaseOutput<SellerInfoOutput> output = null;
  157 + boolean flag = false;
  158 + try {
  159 + output = userClient.getSellerInfoService().getSellerInfoByMobilePhone(accountName);
  160 + } catch (Exception e) {
  161 + logger.error("检测电话号码接口挂掉:msg={}",e.getMessage());
  162 + throw new ServiceException();
  163 + }
  164 +
  165 + if (output==null||!output.getCode().equals(ResultCode.SUCCESS)){
  166 + logger.error("手机号查询买家接口失败:[userId={},code={},result={}]",new Object[]{accountName,output.getCode(),output.getResult()});
  167 + throw new ServiceException();
  168 + }
  169 +
  170 + if(Validator.isNull(output.getData())){
  171 + logger.info("查询用户为空:[mobile={}]",new Object[]{accountName});
  172 + throw new ServiceException(ResultCode.BUSINESS_FAILED, ErrorMessage.USER_NOT_EXIST);
  173 + }
  174 + return output.getData();
  175 + }
  176 +
153 177 }
... ...
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/user/UserService.java
1 1 package com.diligrp.mobsite.getway.service.buyer.user;
2 2  
3   -import com.diligrp.mobsite.getway.domain.protocol.login.CheckVeriCodeReq;
4   -import com.diligrp.mobsite.getway.domain.protocol.login.CheckVeriCodeResp;
5   -import com.diligrp.mobsite.getway.domain.protocol.login.LoginReq;
6   -import com.diligrp.mobsite.getway.domain.protocol.login.LoginResp;
7   -import com.diligrp.mobsite.getway.domain.protocol.login.LogoutReq;
8   -import com.diligrp.mobsite.getway.domain.protocol.login.LogoutResp;
9   -import com.diligrp.mobsite.getway.domain.protocol.login.SendVeriCodeReq;
10   -import com.diligrp.mobsite.getway.domain.protocol.login.SendVeriCodeResp;
  3 +import com.diligrp.mobsite.getway.domain.protocol.login.*;
11 4 import com.diligrp.mobsite.getway.domain.protocol.register.CheckAccountNameReq;
12 5 import com.diligrp.mobsite.getway.domain.protocol.register.CheckAccountNameResp;
13 6 import com.diligrp.mobsite.getway.domain.protocol.register.CheckMobileReq;
... ... @@ -183,4 +176,6 @@ public interface UserService {
183 176 TradeRecordResp getTradeRecord(TradeRecordReq req);
184 177  
185 178 SearchUserInfoResp searchBuyerInfo(SearchUserInfoReq req);
  179 +
  180 + LoginResp authlogin(AuthLoginReq req);
186 181 }
... ...
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/user/impl/UserServiceImpl.java
... ... @@ -168,9 +168,9 @@ public class UserServiceImpl implements UserService {
168 168 UserRegisterResp resp = new UserRegisterResp();
169 169  
170 170 //手机号码和账号验证、验证码
171   - if (!checkRegisterInfo(resp, req)) {
172   - return resp;
173   - }
  171 + //if (!checkRegisterInfo(resp, req)) {
  172 + // return resp;
  173 + //}
174 174  
175 175 resp = passportRPC.register(req);
176 176  
... ... @@ -375,4 +375,9 @@ public class UserServiceImpl implements UserService {
375 375 public SearchUserInfoResp searchBuyerInfo(SearchUserInfoReq req) {
376 376 return null;
377 377 }
  378 +
  379 + @Override
  380 + public LoginResp authlogin(AuthLoginReq req) {
  381 + return null;
  382 + }
378 383 }
... ...
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/seller/SellerUserService.java
1 1 package com.diligrp.mobsite.getway.service.seller;
2 2  
3 3 import com.diligrp.mobsite.getway.domain.protocol.login.*;
4   -import com.diligrp.mobsite.getway.domain.protocol.register.CheckMobileReq;
5   -import com.diligrp.mobsite.getway.domain.protocol.register.CheckMobileResp;
6   -import com.diligrp.mobsite.getway.domain.protocol.register.UserRegisterReq;
7   -import com.diligrp.mobsite.getway.domain.protocol.register.UserRegisterResp;
  4 +import com.diligrp.mobsite.getway.domain.protocol.register.*;
8 5 import com.diligrp.mobsite.getway.domain.protocol.saler.user.SellerLoginReq;
9 6 import com.diligrp.mobsite.getway.domain.protocol.saler.user.SellerLoginResp;
10 7 import com.diligrp.mobsite.getway.domain.protocol.user.*;
... ... @@ -40,7 +37,7 @@ public interface SellerUserService {
40 37  
41 38 ModifyPwdResp modifyPwd(ModifyPwdReq req);
42 39  
43   - UserRegisterResp sellerRegister(UserRegisterReq req);
  40 + SellerRegisterResp sellerRegister(SellerRegisterReq req);
44 41  
45 42 LogoutResp logout(LogoutReq req);
46 43  
... ...
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/seller/impl/SellerUserServiceImpl.java
1 1 package com.diligrp.mobsite.getway.service.seller.impl;
2 2  
  3 +import com.alibaba.fastjson.JSONObject;
  4 +import com.b2c.myapp.common.api.sellerInfo.output.SellerInfoOutput;
3 5 import com.diligrp.mobsite.getway.domain.common.Constant;
4 6 import com.diligrp.mobsite.getway.domain.common.ErrorMessage;
5 7 import com.diligrp.mobsite.getway.domain.common.RedisKey;
6 8 import com.diligrp.mobsite.getway.domain.common.ResultCode;
7 9 import com.diligrp.mobsite.getway.domain.except.ServiceException;
8 10 import com.diligrp.mobsite.getway.domain.protocol.login.*;
9   -import com.diligrp.mobsite.getway.domain.protocol.register.CheckMobileReq;
10   -import com.diligrp.mobsite.getway.domain.protocol.register.CheckMobileResp;
11   -import com.diligrp.mobsite.getway.domain.protocol.register.UserRegisterReq;
12   -import com.diligrp.mobsite.getway.domain.protocol.register.UserRegisterResp;
  11 +import com.diligrp.mobsite.getway.domain.protocol.register.*;
13 12 import com.diligrp.mobsite.getway.domain.protocol.saler.user.SellerLoginReq;
14 13 import com.diligrp.mobsite.getway.domain.protocol.saler.user.SellerLoginResp;
15 14 import com.diligrp.mobsite.getway.domain.protocol.user.*;
... ... @@ -28,6 +27,8 @@ import org.springframework.beans.factory.annotation.Autowired;
28 27 import org.springframework.stereotype.Service;
29 28  
30 29 import javax.annotation.Resource;
  30 +import java.util.HashMap;
  31 +import java.util.Map;
31 32  
32 33  
33 34 /**
... ... @@ -154,11 +155,40 @@ public class SellerUserServiceImpl implements SellerUserService {
154 155  
155 156 @Override
156 157 public ModifyPwdResp modifyPwd(ModifyPwdReq req) {
157   - return null;
  158 + SellerInfoOutput userInfo = sellerRPC.getSellerByMobile(req.getAccountName());
  159 + Long userId = userInfo.getId();
  160 +
  161 +
  162 + Map<String,String> params = new HashMap<String, String>();
  163 + params.put("password", req.getPassword());
  164 + params.put("accountId", String.valueOf(userId));
  165 +
  166 +
  167 + String result = passportRPC.modifyPwd(params);
  168 +
  169 + JSONObject jsonBody = JSONObject.parseObject(result);
  170 + int code = jsonBody.getIntValue("code");
  171 + ModifyPwdResp resp = new ModifyPwdResp();
  172 + resp.setMsg(jsonBody.getString("msg"));
  173 +
  174 + if(code != ResultCode.SUCCESS){
  175 + //失败
  176 + resp.setCode(ResultCode.BUSINESS_FAILED);
  177 + resp.setResultFlag(ModifyPwdResp.RESULT_FLAG_FAILED);
  178 + return resp;
  179 + }else {
  180 + //修改成功,退出所有账号信息
  181 + String cookieRedisKey = redisUtil.makeKey(RedisKey.USER_LOGININFO, String.valueOf(userId));
  182 + redisUtil.deleteByKey(cookieRedisKey);
  183 + }
  184 +
  185 + logger.info("修改用户密码"+jsonBody.getString("msg"));
  186 +
  187 + return resp;
158 188 }
159 189  
160 190 @Override
161   - public UserRegisterResp sellerRegister(UserRegisterReq req) {
  191 + public SellerRegisterResp sellerRegister(SellerRegisterReq req) {
162 192 return null;
163 193 }
164 194  
... ...
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/user/UserController.java
... ... @@ -100,12 +100,11 @@ public class UserController extends BaseApiController {
100 100 @ApiOperation(value = "买家验证码登录", httpMethod = "POST" , notes = "买家验证码登录",response = LoginResp.class)
101 101 @RequestMapping(value = "/loginForAuth",method = RequestMethod.POST)
102 102 @ResponseBody
103   - public void loginForAuth(@RequestBody LoginReq temp){
104   - LoginReq req = super.getRequest(LoginReq.class);
  103 + public void loginForAuth(@RequestBody AuthLoginReq temp){
  104 + AuthLoginReq req = super.getRequest(AuthLoginReq.class);
105 105 try {
106 106 BeanValidator.validator(req);
107   - req.setPassword(decodeStr(req.getPassword()));
108   - LoginResp resp = userService.login(req);
  107 + LoginResp resp = userService.authlogin(req);
109 108 super.sendSuccessResp(resp);
110 109 } catch (ServiceException e){
111 110 LOGGER.error(String.format("Code=%s,ErrorMessage=%s,UserId=%s",
... ...
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/seller/user/SellerUserController.java
... ... @@ -2,10 +2,7 @@ package com.diligrp.mobsite.getway.web.api.seller.user;
2 2  
3 3 import com.diligrp.mobsite.getway.domain.except.ServiceException;
4 4 import com.diligrp.mobsite.getway.domain.protocol.login.*;
5   -import com.diligrp.mobsite.getway.domain.protocol.register.CheckMobileReq;
6   -import com.diligrp.mobsite.getway.domain.protocol.register.CheckMobileResp;
7   -import com.diligrp.mobsite.getway.domain.protocol.register.UserRegisterReq;
8   -import com.diligrp.mobsite.getway.domain.protocol.register.UserRegisterResp;
  5 +import com.diligrp.mobsite.getway.domain.protocol.register.*;
9 6 import com.diligrp.mobsite.getway.domain.protocol.saler.user.SellerLoginReq;
10 7 import com.diligrp.mobsite.getway.domain.protocol.saler.user.SellerLoginResp;
11 8 import com.diligrp.mobsite.getway.domain.protocol.user.*;
... ... @@ -202,14 +199,14 @@ public class SellerUserController extends BaseApiController {
202 199 * @createTime 2014年8月28日 下午3:41:02
203 200 * @author weili
204 201 */
205   - @ApiOperation(value = "卖家注册", httpMethod = "POST" ,response = UserRegisterResp.class)
  202 + @ApiOperation(value = "卖家注册", httpMethod = "POST" ,response = SellerRegisterResp.class)
206 203 @RequestMapping(value = "/sellerRegister",method = RequestMethod.POST)
207 204 @ResponseBody
208   - public void sellerRegister(@RequestBody UserRegisterReq temp){
209   - UserRegisterReq req = super.getRequest(UserRegisterReq.class);
  205 + public void sellerRegister(@RequestBody SellerRegisterReq temp){
  206 + SellerRegisterReq req = super.getRequest(SellerRegisterReq.class);
210 207 try {
211 208 BeanValidator.validator(req);
212   - UserRegisterResp resp = sellerUserService.sellerRegister(req);
  209 + SellerRegisterResp resp = sellerUserService.sellerRegister(req);
213 210 super.sendSuccessResp(resp);
214 211 } catch (ServiceException e){
215 212 log.error(String.format("Code=%s,ErrorMessage=%s,UserId=%s",
... ... @@ -226,15 +223,15 @@ public class SellerUserController extends BaseApiController {
226 223 * @createTime 2014年8月28日 下午3:41:02
227 224 * @author weili
228 225 */
229   - @ApiOperation(value = "卖家注册", httpMethod = "POST" ,response = UserRegisterResp.class)
  226 + @ApiOperation(value = "卖家注册", httpMethod = "POST" ,response = SellerRegisterResp.class)
230 227 @RequestMapping(value = "/sellerRegisters",method = RequestMethod.POST)
231 228 @ResponseBody
232   - public void sellerRegisters(@RequestBody UserRegisterReq temp){
233   - UserRegisterReq req = super.getRequest(UserRegisterReq.class);
  229 + public void sellerRegisters(@RequestBody SellerRegisterReq temp){
  230 + SellerRegisterReq req = super.getRequest(SellerRegisterReq.class);
234 231 try {
235 232 BeanValidator.validator(req);
236 233 req.setPassword(decodeStr(req.getPassword()));
237   - UserRegisterResp resp = sellerUserService.sellerRegister(req);
  234 + SellerRegisterResp resp = sellerUserService.sellerRegister(req);
238 235 super.sendSuccessResp(resp);
239 236 } catch (ServiceException e){
240 237 log.error(String.format("Code=%s,ErrorMessage=%s,UserId=%s",
... ...