identitylistlogic.go 844 B

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