assprojecctlogic.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
  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, &consumerclient.UserIdReq{
  24. UserId: req.UserId,
  25. Match: req.Match,
  26. AppId: req.AppId,
  27. MsgType: common.Int64All(req.MsgType),
  28. })
  29. if err0 != nil {
  30. return &types.CommonRes{
  31. Err_code: -1,
  32. Err_msg: "错误",
  33. Data: nil,
  34. }, nil
  35. }
  36. return &types.CommonRes{
  37. Err_code: common.IntAll(assProject.ErrCode),
  38. Err_msg: assProject.ErrMsg,
  39. Data: assProject.Data,
  40. }, nil
  41. }