calllogic.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package logic
  2. import (
  3. "context"
  4. "bp.jydev.jianyu360.cn/BaseService/biService/entity"
  5. "bp.jydev.jianyu360.cn/BaseService/biService/service"
  6. "bp.jydev.jianyu360.cn/BaseService/biService/rpc/internal/svc"
  7. "bp.jydev.jianyu360.cn/BaseService/biService/rpc/pb"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type CallLogic struct {
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. logx.Logger
  14. }
  15. func NewCallLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CallLogic {
  16. return &CallLogic{
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. Logger: logx.WithContext(ctx),
  20. }
  21. }
  22. func (l *CallLogic) Call(in *pb.CallReq) (*pb.Resp, error) {
  23. resp := &pb.Resp{}
  24. hlyj := service.HlyjStruct{
  25. Account: entity.Hlyj.Account,
  26. TokenUrl: entity.Hlyj.TokenUrl,
  27. Appid: entity.Hlyj.Appid,
  28. Secret: entity.Hlyj.Secret,
  29. CallUrl: entity.Hlyj.CallUrl,
  30. Integratedid: entity.Hlyj.Integratedid,
  31. CallFlag: entity.Hlyj.CallFlag,
  32. }
  33. status := hlyj.Call(in.Phone, in.PositionId)
  34. if status {
  35. resp.Status = 1
  36. } else {
  37. resp.Status = -1
  38. }
  39. return resp, nil
  40. }