|
@@ -4,8 +4,6 @@ import (
|
|
|
quitl "app.yhyue.com/moapp/jybase/common"
|
|
|
"app.yhyue.com/moapp/jybase/encrypt"
|
|
|
"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/util"
|
|
|
- "bp.jydev.jianyu360.cn/SocialPlatform/socialPlatform/entity"
|
|
|
- "bp.jydev.jianyu360.cn/SocialPlatform/socialPlatform/rpc/social/social"
|
|
|
"context"
|
|
|
"net/http"
|
|
|
|
|
@@ -34,24 +32,11 @@ func NewFindMessageLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *htt
|
|
|
func (l *FindMessageLogic) FindMessage(req *types.MessageReq) (resp *types.CommonRes, err error) {
|
|
|
resp = &types.CommonRes{}
|
|
|
if req.NewUserId == 0 {
|
|
|
- sessionId, trustedId, stErr := util.GetTouristCookieInfo(l.r)
|
|
|
- if stErr != nil {
|
|
|
- resp.Error_code = 1
|
|
|
- resp.Error_msg = stErr.Error()
|
|
|
- return resp, nil
|
|
|
+ r, err := util.GetTouristInfo(l.r, l.svcCtx.Social, l.ctx)
|
|
|
+ if err != nil || r.BaseUserId == 0 {
|
|
|
+ return nil, err
|
|
|
}
|
|
|
- result, rErr := l.svcCtx.Social.TouristInfo(l.ctx, &social.TouristInfoReq{
|
|
|
- SessionId: sessionId,
|
|
|
- Ip: entity.GetIp(l.r),
|
|
|
- TrustedId: trustedId,
|
|
|
- })
|
|
|
- if rErr != nil || result.Data.BaseUserId == 0 {
|
|
|
- resp.Error_code = 1
|
|
|
- resp.Error_msg = "当用户信息有误"
|
|
|
- logx.Error("获取当前游客信息有误:", rErr.Error())
|
|
|
- return resp, rErr
|
|
|
- }
|
|
|
- req.NewUserId = result.Data.BaseUserId
|
|
|
+ req.NewUserId = r.BaseUserId
|
|
|
}
|
|
|
var res *messagecenter.MessageResp
|
|
|
res, err = l.svcCtx.Message.FindMessage(l.ctx, &messagecenter.MessageReq{
|