identitylistlogic.go 776 B

12345678910111213141516171819202122232425262728293031
  1. package logic
  2. import (
  3. "context"
  4. "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/internal/svc"
  5. "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
  6. "bp.jydev.jianyu360.cn/BaseService/userCenter/service"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type IdentityListLogic struct {
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. logx.Logger
  13. }
  14. func NewIdentityListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *IdentityListLogic {
  15. return &IdentityListLogic{
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. Logger: logx.WithContext(ctx),
  19. }
  20. }
  21. // 获取用户可切换的身份列表
  22. func (l *IdentityListLogic) IdentityList(in *pb.IdentityReq) (*pb.IdentityResp, error) {
  23. resp := &pb.IdentityResp{}
  24. resp.Identitys = service.IdentityList(in.Id)
  25. return resp, nil
  26. }