onekeyactionlogic.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jyInfo/rpc/manager/managerinfo"
  4. "app.yhyue.com/moapp/jybase/common"
  5. "context"
  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 OneKeyActionLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewOneKeyActionLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OneKeyActionLogic {
  16. return &OneKeyActionLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *OneKeyActionLogic) OneKeyAction(req *types.OneKeyActionReq) (resp *types.CommonRes, err error) {
  23. req.UserId = "623c3742e7570166821228a7"
  24. organ, err0 := l.svcCtx.Manager.InfoOneKeyAction(l.ctx, &managerinfo.OneKeyActionReq{
  25. AppId: req.AppId,
  26. UserId: req.UserId,
  27. MsgType: common.InterfaceToStr(req.MsgType),
  28. MsgId: req.MsgId,
  29. Type: req.Type,
  30. EntName: req.EntName,
  31. })
  32. if err0 != nil {
  33. return &types.CommonRes{
  34. Err_code: -1,
  35. Err_msg: "错误",
  36. Data: nil,
  37. }, nil
  38. }
  39. return &types.CommonRes{
  40. Err_code: common.IntAll(organ.ErrCode),
  41. Err_msg: organ.ErrMsg,
  42. Data: nil,
  43. }, nil
  44. }