1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- package logic
- import (
- "context"
- "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/model/service"
- "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/internal/svc"
- "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/type/bxsubscribe"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type SetPushSetLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- func NewSetPushSetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SetPushSetLogic {
- return &SetPushSetLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- // 用户推送设置修改
- func (l *SetPushSetLogic) SetPushSet(in *bxsubscribe.SetPushSetReq) (*bxsubscribe.StatusResp, error) {
- // todo: add your logic here and delete this line
- subService := &service.PushSetService{
- UserId: in.UserId,
- PositionType: in.PositionType,
- EntUserId: in.EntUserId,
- EntId: in.EntId,
- }
- fool := subService.Update(in.Item, in.SetType, in.PushType, in.Ratemode, in.PushValue, in.Interested, in.Times)
- if fool {
- return &bxsubscribe.StatusResp{
- ErrorCode: 0,
- }, nil
- } else {
- return &bxsubscribe.StatusResp{
- ErrorCode: -1,
- }, nil
- }
- }
|