saveTSGuideLogic.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package logic
  2. import (
  3. "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/api/internal/svc"
  4. "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/api/internal/types"
  5. "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/type/bxsubscribe"
  6. "context"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type SaveTSGuideLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewSaveTSGuideLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SaveTSGuideLogic {
  15. return &SaveTSGuideLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *SaveTSGuideLogic) SaveTSGuide(req *types.SaveTsGuideReq) (resp *types.CommonResp, err error) {
  22. // todo: add your logic here and delete this line
  23. _, err = l.svcCtx.Suscribe.SaveTSGuide(l.ctx, &bxsubscribe.SaveTSGuideReq{
  24. AppId: req.AppId,
  25. UserType: req.UserType,
  26. UserId: req.UserId,
  27. NewUserId: req.NewUserId,
  28. EntId: req.EntId,
  29. PositionId: req.PositionId,
  30. AccountId: req.AccountId,
  31. PositionType: req.PositionType,
  32. Area: req.Area,
  33. District: req.District,
  34. Keywords: req.Keywords,
  35. AppSwitch: req.AppSwitch,
  36. })
  37. if err != nil {
  38. return &types.CommonResp{
  39. Err_code: -1,
  40. Err_msg: err.Error(),
  41. Data: nil,
  42. }, nil
  43. }
  44. return &types.CommonResp{
  45. Err_code: 0,
  46. }, nil
  47. }