| | |
| | | /// </summary> |
| | | public class OcrCommandHandler : |
| | | IRequestHandler<GetLicenseOcrCommand, GetLicenseOcrCommandResult>, |
| | | IRequestHandler<GetIdentityOcrCommand, GetIdentityOcrCommandResult> |
| | | IRequestHandler<GetIdentityFrontOcrCommand, GetIdentityFrontOcrCommandResult>, |
| | | IRequestHandler<GetIdentityBackOcrCommand, GetIdentityBackOcrCommandResult> |
| | | { |
| | | /// <summary> |
| | | /// 文字识别营业执照 |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 文字识别身份证 |
| | | /// 文字识别身份证正面 |
| | | /// </summary> |
| | | /// <param name="request"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<GetIdentityOcrCommandResult> Handle(GetIdentityOcrCommand request, CancellationToken cancellationToken) |
| | | public async Task<GetIdentityFrontOcrCommandResult> Handle(GetIdentityFrontOcrCommand request, CancellationToken cancellationToken) |
| | | { |
| | | var result = await request.Url.OcrBusinessLicense(request.Scene, request.IsOssUrl); |
| | | return result.Adapt<GetIdentityOcrCommandResult>(); |
| | | var result = await request.Url.OcrIdentityFront(request.Scene, request.IsOssUrl); |
| | | return result.Adapt<GetIdentityFrontOcrCommandResult>(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 文字识别身份证背面 |
| | | /// </summary> |
| | | /// <param name="request"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<GetIdentityBackOcrCommandResult> Handle(GetIdentityBackOcrCommand request, CancellationToken cancellationToken) |
| | | { |
| | | var result = await request.Url.OcrIdentityBack(request.Scene, request.IsOssUrl); |
| | | return result.Adapt<GetIdentityBackOcrCommandResult>(); |
| | | } |
| | | } |
| | | } |