浏览代码

Merge branch 'dev/v1.2.15_zxl' of BaseService/userCenter into feature/v1.2.15

王浩 2 年之前
父节点
当前提交
cc00c713be

+ 7 - 1
api/internal/logic/getentuserinfologic.go

@@ -31,9 +31,15 @@ func NewGetEntUserInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge
 func (l *GetEntUserInfoLogic) GetEntUserInfo(req *types.EntUserReq) (resp *types.Resp, err error) {
 	// todo: add your logic here and delete this line
 	resp = &types.Resp{Data: nil}
+	entUserid := req.HeaderEntUserId
+	//优先取传的参数,没有的话取header里的取自己的
+	if req.EntUserId > 0 {
+		entUserid = req.EntUserId
+	}
 	res, err := entity.UserCenterRpc.GetEntUserInfo(l.ctx, &pb.EntUserReq{
 		AppId:     req.AppId,
-		EntUserId: req.EntUserId,
+		EntUserId: entUserid,
+		EntId:     req.EntId,
 	})
 	if res == nil {
 		resp = &types.Resp{Data: nil, Error_msg: "暂无数据", Error_code: -1}

+ 4 - 2
api/internal/types/types.go

@@ -194,8 +194,10 @@ type UserReq struct {
 }
 
 type EntUserReq struct {
-	AppId     string `header:"appId,default=10000"`
-	EntUserId int64  `json:"entUserId"`
+	AppId           string `header:"appId,default=10000"`
+	EntUserId       int64  `json:"entUserId,optional"`
+	HeaderEntUserId int64  `header:"entUserId,optional"`
+	EntId           int64  `header:"entId,optional"`
 }
 
 type UserAddReq struct {

+ 4 - 2
api/userCenter.api

@@ -207,8 +207,10 @@ type (
 	}
 
 	EntUserReq {
-		AppId     string `header:"appId,default=10000"`
-		EntUserId int64  `json:"entUserId"`
+		AppId           string `header:"appId,default=10000"`
+		EntUserId       int64  `json:"entUserId,optional"`
+		HeaderEntUserId int64  `header:"entUserId,optional"`
+		EntId           int64  `header:"entId,optional"`
 	}
 
 	UserAddReq {

+ 1 - 0
rpc/internal/logic/getentuserinfologic.go

@@ -29,6 +29,7 @@ func (l *GetEntUserInfoLogic) GetEntUserInfo(in *pb.EntUserReq) (*pb.EntUserResp
 	/// todo: add your logic here and delete this line
 	resp := &pb.EntUserResp{}
 	ret, msg := Entservice.GetEntUserInfo(in)
+	fmt.Println(in.EntId, in.EntUserId, "####")
 	if msg != "" {
 		l.Error(fmt.Sprintf("%+v", in), msg)
 		resp.ErrorMsg = msg