|
@@ -113,10 +113,10 @@ func ChangePhone(header *protocol.RequestHeader, request *protocol.ChangePhoneRe |
|
@@ -113,10 +113,10 @@ func ChangePhone(header *protocol.RequestHeader, request *protocol.ChangePhoneRe |
|
113
|
//重置密码
|
113
|
//重置密码
|
|
114
|
func ResetPassword(header *protocol.RequestHeader, request *protocol.ResetPasswordRequest) (rsp *protocol.ResetPasswordResponse, err error) {
|
114
|
func ResetPassword(header *protocol.RequestHeader, request *protocol.ResetPasswordRequest) (rsp *protocol.ResetPasswordResponse, err error) {
|
|
115
|
var (
|
115
|
var (
|
|
116
|
- PartnerInfoService = service.NewPartnerInfoService(nil)
|
|
|
|
117
|
partnerInfo *domain.PartnerInfo
|
116
|
partnerInfo *domain.PartnerInfo
|
|
118
|
transactionContext, _ = factory.CreateTransactionContext(nil)
|
117
|
transactionContext, _ = factory.CreateTransactionContext(nil)
|
|
119
|
PartnerInfoDao, _ = factory.CreatePartnerInfoDao(transactionContext)
|
118
|
PartnerInfoDao, _ = factory.CreatePartnerInfoDao(transactionContext)
|
|
|
|
119
|
+ PartnerInfoService, _ = factory.CreatePartnerInfoRepositoryIn(transactionContext)
|
|
120
|
)
|
120
|
)
|
|
121
|
rsp = &protocol.ResetPasswordResponse{}
|
121
|
rsp = &protocol.ResetPasswordResponse{}
|
|
122
|
if err = transactionContext.StartTransaction(); err != nil {
|
122
|
if err = transactionContext.StartTransaction(); err != nil {
|
|
@@ -133,14 +133,10 @@ func ResetPassword(header *protocol.RequestHeader, request *protocol.ResetPasswo |
|
@@ -133,14 +133,10 @@ func ResetPassword(header *protocol.RequestHeader, request *protocol.ResetPasswo |
|
133
|
err = protocol.NewErrWithMessage(2026)
|
133
|
err = protocol.NewErrWithMessage(2026)
|
|
134
|
return
|
134
|
return
|
|
135
|
}
|
135
|
}
|
|
136
|
- if partnerInfo, err = PartnerInfoService.GetPartnerInfo(&query.GetPartnerInfoQuery{Id: int(header.UserId)}); err != nil {
|
136
|
+ if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"id": header.UserId}); err != nil {
|
|
137
|
err = protocol.NewErrWithMessage(502, err) //账号不存在
|
137
|
err = protocol.NewErrWithMessage(502, err) //账号不存在
|
|
138
|
return
|
138
|
return
|
|
139
|
}
|
139
|
}
|
|
140
|
- //if _, err = auth.CheckSmsCode(partnerInfo.Account, request.Captcha); err != nil {
|
|
|
|
141
|
- // log.Error(err)
|
|
|
|
142
|
- // return
|
|
|
|
143
|
- //}
|
|
|
|
144
|
if err = PartnerInfoDao.Update(map[string]interface{}{
|
140
|
if err = PartnerInfoDao.Update(map[string]interface{}{
|
|
145
|
"Id": partnerInfo.Id,
|
141
|
"Id": partnerInfo.Id,
|
|
146
|
"Password": request.ConfirmPwd,
|
142
|
"Password": request.ConfirmPwd,
|
|
@@ -154,10 +150,10 @@ func ResetPassword(header *protocol.RequestHeader, request *protocol.ResetPasswo |
|
@@ -154,10 +150,10 @@ func ResetPassword(header *protocol.RequestHeader, request *protocol.ResetPasswo |
|
154
|
//修改密码
|
150
|
//修改密码
|
|
155
|
func ChangePassword(header *protocol.RequestHeader, request *protocol.ChangePasswordRequest) (rsp *protocol.ChangePasswordResponse, err error) {
|
151
|
func ChangePassword(header *protocol.RequestHeader, request *protocol.ChangePasswordRequest) (rsp *protocol.ChangePasswordResponse, err error) {
|
|
156
|
var (
|
152
|
var (
|
|
157
|
- PartnerInfoService = service.NewPartnerInfoService(nil)
|
|
|
|
158
|
partnerInfo *domain.PartnerInfo
|
153
|
partnerInfo *domain.PartnerInfo
|
|
159
|
transactionContext, _ = factory.CreateTransactionContext(nil)
|
154
|
transactionContext, _ = factory.CreateTransactionContext(nil)
|
|
160
|
PartnerInfoDao, _ = factory.CreatePartnerInfoDao(transactionContext)
|
155
|
PartnerInfoDao, _ = factory.CreatePartnerInfoDao(transactionContext)
|
|
|
|
156
|
+ PartnerInfoService, _ = factory.CreatePartnerInfoRepositoryIn(transactionContext)
|
|
161
|
)
|
157
|
)
|
|
162
|
if err = transactionContext.StartTransaction(); err != nil {
|
158
|
if err = transactionContext.StartTransaction(); err != nil {
|
|
163
|
return nil, err
|
159
|
return nil, err
|
|
@@ -178,7 +174,7 @@ func ChangePassword(header *protocol.RequestHeader, request *protocol.ChangePass |
|
@@ -178,7 +174,7 @@ func ChangePassword(header *protocol.RequestHeader, request *protocol.ChangePass |
|
178
|
err = protocol.NewErrWithMessage(2027)
|
174
|
err = protocol.NewErrWithMessage(2027)
|
|
179
|
return
|
175
|
return
|
|
180
|
}
|
176
|
}
|
|
181
|
- if partnerInfo, err = PartnerInfoService.GetPartnerInfo(&query.GetPartnerInfoQuery{Id: int(header.UserId)}); err != nil {
|
177
|
+ if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"id": header.UserId}); err != nil {
|
|
182
|
err = protocol.NewErrWithMessage(502, err) //账号不存在
|
178
|
err = protocol.NewErrWithMessage(502, err) //账号不存在
|
|
183
|
return
|
179
|
return
|
|
184
|
}
|
180
|
}
|