12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package logic
- import (
- "context"
- "jyBXSubscribe/rpc/type/bxsubscribe"
- "jyBXSubscribe/api/internal/svc"
- "jyBXSubscribe/api/internal/types"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type DistributorLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewDistributorLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DistributorLogic {
- return &DistributorLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *DistributorLogic) Distributor(req *types.DistributorReq) (resp *types.CommonResp, err error) {
- // todo: add your logic here and delete this line
- res, err := l.svcCtx.Suscribe.GetDistributor(l.ctx, &bxsubscribe.GetDistributorReq{
- AppId: req.AppId,
- EntId: req.EntId,
- EntUserId: req.EntUserId,
- Region: req.Region,
- SelectIds: req.SelectIds,
- })
- if err != nil {
- return &types.CommonResp{
- Err_code: res.ErrCode,
- Err_msg: res.ErrMsg,
- Data: nil,
- }, nil
- }
- return &types.CommonResp{
- Err_code: res.ErrCode,
- Err_msg: res.ErrMsg,
- Data: res.Items,
- }, nil
- return
- }
|