| | |
| | | using EzTencentCloud; |
| | | using Furion.FriendlyException; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Http.HttpResults; |
| | | using Microsoft.AspNetCore.Mvc; |
| | |
| | | /// <param name="PageName"> 身份证正反面 FRONT 正面 Back 国徽反面 </param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<(IDCardOCRResponse, string)> UploadIdCord([FromServices] IEzFileUploadService fileUploadService,IFormFile file, [FromQuery] string PageName = "FRONT") |
| | | public async Task<Object> UploadIdCord([FromServices] IEzFileUploadService fileUploadService,IFormFile file, [FromQuery] string PageName = "FRONT") |
| | | { |
| | | |
| | | |
| | | return await fileUploadService.UpIdCord(PageName); |
| | | |
| | | var ret= await fileUploadService.UpIdCord(PageName); |
| | | return new { Info = ret.Item1, url = ret.Item2 }; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="PageName"> 身份证正反面 FRONT 正面 Back 国徽反面 </param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<(BizLicenseOCRResponse, string)> UpBizLicense([FromServices] IEzFileUploadService fileUploadService, IFormFile file) |
| | | public async Task<Object> UpBizLicense([FromServices] IEzFileUploadService fileUploadService, IFormFile file) |
| | | { |
| | | |
| | | |
| | | return await fileUploadService.UpBizLicense(); |
| | | var ret= await fileUploadService.UpBizLicense(); |
| | | return new { Info = ret.Item1, url = ret.Item2 }; |
| | | |
| | | } |
| | | /// <summary> |
| | |
| | | /// <param name="Gender">0代表未填写,1代表男性,2代表女性。</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<(bool , string)> IaiAddPerso([FromServices] IEzFileUploadService fileUploadService, IFormFile file,[FromQuery] string CordId, [FromQuery] string Name, [FromQuery] int Gender) |
| | | public async Task<object> IaiAddPerso([FromServices] IEzFileUploadService fileUploadService, IFormFile file,[FromQuery] string CordId, [FromQuery] string Name, [FromQuery] int Gender) |
| | | { |
| | | |
| | | |
| | | return await fileUploadService.IaiAddPerso(CordId, Name,Gender); |
| | | var ret= await fileUploadService.IaiAddPerso(CordId, Name,Gender); |
| | | return new { IsOK = ret.Item1, url = ret.Item2 }; |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 增加人脸库 base64 |
| | | /// </summary> |
| | | /// <param name="param"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<object> IaiAddPersoBase64([FromServices] IEzFileUploadService fileUploadService, UpDataFileData param) |
| | | { |
| | | if (string.IsNullOrEmpty(param.imgBase64)) |
| | | throw Oops.Oh("没有文件类容"); |
| | | if (string.IsNullOrEmpty(param.Name)) |
| | | throw Oops.Oh("没有姓名"); |
| | | if (string.IsNullOrEmpty(param.CordId)) |
| | | throw Oops.Oh("没有身份证信息"); |
| | | var ret = await fileUploadService.IaiAddPerso(param.imgBase64, param.CordId, param. Name, param.Gender??0); |
| | | return new { IsOK = ret.Item1, url = ret.Item2 }; |
| | | |
| | | |
| | | } |
| | |
| | | [HttpPost] |
| | | public async Task<string> UpdateFileBase64([FromServices] IEzFileUploadService fileUploadService, UpDataFileData Param) |
| | | { |
| | | return await fileUploadService.UploadFilesFByBase64(Param.FileBase64); |
| | | return await fileUploadService.UploadFilesFByBase64(Param.imgBase64); |
| | | } |
| | | [HttpPost] |
| | | public async Task<bool> DelFile([FromServices] IEzFileUploadService fileUploadService, DelFileData Param) |
| | |
| | | /// <summary> |
| | | /// 数据base64 |
| | | /// </summary> |
| | | public string FileBase64 { get; set; } |
| | | public string imgBase64 { get; set; } |
| | | /// <summary> |
| | | /// 身份证号码 |
| | | /// </summary> |
| | | public string? CordId { get; set; } |
| | | /// <summary> |
| | | /// 姓名 |
| | | /// </summary> |
| | | public string? Name { get; set; } |
| | | /// <summary> |
| | | /// 性别 |
| | | /// </summary> |
| | | public int? Gender { get; set; } |
| | | } |
| | | /// <summary> |
| | | /// 上传数据 |
| | |
| | | /// </summary> |
| | | public string FilePath { get; set; } |
| | | } |
| | | /// <summary> |
| | | /// 身份证返回输出 |
| | | /// </summary> |
| | | public class IdCordOuput |
| | | { |
| | | /// <summary> |
| | | /// 身份证相关信息 |
| | | /// </summary> |
| | | public IDCardOCRResponse IdCordInfo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// url |
| | | /// </summary> |
| | | public string Url { get; set; } |
| | | |
| | | } |
| | | } |