Merge branch 'master' into net6.0

This commit is contained in:
不做码农
2022-03-24 12:42:13 +08:00
25 changed files with 2284 additions and 192 deletions

View File

@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Infrastructure.Enums
{
/// <summary>
/// 文件存储位置
/// </summary>
public enum StoreType
{
/// <summary>
/// 本地
/// </summary>
[Description("本地")]
LOCAL = 1,
/// <summary>
/// 阿里云
/// </summary>
[Description("阿里云")]
ALIYUN = 2,
/// <summary>
/// 腾讯云
/// </summary>
[Description("腾讯云")]
TENCENT = 3,
}
}

View File

@@ -16,16 +16,11 @@ namespace Infrastructure
public static string GetdirPath(string path = "")
{
DateTime date = DateTime.Now;
int year = date.Year;
int month = date.Month;
int day = date.Day;
int hour = date.Hour;
string timeDir = $"{year}{month}{day}/";// date.ToString("yyyyMM/dd/HH/");
string timeDir = date.ToString("yyyyMMdd");// date.ToString("yyyyMM/dd/HH/");
if (!string.IsNullOrEmpty(path))
{
timeDir = $"{path}/{timeDir}/";
timeDir = Path.Combine(path, timeDir);
}
return timeDir;
}
@@ -33,7 +28,7 @@ namespace Infrastructure
/// <summary>
/// 取文件名的MD5值(16位)
/// </summary>
/// <param name="name">文件名,不包括扩展名</param>
/// <param name="str">文件名,不包括扩展名</param>
/// <returns></returns>
public static string HashFileName(string str = null)
{