source.go 576 B

1234567891011121314151617181920212223
  1. package entity
  2. import (
  3. resourcepb "bp.jydev.jianyu360.cn/BaseService/resourceCenter/rpc/pb"
  4. "context"
  5. "strconv"
  6. )
  7. //获取用户资源信息
  8. func GetResources(appId, baseUserId string, entId, entUserId int64) []string {
  9. baseUserIdInt, _ := strconv.ParseInt(baseUserId, 10, 0)
  10. req := &resourcepb.HaspowersReq{
  11. EntId: entId,
  12. UserId: baseUserIdInt,
  13. EntUserId: entUserId,
  14. Appid: appId,
  15. }
  16. powerList, err := ResourceLib.Haspowers(context.Background(), req)
  17. if err == nil && len(powerList.Powers) > 0 {
  18. return powerList.Powers
  19. }
  20. return []string{}
  21. }