onekeyactionlogic.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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.MyPublishCommonReq) (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. })
  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(organ.ErrCode),
  40. Err_msg: organ.ErrMsg,
  41. Data: nil,
  42. }, nil
  43. }