From 5856a6e5de198436bc112923609db21c9a45fd10 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期二, 01 七月 2025 15:58:42 +0800
Subject: [PATCH] 增加公司收藏工人的功能
---
cylsg/EzUpFile/UpFileController.cs | 124 ++++++++++++++++++++++++++++++++++++++++-
1 files changed, 120 insertions(+), 4 deletions(-)
diff --git a/cylsg/EzUpFile/UpFileController.cs b/cylsg/EzUpFile/UpFileController.cs
index a9b428c..ec28556 100644
--- a/cylsg/EzUpFile/UpFileController.cs
+++ b/cylsg/EzUpFile/UpFileController.cs
@@ -1,10 +1,17 @@
-锘縰sing Microsoft.AspNetCore.Http;
+锘縰sing EzTencentCloud;
+using Furion.FriendlyException;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Http.HttpResults;
using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+using Microsoft.IdentityModel.Abstractions;
+using StackExchange.Profiling.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using TencentCloud.Ocr.V20181119.Models;
namespace EzUpFile
{
@@ -12,9 +19,90 @@
/// 鏂囦欢涓婁紶涓嬭浇
/// </summary>
[DynamicApiController]
- [ApiDescriptionSettings("FileUpdata@0")]
+ [ApiDescriptionSettings("FileUpdata")]
public class UpFileController
{
+ /// <summary>
+ /// 鑾峰彇鏂囦欢 涓婁紶token
+ /// </summary>
+ /// <returns></returns>
+ [HttpGet]
+
+ public Dictionary<string, string> GetToken([FromServices] IEzFileUploadService fileUploadService)
+ {
+ return fileUploadService.GetToken();
+ }
+ /// <summary>
+ /// 涓婁紶韬唤璇佷俊鎭�
+ /// </summary>
+ /// <param name="PageName"> 韬唤璇佹鍙嶉潰 FRONT 姝i潰 Back 鍥藉窘鍙嶉潰 </param>
+ /// <returns></returns>
+ [HttpPost]
+ public async Task<Object> UploadIdCord([FromServices] IEzFileUploadService fileUploadService,IFormFile file, [FromQuery] string PageName = "FRONT")
+ {
+
+
+ var ret= await fileUploadService.UpIdCord(PageName);
+ return new { Info = ret.Item1, url = ret.Item2 };
+ }
+
+ /// <summary>
+ /// 涓婁紶鍜岃瘑鍒惀涓氭墽鐓�
+ /// </summary>
+ /// <param name="PageName"> 韬唤璇佹鍙嶉潰 FRONT 姝i潰 Back 鍥藉窘鍙嶉潰 </param>
+ /// <returns></returns>
+ [HttpPost]
+ public async Task<Object> UpBizLicense([FromServices] IEzFileUploadService fileUploadService, IFormFile file)
+ {
+
+
+ var ret= await fileUploadService.UpBizLicense();
+ return new { Info = ret.Item1, url = ret.Item2 };
+
+ }
+ /// <summary>
+ /// 澧炲姞浜鸿劯鐗瑰緛
+ /// </summary>
+ /// <param name="CordId">韬唤璇佸彿</param>
+ /// <param name="Name">鍚嶇О</param>
+ /// <param name="Gender">0浠h〃鏈~鍐欙紝1浠h〃鐢锋�э紝2浠h〃濂虫�с��</param>
+ /// <returns></returns>
+ [HttpPost]
+ public async Task<object> IaiAddPerso([FromServices] IEzFileUploadService fileUploadService, IFormFile file,[FromQuery] string CordId, [FromQuery] string Name, [FromQuery] int 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 };
+
+
+ }
+ public async Task test([FromServices] ITencentCloudService fileUploadService)
+ {
+
+ fileUploadService.IaiCreatGroup();
+
+ }
/// <summary>
/// 涓婁紶闄勪欢
@@ -47,7 +135,7 @@
[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)
@@ -64,7 +152,19 @@
/// <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>
/// 涓婁紶鏁版嵁
@@ -77,4 +177,20 @@
/// </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; }
+
+ }
}
--
Gitblit v1.9.1