calllogic.go 795 B

12345678910111213141516171819202122232425262728293031323334
  1. package logic
  2. import (
  3. "context"
  4. "bp.jydev.jianyu360.cn/BaseService/biService/rpc/pb"
  5. "bp.jydev.jianyu360.cn/BaseService/biService/api/internal/svc"
  6. "bp.jydev.jianyu360.cn/BaseService/biService/api/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type CallLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewCallLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CallLogic {
  15. return &CallLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *CallLogic) Call(req *types.CallReq) (resp *types.Resp, err error) {
  22. callresp, err := l.svcCtx.BiServiceRpc.Call(l.ctx, &pb.CallReq{
  23. PositionId: req.PositionId,
  24. Phone: req.Phone,
  25. })
  26. return &types.Resp{Error_code: 1, Data: callresp.Data}, err
  27. }