提交.Net6版本
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Common.Models
|
||||
{
|
||||
public class AxiosUrlsModel
|
||||
{
|
||||
public string get { get; set; }
|
||||
public string update { get; set; }
|
||||
public string del { get; set; }
|
||||
public string add { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Yi.Framework.Common.Enum
|
||||
{
|
||||
public enum AgrFlagEnum
|
||||
{
|
||||
wait = 0,
|
||||
Agree = 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Yi.Framework.Common.Enum
|
||||
{
|
||||
public enum DelFlagEnum
|
||||
{
|
||||
Normal=0,
|
||||
Deleted=1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Common.Enum
|
||||
{
|
||||
public enum ShowFlagEnum
|
||||
{
|
||||
NoShow=0,
|
||||
Show=1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Common.Enum
|
||||
{
|
||||
public enum TopFlagEnum
|
||||
{
|
||||
Children=0,
|
||||
Top=1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Yi.Framework.Common.Enum
|
||||
{
|
||||
public enum WriteAndReadEnum
|
||||
{
|
||||
Write, //主库操作
|
||||
Read //从库操作
|
||||
}
|
||||
}
|
||||
13
Yi.Framework.Net5/Yi.Framework.Common/Models/JobModel.cs
Normal file
13
Yi.Framework.Net5/Yi.Framework.Common/Models/JobModel.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Common.Models
|
||||
{
|
||||
public class JobModel
|
||||
{
|
||||
public static int visitNum { get; set; } = 0;
|
||||
}
|
||||
}
|
||||
18
Yi.Framework.Net5/Yi.Framework.Common/Models/LogModel.cs
Normal file
18
Yi.Framework.Net5/Yi.Framework.Common/Models/LogModel.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Common.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 写入分布式日志需要的字段
|
||||
/// </summary>
|
||||
public class LogModel
|
||||
{
|
||||
public string OriginalClassName { get; set; }
|
||||
public string OriginalMethodName { get; set; }
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
13
Yi.Framework.Net5/Yi.Framework.Common/Models/PageModel.cs
Normal file
13
Yi.Framework.Net5/Yi.Framework.Common/Models/PageModel.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Common.Models
|
||||
{
|
||||
public class PageModel
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
77
Yi.Framework.Net5/Yi.Framework.Common/Models/Result.cs
Normal file
77
Yi.Framework.Net5/Yi.Framework.Common/Models/Result.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Yi.Framework.Common.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 结果数据
|
||||
/// </summary>
|
||||
public class Result
|
||||
{
|
||||
public bool status { get; set; }
|
||||
public int code { get; set; }
|
||||
public string msg { get; set; }
|
||||
public object data { get; set; }
|
||||
public static Result Instance(bool status, string msg)
|
||||
{
|
||||
return new Result() { status = status, code = 500, msg = msg };
|
||||
}
|
||||
public static Result Error(string msg = "fail")
|
||||
{
|
||||
return new Result() { status = false, code = 500, msg = msg };
|
||||
}
|
||||
public static Result Success(string msg = "succeed")
|
||||
{
|
||||
return new Result() { status = true, code = 200, msg = msg };
|
||||
}
|
||||
public static Result UnAuthorize(string msg = "unAuthorize")
|
||||
{
|
||||
return new Result() { status = false, code = 401, msg = msg };
|
||||
}
|
||||
|
||||
public Result SetData(object obj)
|
||||
{
|
||||
this.data = obj;
|
||||
return this;
|
||||
}
|
||||
public Result SetCode(int Code)
|
||||
{
|
||||
this.code = Code;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
public class Result<T>
|
||||
{
|
||||
public bool status { get; set; }
|
||||
public int code { get; set; }
|
||||
public string msg { get; set; }
|
||||
public T data { get; set; }
|
||||
|
||||
public static Result<T> Instance(bool status, string msg)
|
||||
{
|
||||
return new Result<T>() { status = status, code = 500, msg = msg };
|
||||
}
|
||||
public static Result<T> Error(string msg = "fail")
|
||||
{
|
||||
return new Result<T> { status = false, code = 500, msg = msg };
|
||||
}
|
||||
public static Result<T> Success(string msg = "succeed")
|
||||
{
|
||||
return new Result<T> { status = true, code = 200, msg = msg };
|
||||
}
|
||||
|
||||
public static Result<T> UnAuthorize(string msg = "unAuthorize")
|
||||
{
|
||||
return new Result<T>{ status = false, code = 401, msg = msg };
|
||||
}
|
||||
|
||||
public Result<T> SetData(T TValue)
|
||||
{
|
||||
this.data = TValue;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
19
Yi.Framework.Net5/Yi.Framework.Common/Models/SwaggerModel.cs
Normal file
19
Yi.Framework.Net5/Yi.Framework.Common/Models/SwaggerModel.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Common.Models
|
||||
{
|
||||
public class SwaggerModel
|
||||
{
|
||||
public SwaggerModel(string url, string name)
|
||||
{
|
||||
this.url = url;
|
||||
this.name = name;
|
||||
}
|
||||
public string url { get; set; }
|
||||
public string name { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user