正在显示
1 个修改的文件
包含
8 行增加
和
0 行删除
| 1 | package user | 1 | package user |
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | + "fmt" | ||
| 4 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/auth" | 5 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/auth" |
| 5 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/factory" | 6 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/factory" |
| 6 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/partnerInfo/query" | 7 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/partnerInfo/query" |
| @@ -8,6 +9,7 @@ import ( | @@ -8,6 +9,7 @@ import ( | ||
| 8 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain" | 9 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain" |
| 9 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/log" | 10 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/log" |
| 10 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol" | 11 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol" |
| 12 | + "strconv" | ||
| 11 | "strings" | 13 | "strings" |
| 12 | ) | 14 | ) |
| 13 | 15 | ||
| @@ -18,6 +20,7 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) | @@ -18,6 +20,7 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) | ||
| 18 | transactionContext, _ = factory.CreateTransactionContext(nil) | 20 | transactionContext, _ = factory.CreateTransactionContext(nil) |
| 19 | CompanyResponsitory, _ = factory.CreateCompanyRepository(transactionContext) | 21 | CompanyResponsitory, _ = factory.CreateCompanyRepository(transactionContext) |
| 20 | PartnerInfoService, _ = factory.CreatePartnerInfoRepositoryIn(transactionContext) | 22 | PartnerInfoService, _ = factory.CreatePartnerInfoRepositoryIn(transactionContext) |
| 23 | + ImInfoRepository, _ = factory.CreateImInfoRepository(transactionContext) | ||
| 21 | company *domain.Company | 24 | company *domain.Company |
| 22 | ) | 25 | ) |
| 23 | if err = transactionContext.StartTransaction(); err != nil { | 26 | if err = transactionContext.StartTransaction(); err != nil { |
| @@ -53,6 +56,11 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) | @@ -53,6 +56,11 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) | ||
| 53 | } else { | 56 | } else { |
| 54 | rsp.User.Salesman = map[string]interface{}{} | 57 | rsp.User.Salesman = map[string]interface{}{} |
| 55 | } | 58 | } |
| 59 | + if imInfo, e := ImInfoRepository.FindOne(map[string]interface{}{"user_id": partnerInfo.Id}); e == nil && imInfo != nil { | ||
| 60 | + rsp.User.ImToken = imInfo.ImToken | ||
| 61 | + rsp.User.AccountID, _ = strconv.ParseInt(imInfo.ImId, 10, 64) | ||
| 62 | + rsp.User.CsAccountID = fmt.Sprintf("%v", imInfo.CustomerImId) | ||
| 63 | + } | ||
| 56 | err = transactionContext.CommitTransaction() | 64 | err = transactionContext.CommitTransaction() |
| 57 | return | 65 | return |
| 58 | } | 66 | } |
-
请 注册 或 登录 后发表评论