文件上传功能添加,注意使用Path.Combine处理通用路径问题(windows||docker)

This commit is contained in:
owenchen committed 2026-09-03 16:09:54 +08:00
1 parent 7817c5374c
commit 244b59a3fb
135 files changed
+16937 -75

No files matched your search

@@ -0,0 +1,48 @@
using CloudBuilder.Core.DatabaseAccessor.Entity;
using CloudBuilder.Core.Service;
using CloudBuilder.Security.Policy;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CloudBuilder.Master.Service
{
public class FileTypePolicyService : IFileTypePolicyService
{
private readonly IApplicationService service;
public FileTypePolicyService(IApplicationService service)
{
this.service = service;
}
[AllowAnonymous]
[HttpPost]
public SelectOption[] FindSelectOption(bool blank)
{
FileTypePolicy policy = FileTypePolicy.GetInstance(service);
string[] values = policy.GetValues();
List<SelectOption> l = new List<SelectOption>();
SelectOption selectOption;
if (blank)
{
selectOption = new SelectOption();
l.Add(selectOption);
}
foreach (string value in values)
{
selectOption = new SelectOption();
selectOption.BindValue = value;
selectOption.DisplayName = policy.ComposeMessage(value, service.Locale);
l.Add(selectOption);
}
return l.ToArray();
}
}
}