assprojecctlogic.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerinfo"
  4. "context"
  5. "app.yhyue.com/moapp/jybase/common"
  6. "app.yhyue.com/moapp/jyInfo/api/internal/svc"
  7. "app.yhyue.com/moapp/jyInfo/api/internal/types"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type AssProjecctLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewAssProjecctLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AssProjecctLogic {
  16. return &AssProjecctLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *AssProjecctLogic) AssProjecct(req *types.AssProjecctReq) (resp *types.CommonRes, err error) {
  23. assProject, err0 := l.svcCtx.Consumer.InfoRelated(l.ctx, &consumerinfo.UserIdReq{
  24. UserId: req.UserId,
  25. Match: req.Match,
  26. AppId: req.AppId,
  27. MsgType: common.Int64All(req.MsgType),
  28. EntId: req.EntId,
  29. MsgId: req.Type,
  30. })
  31. if err0 != nil {
  32. return &types.CommonRes{
  33. Err_code: -1,
  34. Err_msg: "错误",
  35. Data: nil,
  36. }, nil
  37. }
  38. return &types.CommonRes{
  39. Err_code: common.IntAll(assProject.ErrCode),
  40. Err_msg: assProject.ErrMsg,
  41. Data: assProject.Data,
  42. }, nil
  43. }