From b4f4b640ac62bf583e25512656ac92bb09872b8a Mon Sep 17 00:00:00 2001
From: liaoxujun@qq.com <liaoxujun@qq.com>
Date: 星期五, 04 八月 2023 09:38:10 +0800
Subject: [PATCH] 增加用户详情,
---
DocumentFile.Service/Controllers/DocumentController.cs | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 51 insertions(+), 6 deletions(-)
diff --git a/DocumentFile.Service/Controllers/DocumentController.cs b/DocumentFile.Service/Controllers/DocumentController.cs
index 7fa7452..57da744 100644
--- a/DocumentFile.Service/Controllers/DocumentController.cs
+++ b/DocumentFile.Service/Controllers/DocumentController.cs
@@ -20,16 +20,58 @@
}
/// <summary>
- /// 涓婁紶鏂囦欢锛坵ord锛�
+ /// 涓婁紶鏂囦欢妯℃澘锛坉oc銆乨ocx锛�
/// </summary>
+ /// <param name="code">绉熸埛鍞竴鏍囪瘑code</param>
+ /// <param name="formFile">鏂囦欢</param>
/// <returns></returns>
[HttpPost]
- public async Task<IActionResult> UploadDocument(IFormFile formFile)
+ public async Task<IActionResult> UploadDocTemplate([FromForm]string code,IFormFile formFile)
{
ReturnMsg msg = new ReturnMsg();
if(formFile.Length>0)
{
- msg = await this._uploadService.HandleUploadWordFile(formFile);
+ msg = await this._uploadService.HandleUploadTemplateFile(formFile,code);
+ }
+ else
+ {
+ msg.error = "璇蜂笂浼犳枃浠�";
+ }
+
+ return new JsonResult(msg);
+ }
+
+ /// <summary>
+ /// 涓婁紶鏂囦欢锛坉oc銆乨ocx锛�
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost]
+ public async Task<IActionResult> UploadDocInstance([FromForm] string code, IFormFile formFile)
+ {
+ ReturnMsg msg = new ReturnMsg();
+ if (formFile.Length > 0)
+ {
+ msg = await this._uploadService.HandleUploadWordFile(formFile, code);
+ }
+ else
+ {
+ msg.error = "璇蜂笂浼犳枃浠�";
+ }
+
+ return new JsonResult(msg);
+ }
+
+ /// <summary>
+ /// 涓婁紶鍥剧墖锛坖pg銆乯peg銆乸ng锛�
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost]
+ public async Task<IActionResult> UploadPhoto([FromForm] string code, IFormFile formFile)
+ {
+ ReturnMsg msg = new ReturnMsg();
+ if (formFile.Length > 0)
+ {
+ msg = await this._uploadService.HandleUploadImageFile(formFile, code);
}
else
{
@@ -45,15 +87,18 @@
/// <param name="url"></param>
/// <returns></returns>
[HttpPost]
- public IActionResult Download([FromBody] string url)
+ public IActionResult Download([FromForm] string url)
{
try
{
if (!string.IsNullOrEmpty(url))
{
var _webRootPath = AppDomain.CurrentDomain.BaseDirectory;
-
- return new FileStreamResult(new FileStream(_webRootPath + url, FileMode.Open), "application/octet-stream");// { FileDownloadName = FileName };
+ var path = _webRootPath + url;
+ if (System.IO.File.Exists(path))
+ {
+ return new FileStreamResult(new FileStream(path, FileMode.Open), "application/octet-stream");// { FileDownloadName = FileName };
+ }
}
}
catch (Exception ex)
--
Gitblit v1.9.1