labelactionlogic.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 LabelActionLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewLabelActionLogic(ctx context.Context, svcCtx *svc.ServiceContext) *LabelActionLogic {
  16. return &LabelActionLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *LabelActionLogic) LabelAction(req *types.LabelAction) (resp *types.CommonRes, err error) {
  23. res, err0 := l.svcCtx.Bxbase.LabelAction(l.ctx, &bxbase.LabelActionReq{
  24. UserId: req.UserId,
  25. Laction: req.Laction,
  26. Binfo: req.Binfo,
  27. Lids: req.Lids,
  28. Lname: req.Lname,
  29. AppId: req.AppId,
  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(res.ErrCode),
  40. Err_msg: res.ErrMsg,
  41. Data: res.Status,
  42. }, nil
  43. }