setUserLogic.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package logic
  2. import (
  3. "context"
  4. "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/type/bxsubscribe"
  5. "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/api/internal/svc"
  6. "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/api/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type SetUserLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewSetUserLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SetUserLogic {
  15. return &SetUserLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *SetUserLogic) SetUser(req *types.SetUserReq) (*types.CommonResp, error) {
  22. // todo: add your logic here and delete this line
  23. res, err := l.svcCtx.Suscribe.SetUser(l.ctx, &bxsubscribe.SetUserInfoReq{
  24. UserId: req.UserId,
  25. EntId: req.EntId,
  26. EntUserId: req.EntUserId,
  27. PositionType: req.PositionType,
  28. Mail: req.Mail,
  29. })
  30. if err != nil {
  31. return &types.CommonResp{
  32. Err_code: res.ErrorCode,
  33. Err_msg: res.ErrorMsg,
  34. Data: nil,
  35. }, nil
  36. }
  37. return &types.CommonResp{
  38. Err_code: res.ErrorCode,
  39. Err_msg: res.ErrorMsg,
  40. Data: nil,
  41. }, nil
  42. }