1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- package logic
- import (
- "context"
- "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/type/bxsubscribe"
- "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/api/internal/svc"
- "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/api/internal/types"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type GetStaffSubscribeListLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewGetStaffSubscribeListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetStaffSubscribeListLogic {
- return &GetStaffSubscribeListLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *GetStaffSubscribeListLogic) GetStaffSubscribeList(req *types.GetStaffSubscribeListReq) (resp *types.StaffSubscribeCommonResp, err error) {
- res, err := l.svcCtx.Suscribe.GetStaffSubscribeList(l.ctx, &bxsubscribe.StaffSubscribeReq{
- AppId: req.AppId,
- EntId: req.EntId,
- EntUserId: req.EntUserId,
- Query: req.Search,
- EStatus: req.EStatus,
- PStatus: req.PStatus,
- PageNum: req.PageNum,
- PageSize: req.PageSize,
- })
- if err != nil {
- return nil, err
- }
- if res.ErrCode != 0 {
- return &types.StaffSubscribeCommonResp{
- Err_code: res.ErrCode,
- Err_msg: res.ErrMsg,
- Data: nil,
- }, nil
- }
- return &types.StaffSubscribeCommonResp{
- Err_code: res.ErrCode,
- Err_msg: res.ErrMsg,
- Data: map[string]interface{}{
- "total": res.Total,
- "list": res.Items,
- },
- }, nil
- }
|