getkeylogic.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package logic
  2. import (
  3. "context"
  4. "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/internal/svc"
  5. "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/model"
  6. "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/type/bxsubscribe"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type GetKeyLogic struct {
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. logx.Logger
  13. }
  14. func NewGetKeyLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetKeyLogic {
  15. return &GetKeyLogic{
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. Logger: logx.WithContext(ctx),
  19. }
  20. }
  21. // 关键词获取
  22. func (l *GetKeyLogic) GetKey(in *bxsubscribe.GetKeyReq) (*bxsubscribe.KeyResp, error) {
  23. // todo: add your logic here and delete this line
  24. spqp := &model.KeyParam{
  25. UserId: in.UserId, //用户id
  26. EntId: in.EntId, //商机管理企业id
  27. EntUserId: in.EntUserId, //商机管理用户id
  28. NewUserId: in.NewUserId,
  29. IsEnt: in.IsEnt,
  30. VipPower: in.VipPower,
  31. MemberPower: in.MemberPower,
  32. PowerSource: in.PowerSource,
  33. UserPower: in.UserPower,
  34. DeptId: in.DeptId,
  35. PositionType: in.PositionType,
  36. }
  37. data := model.NewSubscribePush(in.UserType).Keys(spqp)
  38. return &bxsubscribe.KeyResp{
  39. ErrCode: 0,
  40. ErrMsg: "",
  41. Items: data,
  42. }, nil
  43. }