setpushsetlogic.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package logic
  2. import (
  3. "context"
  4. "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/model/service"
  5. "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/internal/svc"
  6. "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/type/bxsubscribe"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type SetPushSetLogic struct {
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. logx.Logger
  13. }
  14. func NewSetPushSetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SetPushSetLogic {
  15. return &SetPushSetLogic{
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. Logger: logx.WithContext(ctx),
  19. }
  20. }
  21. // 用户推送设置修改
  22. func (l *SetPushSetLogic) SetPushSet(in *bxsubscribe.SetPushSetReq) (*bxsubscribe.StatusResp, error) {
  23. // todo: add your logic here and delete this line
  24. subService := &service.PushSetService{
  25. UserId: in.UserId,
  26. PositionType: in.PositionType,
  27. EntUserId: in.EntUserId,
  28. EntId: in.EntId,
  29. }
  30. fool := subService.Update(in.Item, in.SetType, in.PushType, in.Ratemode, in.PushValue, in.Interested, in.Times)
  31. if fool {
  32. return &bxsubscribe.StatusResp{
  33. ErrorCode: 0,
  34. }, nil
  35. } else {
  36. return &bxsubscribe.StatusResp{
  37. ErrorCode: -1,
  38. }, nil
  39. }
  40. }