Преглед изворни кода

Merge branch 'dev/v1.1.20_fuwencai' of http://192.168.3.207:8080/BaseService/jyMicroservices into dev/v1.1.20_fuwencai

wangshan пре 2 година
родитељ
комит
543c107459
2 измењених фајлова са 1 додато и 54 уклоњено
  1. 0 40
      jyBXSubscribe/entity/rpc.go
  2. 1 14
      jyBXSubscribe/rpc/internal/logic/getsublistlogic.go

+ 0 - 40
jyBXSubscribe/entity/rpc.go

@@ -1,40 +0,0 @@
-package entity
-
-import (
-	"bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/rpc/powercheck"
-	"context"
-)
-
-var (
-	PowerCheck powercheck.PowerCheck
-)
-
-type UserInfoRpc struct {
-	AppId        string //appId 剑鱼 10000
-	UserId       string //用户id
-	BaseUserId   int64  //用户基本id
-	EntId        int64  //企业id
-	EntUserId    int64  //企业用户id
-	AccountId    int64  //账户id
-	PositionType int64  //职位类型 @个人 1企业
-	PositionId   int64  //职位id
-	MgoUserId    string //原userId
-}
-
-// GetUserPowers  获取用户权益信息
-func (ui *UserInfoRpc) GetUserPowers() *powercheck.CheckResp {
-	req := &powercheck.CheckReq{
-		Appid:        ui.AppId,
-		Userid:       ui.MgoUserId,
-		BaseUserId:   ui.BaseUserId,
-		AccountId:    ui.AccountId,
-		EntId:        ui.EntId,
-		PositionType: ui.PositionType,
-		PositionId:   ui.PositionId,
-	}
-	checkResp, err := PowerCheck.Check(context.Background(), req)
-	if err == nil {
-		return checkResp
-	}
-	return nil
-}

+ 1 - 14
jyBXSubscribe/rpc/internal/logic/getsublistlogic.go

@@ -2,7 +2,6 @@ package logic
 
 import (
 	"context"
-	"jyBXSubscribe/entity"
 	IC "jyBXSubscribe/rpc/init"
 	"jyBXSubscribe/rpc/internal/svc"
 	"jyBXSubscribe/rpc/model"
@@ -45,20 +44,8 @@ func (l *GetSubListLogic) GetSubList(in *bxsubscribe.SubscribeInfosReq) (*bxsubs
 	accountId, _ := strconv.ParseInt(in.AccountId, 10, 64)
 	positionId, _ := strconv.ParseInt(in.PositionId, 10, 64)
 	entId, _ := strconv.ParseInt(in.EntId, 10, 64)
-	entUserId, _ := strconv.ParseInt(in.EntUserId, 10, 64)
-	userInfoRpc := entity.UserInfoRpc{
-		AppId:        in.AppId,
-		UserId:       in.UserId,
-		BaseUserId:   in.NewUserId,
-		EntId:        entId,
-		EntUserId:    entUserId,
-		AccountId:    accountId,
-		PositionType: in.PositionType,
-		PositionId:   positionId,
-		MgoUserId:    in.MgoUserId,
-	}
 	//判断用户身份
-	userInfo := userInfoRpc.GetUserPowers()
+	userInfo := IC.Middleground.PowerCheckCenter.Check("10000", in.UserId, in.NewUserId, accountId, entId, in.PositionType, positionId)
 	//是否是付费用户
 	isPay := !userInfo.Free.IsFree
 	isPayUser := false