bcactionlogic.go 976 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jybase/common"
  4. "context"
  5. "github.com/zeromicro/go-zero/core/logx"
  6. "jyBXBase/api/internal/svc"
  7. "jyBXBase/api/internal/types"
  8. "jyBXBase/rpc/type/bxbase"
  9. )
  10. type BCActionLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewBCActionLogic(ctx context.Context, svcCtx *svc.ServiceContext) *BCActionLogic {
  16. return &BCActionLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *BCActionLogic) BCAction(req *types.BCAction) (resp *types.CommonRes, err error) {
  23. res, err0 := l.svcCtx.Bxbase.BCAction(l.ctx, &bxbase.BCActionReq{
  24. UserId: req.UserId,
  25. Baction: req.Baction,
  26. Bids: req.Bids,
  27. AppId: req.AppId,
  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(res.ErrCode),
  38. Err_msg: res.ErrMsg,
  39. Data: res.Status,
  40. }, nil
  41. }