作者 yangfu

修改:用户信息

package user
import (
"fmt"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/auth"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/factory"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/partnerInfo/query"
... ... @@ -8,6 +9,7 @@ import (
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/log"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol"
"strconv"
"strings"
)
... ... @@ -18,6 +20,7 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest)
transactionContext, _ = factory.CreateTransactionContext(nil)
CompanyResponsitory, _ = factory.CreateCompanyRepository(transactionContext)
PartnerInfoService, _ = factory.CreatePartnerInfoRepositoryIn(transactionContext)
ImInfoRepository, _ = factory.CreateImInfoRepository(transactionContext)
company *domain.Company
)
if err = transactionContext.StartTransaction(); err != nil {
... ... @@ -53,6 +56,11 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest)
} else {
rsp.User.Salesman = map[string]interface{}{}
}
if imInfo, e := ImInfoRepository.FindOne(map[string]interface{}{"user_id": partnerInfo.Id}); e == nil && imInfo != nil {
rsp.User.ImToken = imInfo.ImToken
rsp.User.AccountID, _ = strconv.ParseInt(imInfo.ImId, 10, 64)
rsp.User.CsAccountID = fmt.Sprintf("%v", imInfo.CustomerImId)
}
err = transactionContext.CommitTransaction()
return
}
... ...