修复设备文件上传接口
This commit is contained in:
@@ -5,11 +5,11 @@ namespace Tnb.EquipMgr.Interfaces
|
||||
{
|
||||
public interface IEqpEquipFileService
|
||||
{
|
||||
/// <summary>
|
||||
/// 上传附件
|
||||
/// </summary>
|
||||
/// <param name="file"></param>
|
||||
/// <returns></returns>
|
||||
public Task<string> Upload(string equip_id,IFormFile file);
|
||||
///// <summary>
|
||||
///// 上传附件
|
||||
///// </summary>
|
||||
///// <param name="file"></param>
|
||||
///// <returns></returns>
|
||||
//public Task<string> Upload(string equip_id,IFormFile file);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Models;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.FriendlyException;
|
||||
@@ -10,6 +11,7 @@ using JNPF.Systems.Interfaces.Common;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys;
|
||||
using JNPF.VisualDev.Interfaces;
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
@@ -41,16 +43,16 @@ namespace Tnb.EquipMgr
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<string> Upload([FromForm]string equip_id,[FromForm]IFormFile file)
|
||||
public async Task<string> Upload([FromForm]string equip_id,[FromForm] ChunkModel input)
|
||||
{
|
||||
string msg = "";
|
||||
try
|
||||
{
|
||||
var attachment = await _fileService.Uploader("annexpic", file);
|
||||
var attachment = await _fileService.Uploader("annexpic", input);
|
||||
|
||||
EqpEquipFile eqpEquipFile = new EqpEquipFile()
|
||||
{
|
||||
file_name = file.FileName,
|
||||
file_name = input.file.FileName,
|
||||
equip_id = equip_id,
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
|
||||
Reference in New Issue
Block a user