12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package logic
- import (
- "context"
- "bp.jydev.jianyu360.cn/BaseService/biService/rpc/pb"
- "bp.jydev.jianyu360.cn/BaseService/biService/api/internal/svc"
- "bp.jydev.jianyu360.cn/BaseService/biService/api/internal/types"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type CallLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewCallLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CallLogic {
- return &CallLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *CallLogic) Call(req *types.CallReq) (resp *types.Resp, err error) {
- resp = &types.Resp{}
- callresp, err := l.svcCtx.BiServiceRpc.Call(l.ctx, &pb.CallReq{
- PositionId: req.PositionId,
- Phone: req.Phone,
- })
- if callresp == nil || err != nil {
- resp.Error_msg = "暂无数据"
- resp.Error_code = -1
- resp.Data = map[string]interface{}{
- "status": -1,
- }
- }
- resp.Data = map[string]interface{}{
- "status": callresp.Status,
- }
- return
- }
|