|
@@ -14,10 +14,10 @@ import ( |
|
@@ -14,10 +14,10 @@ import ( |
14
|
//用户信息
|
14
|
//用户信息
|
15
|
func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) (rsp *protocol.UserInfoResponse, err error) {
|
15
|
func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) (rsp *protocol.UserInfoResponse, err error) {
|
16
|
var (
|
16
|
var (
|
17
|
- PartnerInfoService = service.NewPartnerInfoService(nil)
|
|
|
18
|
partnerInfo *domain.PartnerInfo
|
17
|
partnerInfo *domain.PartnerInfo
|
19
|
transactionContext, _ = factory.CreateTransactionContext(nil)
|
18
|
transactionContext, _ = factory.CreateTransactionContext(nil)
|
20
|
CompanyResponsitory, _ = factory.CreateCompanyRepository(transactionContext)
|
19
|
CompanyResponsitory, _ = factory.CreateCompanyRepository(transactionContext)
|
|
|
20
|
+ PartnerInfoService, _ = factory.CreatePartnerInfoRepositoryIn(transactionContext)
|
21
|
company *domain.Company
|
21
|
company *domain.Company
|
22
|
)
|
22
|
)
|
23
|
if err = transactionContext.StartTransaction(); err != nil {
|
23
|
if err = transactionContext.StartTransaction(); err != nil {
|
|
@@ -27,7 +27,7 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) |
|
@@ -27,7 +27,7 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) |
27
|
transactionContext.RollbackTransaction()
|
27
|
transactionContext.RollbackTransaction()
|
28
|
}()
|
28
|
}()
|
29
|
rsp = &protocol.UserInfoResponse{}
|
29
|
rsp = &protocol.UserInfoResponse{}
|
30
|
- if partnerInfo, err = PartnerInfoService.GetPartnerInfo(&query.GetPartnerInfoQuery{Id: int(header.UserId)}); err != nil {
|
30
|
+ if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"id": header.UserId}); err != nil {
|
31
|
err = protocol.NewErrWithMessage(502, err) //账号不存在
|
31
|
err = protocol.NewErrWithMessage(502, err) //账号不存在
|
32
|
return
|
32
|
return
|
33
|
}
|
33
|
}
|
|
@@ -77,9 +77,9 @@ func CheckSmsCode(header *protocol.RequestHeader, request *protocol.CheckSmsCode |
|
@@ -77,9 +77,9 @@ func CheckSmsCode(header *protocol.RequestHeader, request *protocol.CheckSmsCode |
77
|
//修改手机号
|
77
|
//修改手机号
|
78
|
func ChangePhone(header *protocol.RequestHeader, request *protocol.ChangePhoneRequest) (rsp *protocol.ChangePhoneResponse, err error) {
|
78
|
func ChangePhone(header *protocol.RequestHeader, request *protocol.ChangePhoneRequest) (rsp *protocol.ChangePhoneResponse, err error) {
|
79
|
var (
|
79
|
var (
|
80
|
- PartnerInfoService = service.NewPartnerInfoService(nil)
|
|
|
81
|
transactionContext, _ = factory.CreateTransactionContext(nil)
|
80
|
transactionContext, _ = factory.CreateTransactionContext(nil)
|
82
|
PartnerInfoDao, _ = factory.CreatePartnerInfoDao(transactionContext)
|
81
|
PartnerInfoDao, _ = factory.CreatePartnerInfoDao(transactionContext)
|
|
|
82
|
+ PartnerInfoService, _ = factory.CreatePartnerInfoRepositoryIn(transactionContext)
|
83
|
partnerInfo *domain.PartnerInfo
|
83
|
partnerInfo *domain.PartnerInfo
|
84
|
)
|
84
|
)
|
85
|
if err = transactionContext.StartTransaction(); err != nil {
|
85
|
if err = transactionContext.StartTransaction(); err != nil {
|
|
@@ -88,11 +88,11 @@ func ChangePhone(header *protocol.RequestHeader, request *protocol.ChangePhoneRe |
|
@@ -88,11 +88,11 @@ func ChangePhone(header *protocol.RequestHeader, request *protocol.ChangePhoneRe |
88
|
defer func() {
|
88
|
defer func() {
|
89
|
transactionContext.RollbackTransaction()
|
89
|
transactionContext.RollbackTransaction()
|
90
|
}()
|
90
|
}()
|
91
|
- if partnerInfo, err = PartnerInfoService.GetPartnerInfo(&query.GetPartnerInfoQuery{Id: int(header.UserId)}); err != nil {
|
91
|
+ if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"id": header.UserId}); err != nil {
|
92
|
err = protocol.NewErrWithMessage(502, err) //账号不存在
|
92
|
err = protocol.NewErrWithMessage(502, err) //账号不存在
|
93
|
return
|
93
|
return
|
94
|
}
|
94
|
}
|
95
|
- if _, err = PartnerInfoService.GetPartnerInfo(&query.GetPartnerInfoQuery{Account: request.Phone}); err == nil {
|
95
|
+ if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"account": request.Phone}); err == nil {
|
96
|
err = protocol.NewErrWithMessage(2029, err) //账号已存在
|
96
|
err = protocol.NewErrWithMessage(2029, err) //账号已存在
|
97
|
return
|
97
|
return
|
98
|
}
|
98
|
}
|