fix namesapce

This commit is contained in:
2020-08-05 15:29:56 +08:00
parent f1138a5a10
commit 2abe486151
17 changed files with 117 additions and 120 deletions
+5 -5
View File
@@ -2,18 +2,18 @@ using System;
using System.Text.Json;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Caching.Distributed;
using YYApi.Communications;
using SimApi.Communications;
namespace YYApi.Helpers
namespace SimApi.Helpers
{
/// <summary>
/// 认证助手
/// </summary>
public class YYAuth
public class SimApiAuth
{
private IDistributedCache Cache { get; }
public YYAuth(IDistributedCache cache)
public SimApiAuth(IDistributedCache cache)
{
Cache = cache;
}
@@ -40,7 +40,7 @@ namespace YYApi.Helpers
{
uuid = Guid.NewGuid().ToString();
}
var loginItem = new YYLoginItem
var loginItem = new SimApiLoginItem
{
Id = id,
Type = type
@@ -2,9 +2,9 @@
using System.IO;
using Microsoft.AspNetCore.Hosting;
namespace YYApi.Helpers
namespace SimApi.Helpers
{
public class YYUpload
public class SimApiUpload
{
private string FilePathFolder = "/uploads/";
public string FilePath
@@ -28,12 +28,12 @@ namespace YYApi.Helpers
private IWebHostEnvironment Env { get; }
public YYUpload(IWebHostEnvironment env)
public SimApiUpload(IWebHostEnvironment env)
{
Env = env;
}
public class YYUploadInfo
public class SimApiUploadInfo
{
public string Path { get; set; }
public int Size { get; set; }
@@ -47,7 +47,7 @@ namespace YYApi.Helpers
/// <param name="path">存放路径</param>
/// <param name="fileName">文件名</param>
/// <returns></returns>
public YYUploadInfo SaveFile(string base64, string ext = null, string path = null, string fileName = null)
public SimApiUploadInfo SaveFile(string base64, string ext = null, string path = null, string fileName = null)
{
byte[] bt;
var filePath = FilePath + path;
@@ -85,7 +85,7 @@ namespace YYApi.Helpers
/// <param name="fileName"></param>
/// <param name="data"></param>
/// <returns></returns>
public YYUploadInfo WriteFile(string filePath, string fileName, byte[] data)
public SimApiUploadInfo WriteFile(string filePath, string fileName, byte[] data)
{
var realPath = Directory.GetCurrentDirectory() + "/wwwroot" + filePath;
if (!Directory.Exists(realPath))
@@ -93,7 +93,7 @@ namespace YYApi.Helpers
Directory.CreateDirectory(realPath);
}
File.WriteAllBytes(realPath + fileName, data);
return new YYUploadInfo
return new SimApiUploadInfo
{
Path = filePath + fileName,
Size = data.Length
+2 -2
View File
@@ -3,9 +3,9 @@ using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
namespace YYApi.Helpers
namespace SimApiApi.Helpers
{
public static class YYUtil
public static class SimApiUtil
{
/// <summary>
/// 检测手机号是否正确