update:修改项目名称从Dilon到Ewide
This commit is contained in:
33
Api/Ewide.Core/Cache/CacheOptions.cs
Normal file
33
Api/Ewide.Core/Cache/CacheOptions.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Furion.ConfigurableOptions;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 缓存配置
|
||||
/// </summary>
|
||||
public class CacheOptions : IConfigurableOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// 缓存类型
|
||||
/// </summary>
|
||||
public CacheType CacheType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Redis配置
|
||||
/// </summary>
|
||||
public string RedisConnectionString { get; set; }
|
||||
}
|
||||
|
||||
public enum CacheType
|
||||
{
|
||||
/// <summary>
|
||||
/// 内存缓存
|
||||
/// </summary>
|
||||
MemoryCache,
|
||||
|
||||
/// <summary>
|
||||
/// Redis缓存
|
||||
/// </summary>
|
||||
RedisCache
|
||||
}
|
||||
}
|
||||
107
Api/Ewide.Core/Cache/ICache.cs
Normal file
107
Api/Ewide.Core/Cache/ICache.cs
Normal file
@@ -0,0 +1,107 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 缓存接口
|
||||
/// </summary>
|
||||
public interface ICache
|
||||
{
|
||||
/// <summary>
|
||||
/// 用于在 key 存在时删除 key
|
||||
/// </summary>
|
||||
/// <param name="key">键</param>
|
||||
long Del(params string[] key);
|
||||
|
||||
/// <summary>
|
||||
/// 用于在 key 存在时删除 key
|
||||
/// </summary>
|
||||
/// <param name="key">键</param>
|
||||
/// <returns></returns>
|
||||
Task<long> DelAsync(params string[] key);
|
||||
|
||||
/// <summary>
|
||||
/// 用于在 key 模板存在时删除
|
||||
/// </summary>
|
||||
/// <param name="pattern">key模板</param>
|
||||
/// <returns></returns>
|
||||
Task<long> DelByPatternAsync(string pattern);
|
||||
|
||||
/// <summary>
|
||||
/// 检查给定 key 是否存在
|
||||
/// </summary>
|
||||
/// <param name="key">键</param>
|
||||
/// <returns></returns>
|
||||
bool Exists(string key);
|
||||
|
||||
/// <summary>
|
||||
/// 检查给定 key 是否存在
|
||||
/// </summary>
|
||||
/// <param name="key">键</param>
|
||||
/// <returns></returns>
|
||||
Task<bool> ExistsAsync(string key);
|
||||
|
||||
/// <summary>
|
||||
/// 获取指定 key 的值
|
||||
/// </summary>
|
||||
/// <param name="key">键</param>
|
||||
/// <returns></returns>
|
||||
string Get(string key);
|
||||
|
||||
/// <summary>
|
||||
/// 获取指定 key 的值
|
||||
/// </summary>
|
||||
/// <typeparam name="T">byte[] 或其他类型</typeparam>
|
||||
/// <param name="key">键</param>
|
||||
/// <returns></returns>
|
||||
T Get<T>(string key);
|
||||
|
||||
/// <summary>
|
||||
/// 获取指定 key 的值
|
||||
/// </summary>
|
||||
/// <param name="key">键</param>
|
||||
/// <returns></returns>
|
||||
Task<string> GetAsync(string key);
|
||||
|
||||
/// <summary>
|
||||
/// 获取指定 key 的值
|
||||
/// </summary>
|
||||
/// <typeparam name="T">byte[] 或其他类型</typeparam>
|
||||
/// <param name="key">键</param>
|
||||
/// <returns></returns>
|
||||
Task<T> GetAsync<T>(string key);
|
||||
|
||||
/// <summary>
|
||||
/// 设置指定 key 的值,所有写入参数object都支持string | byte[] | 数值 | 对象
|
||||
/// </summary>
|
||||
/// <param name="key">键</param>
|
||||
/// <param name="value">值</param>
|
||||
bool Set(string key, object value);
|
||||
|
||||
/// <summary>
|
||||
/// 设置指定 key 的值,所有写入参数object都支持string | byte[] | 数值 | 对象
|
||||
/// </summary>
|
||||
/// <param name="key">键</param>
|
||||
/// <param name="value">值</param>
|
||||
/// <param name="expire">有效期</param>
|
||||
bool Set(string key, object value, TimeSpan expire);
|
||||
|
||||
/// <summary>
|
||||
/// 设置指定 key 的值,所有写入参数object都支持string | byte[] | 数值 | 对象
|
||||
/// </summary>
|
||||
/// <param name="key">键</param>
|
||||
/// <param name="value">值</param>
|
||||
/// <returns></returns>
|
||||
Task<bool> SetAsync(string key, object value);
|
||||
|
||||
/// <summary>
|
||||
/// 设置指定 key 的值,所有写入参数object都支持string | byte[] | 数值 | 对象
|
||||
/// </summary>
|
||||
/// <param name="key">键</param>
|
||||
/// <param name="value">值</param>
|
||||
/// <param name="expire">有效期</param>
|
||||
/// <returns></returns>
|
||||
Task<bool> SetAsync(string key, object value, TimeSpan expire);
|
||||
}
|
||||
}
|
||||
125
Api/Ewide.Core/Cache/MemoryCache.cs
Normal file
125
Api/Ewide.Core/Cache/MemoryCache.cs
Normal file
@@ -0,0 +1,125 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 内存缓存
|
||||
/// </summary>
|
||||
public class MemoryCache : ICache, ISingleton
|
||||
{
|
||||
private readonly IMemoryCache _memoryCache;
|
||||
|
||||
public MemoryCache(IMemoryCache memoryCache)
|
||||
{
|
||||
_memoryCache = memoryCache;
|
||||
}
|
||||
|
||||
public long Del(params string[] key)
|
||||
{
|
||||
foreach (var k in key)
|
||||
{
|
||||
_memoryCache.Remove(k);
|
||||
}
|
||||
return key.Length;
|
||||
}
|
||||
|
||||
public Task<long> DelAsync(params string[] key)
|
||||
{
|
||||
foreach (var k in key)
|
||||
{
|
||||
_memoryCache.Remove(k);
|
||||
}
|
||||
|
||||
return Task.FromResult((long)key.Length);
|
||||
}
|
||||
|
||||
public async Task<long> DelByPatternAsync(string pattern)
|
||||
{
|
||||
if (string.IsNullOrEmpty(pattern))
|
||||
return default;
|
||||
|
||||
//pattern = Regex.Replace(pattern, @"\{*.\}", "(.*)");
|
||||
var keys = GetAllKeys().Where(k => k.StartsWith(pattern));
|
||||
if (keys != null && keys.Any())
|
||||
return await DelAsync(keys.ToArray());
|
||||
|
||||
return default;
|
||||
}
|
||||
|
||||
public bool Exists(string key)
|
||||
{
|
||||
return _memoryCache.TryGetValue(key, out _);
|
||||
}
|
||||
|
||||
public Task<bool> ExistsAsync(string key)
|
||||
{
|
||||
return Task.FromResult(_memoryCache.TryGetValue(key, out _));
|
||||
}
|
||||
|
||||
public string Get(string key)
|
||||
{
|
||||
return _memoryCache.Get(key)?.ToString();
|
||||
}
|
||||
|
||||
public T Get<T>(string key)
|
||||
{
|
||||
return _memoryCache.Get<T>(key);
|
||||
}
|
||||
|
||||
public Task<string> GetAsync(string key)
|
||||
{
|
||||
return Task.FromResult(Get(key));
|
||||
}
|
||||
|
||||
public Task<T> GetAsync<T>(string key)
|
||||
{
|
||||
return Task.FromResult(Get<T>(key));
|
||||
}
|
||||
|
||||
public bool Set(string key, object value)
|
||||
{
|
||||
_memoryCache.Set(key, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Set(string key, object value, TimeSpan expire)
|
||||
{
|
||||
_memoryCache.Set(key, value, expire);
|
||||
return true;
|
||||
}
|
||||
|
||||
public Task<bool> SetAsync(string key, object value)
|
||||
{
|
||||
Set(key, value);
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
public Task<bool> SetAsync(string key, object value, TimeSpan expire)
|
||||
{
|
||||
Set(key, value, expire);
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
private List<string> GetAllKeys()
|
||||
{
|
||||
const BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic;
|
||||
var entries = _memoryCache.GetType().GetField("_entries", flags).GetValue(_memoryCache);
|
||||
var cacheItems = entries.GetType().GetProperty("Keys").GetValue(entries) as ICollection<object>; //entries as IDictionary;
|
||||
var keys = new List<string>();
|
||||
if (cacheItems == null) return keys;
|
||||
return cacheItems.Select(u => u.ToString()).ToList();
|
||||
//foreach (DictionaryEntry cacheItem in cacheItems)
|
||||
//{
|
||||
// keys.Add(cacheItem.Key.ToString());
|
||||
//}
|
||||
//return keys;
|
||||
}
|
||||
}
|
||||
}
|
||||
95
Api/Ewide.Core/Cache/RedisCache.cs
Normal file
95
Api/Ewide.Core/Cache/RedisCache.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Redis缓存
|
||||
/// </summary>
|
||||
public class RedisCache : ICache, ISingleton
|
||||
{
|
||||
public RedisCache(IOptions<CacheOptions> cacheOptions)
|
||||
{
|
||||
var csredis = new CSRedis.CSRedisClient(cacheOptions.Value.RedisConnectionString);
|
||||
RedisHelper.Initialization(csredis);
|
||||
}
|
||||
|
||||
public long Del(params string[] key)
|
||||
{
|
||||
return RedisHelper.Del(key);
|
||||
}
|
||||
|
||||
public Task<long> DelAsync(params string[] key)
|
||||
{
|
||||
return RedisHelper.DelAsync(key);
|
||||
}
|
||||
|
||||
public async Task<long> DelByPatternAsync(string pattern)
|
||||
{
|
||||
if (string.IsNullOrEmpty(pattern))
|
||||
return default;
|
||||
|
||||
//pattern = Regex.Replace(pattern, @"\{.*\}", "*");
|
||||
var keys = (await RedisHelper.KeysAsync(pattern));
|
||||
if (keys != null && keys.Length > 0)
|
||||
{
|
||||
return await RedisHelper.DelAsync(keys);
|
||||
}
|
||||
|
||||
return default;
|
||||
}
|
||||
|
||||
public bool Exists(string key)
|
||||
{
|
||||
return RedisHelper.Exists(key);
|
||||
}
|
||||
|
||||
public Task<bool> ExistsAsync(string key)
|
||||
{
|
||||
return RedisHelper.ExistsAsync(key);
|
||||
}
|
||||
|
||||
public string Get(string key)
|
||||
{
|
||||
return RedisHelper.Get(key);
|
||||
}
|
||||
|
||||
public T Get<T>(string key)
|
||||
{
|
||||
return RedisHelper.Get<T>(key);
|
||||
}
|
||||
|
||||
public Task<string> GetAsync(string key)
|
||||
{
|
||||
return RedisHelper.GetAsync(key);
|
||||
}
|
||||
|
||||
public Task<T> GetAsync<T>(string key)
|
||||
{
|
||||
return RedisHelper.GetAsync<T>(key);
|
||||
}
|
||||
|
||||
public bool Set(string key, object value)
|
||||
{
|
||||
return RedisHelper.Set(key, value);
|
||||
}
|
||||
|
||||
public bool Set(string key, object value, TimeSpan expire)
|
||||
{
|
||||
return RedisHelper.Set(key, value, expire);
|
||||
}
|
||||
|
||||
public Task<bool> SetAsync(string key, object value)
|
||||
{
|
||||
return RedisHelper.SetAsync(key, value);
|
||||
}
|
||||
|
||||
public Task<bool> SetAsync(string key, object value, TimeSpan expire)
|
||||
{
|
||||
return RedisHelper.SetAsync(key, value, expire);
|
||||
}
|
||||
}
|
||||
}
|
||||
227
Api/Ewide.Core/Captcha/ClickWord/ClickWordCaptcha.cs
Normal file
227
Api/Ewide.Core/Captcha/ClickWord/ClickWordCaptcha.cs
Normal file
@@ -0,0 +1,227 @@
|
||||
using Furion;
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.JsonSerialization;
|
||||
using Furion.Snowflake;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 点选验证码
|
||||
/// </summary>
|
||||
public class ClickWordCaptcha : IClickWordCaptcha, ITransient
|
||||
{
|
||||
private readonly IMemoryCache _memoryCache;
|
||||
|
||||
public ClickWordCaptcha(IMemoryCache memoryCache)
|
||||
{
|
||||
_memoryCache = memoryCache;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成验证码图片
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <param name="width"></param>
|
||||
/// <param name="height"></param>
|
||||
/// <returns></returns>
|
||||
public ClickWordCaptchaResult CreateCaptchaImage(string code, int width, int height)
|
||||
{
|
||||
var rtnResult = new ClickWordCaptchaResult();
|
||||
|
||||
// 变化点: 3个字
|
||||
int rightCodeLength = 3;
|
||||
|
||||
Bitmap bitmap = null;
|
||||
Graphics g = null;
|
||||
MemoryStream ms = null;
|
||||
Random random = new Random();
|
||||
|
||||
Color[] colorArray = { Color.Black, Color.DarkBlue, Color.Green, Color.Orange, Color.Brown, Color.DarkCyan, Color.Purple };
|
||||
|
||||
string bgImagesDir = Path.Combine(App.WebHostEnvironment.WebRootPath, "Captcha/Image");
|
||||
string[] bgImagesFiles = Directory.GetFiles(bgImagesDir);
|
||||
//if (bgImagesFiles == null || bgImagesFiles.Length == 0)
|
||||
// throw Oops.Oh("背景图片文件丢失");
|
||||
|
||||
// 字体来自:https://www.zcool.com.cn/special/zcoolfonts/
|
||||
string fontsDir = Path.Combine(App.WebHostEnvironment.WebRootPath, "Captcha/Font");
|
||||
string[] fontFiles = new DirectoryInfo(fontsDir)?.GetFiles()
|
||||
?.Where(m => m.Extension.ToLower() == ".ttf")
|
||||
?.Select(m => m.FullName).ToArray();
|
||||
//if (fontFiles == null || fontFiles.Length == 0)
|
||||
// throw Oops.Oh("字体文件丢失");
|
||||
|
||||
int imgIndex = random.Next(bgImagesFiles.Length);
|
||||
string randomImgFile = bgImagesFiles[imgIndex];
|
||||
var imageStream = Image.FromFile(randomImgFile);
|
||||
|
||||
bitmap = new Bitmap(imageStream, width, height);
|
||||
imageStream.Dispose();
|
||||
g = Graphics.FromImage(bitmap);
|
||||
Color[] penColor = { Color.Red, Color.Green, Color.Blue };
|
||||
int code_length = code.Length;
|
||||
List<string> words = new List<string>();
|
||||
for (int i = 0; i < code_length; i++)
|
||||
{
|
||||
int colorIndex = random.Next(colorArray.Length);
|
||||
int fontIndex = random.Next(fontFiles.Length);
|
||||
Font f = LoadFont(fontFiles[fontIndex], 15, FontStyle.Regular);
|
||||
Brush b = new SolidBrush(colorArray[colorIndex]);
|
||||
int _y = random.Next(height);
|
||||
if (_y > (height - 30))
|
||||
_y = _y - 60;
|
||||
|
||||
int _x = width / (i + 1);
|
||||
if ((width - _x) < 50)
|
||||
{
|
||||
_x = width - 60;
|
||||
}
|
||||
string word = code.Substring(i, 1);
|
||||
if (rtnResult.repData.point.Count < rightCodeLength)
|
||||
{
|
||||
// (int, int) percentPos = ToPercentPos((width, height), (_x, _y));
|
||||
// 添加正确答案 位置数据
|
||||
rtnResult.repData.point.Add(new PointPosModel()
|
||||
{
|
||||
X = _x, //percentPos.Item1,
|
||||
Y = _y //percentPos.Item2,
|
||||
});
|
||||
words.Add(word);
|
||||
}
|
||||
g.DrawString(word, f, b, _x, _y);
|
||||
}
|
||||
rtnResult.repData.wordList = words;
|
||||
|
||||
ms = new MemoryStream();
|
||||
bitmap.Save(ms, ImageFormat.Jpeg);
|
||||
g.Dispose();
|
||||
bitmap.Dispose();
|
||||
ms.Dispose();
|
||||
rtnResult.repData.originalImageBase64 = Convert.ToBase64String(ms.GetBuffer()); //"data:image/jpg;base64," +
|
||||
rtnResult.repData.token = IDGenerator.NextId().ToString();
|
||||
|
||||
// 缓存验证码正确位置集合
|
||||
var cacheOptions = new MemoryCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(30));
|
||||
_memoryCache.Set(CommonConst.CACHE_KEY_CODE + rtnResult.repData.token, rtnResult.repData.point, cacheOptions);
|
||||
|
||||
rtnResult.repData.point = null; // 清空位置信息
|
||||
return rtnResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 转换为相对于图片的百分比单位
|
||||
/// </summary>
|
||||
/// <param name="widthAndHeight">图片宽高</param>
|
||||
/// <param name="xAndy">相对于图片的绝对尺寸</param>
|
||||
/// <returns>(int:xPercent, int:yPercent)</returns>
|
||||
private (int, int) ToPercentPos((int, int) widthAndHeight, (int, int) xAndy)
|
||||
{
|
||||
(int, int) rtnResult = (0, 0);
|
||||
// 注意: int / int = int (小数部分会被截断)
|
||||
rtnResult.Item1 = (int)(((double)xAndy.Item1) / ((double)widthAndHeight.Item1) * 100);
|
||||
rtnResult.Item2 = (int)(((double)xAndy.Item2) / ((double)widthAndHeight.Item2) * 100);
|
||||
|
||||
return rtnResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载字体
|
||||
/// </summary>
|
||||
/// <param name="path">字体文件路径,包含字体文件名和后缀名</param>
|
||||
/// <param name="size">大小</param>
|
||||
/// <param name="fontStyle">字形(常规/粗体/斜体/粗斜体)</param>
|
||||
private Font LoadFont(string path, int size, FontStyle fontStyle)
|
||||
{
|
||||
var pfc = new System.Drawing.Text.PrivateFontCollection();
|
||||
pfc.AddFontFile(path);// 字体文件路径
|
||||
Font myFont = new Font(pfc.Families[0], size, fontStyle);
|
||||
return myFont;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 随机绘制字符串
|
||||
/// </summary>
|
||||
/// <param name="number"></param>
|
||||
/// <returns></returns>
|
||||
public string RandomCode(int number)
|
||||
{
|
||||
var str = "左怀军天地玄黄宇宙洪荒日月盈昃辰宿列张寒来暑往秋收冬藏闰余成岁律吕调阳云腾致雨露结为霜金生丽水玉出昆冈剑号巨阙珠称夜光果珍李柰菜重芥姜海咸河淡鳞潜羽翔龙师火帝鸟官人皇始制文字乃服衣裳推位让国有虞陶唐吊民伐罪周发殷汤坐朝问道垂拱平章爱育黎首臣伏戎羌遐迩体率宾归王";
|
||||
char[] str_char_arrary = str.ToArray();
|
||||
Random rand = new Random();
|
||||
HashSet<string> hs = new HashSet<string>();
|
||||
bool randomBool = true;
|
||||
while (randomBool)
|
||||
{
|
||||
if (hs.Count == number)
|
||||
break;
|
||||
int rand_number = rand.Next(str_char_arrary.Length);
|
||||
hs.Add(str_char_arrary[rand_number].ToString());
|
||||
}
|
||||
return string.Join("", hs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证码验证
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public dynamic CheckCode(ClickWordCaptchaInput input)
|
||||
{
|
||||
var res = new ClickWordCaptchaResult();
|
||||
|
||||
var rightVCodePos = _memoryCache.Get(CommonConst.CACHE_KEY_CODE + input.Token) as List<PointPosModel>;
|
||||
if (rightVCodePos == null)
|
||||
{
|
||||
res.repCode = "6110";
|
||||
res.repMsg = "验证码已失效,请重新获取";
|
||||
return res;
|
||||
}
|
||||
|
||||
var userVCodePos = JSON.GetJsonSerializer().Deserialize<List<PointPosModel>>(input.PointJson);
|
||||
if (userVCodePos == null || userVCodePos.Count < rightVCodePos.Count)
|
||||
{
|
||||
res.repCode = "6111";
|
||||
res.repMsg = "验证码无效";
|
||||
return res;
|
||||
}
|
||||
|
||||
int allowOffset = 20; // 允许的偏移量(点触容错)
|
||||
for (int i = 0; i < userVCodePos.Count; i++)
|
||||
{
|
||||
var xOffset = userVCodePos[i].X - rightVCodePos[i].X;
|
||||
var yOffset = userVCodePos[i].Y - rightVCodePos[i].Y;
|
||||
xOffset = Math.Abs(xOffset); // x轴偏移量
|
||||
yOffset = Math.Abs(yOffset); // y轴偏移量
|
||||
// 只要有一个点的任意一个轴偏移量大于allowOffset,则验证不通过
|
||||
if (xOffset > allowOffset || yOffset > allowOffset)
|
||||
{
|
||||
res.repCode = "6112";
|
||||
res.repMsg = "验证码错误";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
_memoryCache.Remove(CommonConst.CACHE_KEY_CODE + input.Token);
|
||||
res.repCode = "0000";
|
||||
res.repMsg = "验证成功";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 记录正确位置
|
||||
/// </summary>
|
||||
public class PointPosModel
|
||||
{
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
}
|
||||
}
|
||||
29
Api/Ewide.Core/Captcha/ClickWord/ClickWordCaptchaInput.cs
Normal file
29
Api/Ewide.Core/Captcha/ClickWord/ClickWordCaptchaInput.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Furion.DependencyInjection;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 点击验证码输入参数
|
||||
/// </summary>
|
||||
[SkipScan]
|
||||
public class ClickWordCaptchaInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 验证码类型
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "验证码类型")]
|
||||
public string CaptchaType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 坐标点集合
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "坐标点集合不能为空")]
|
||||
public string PointJson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Token
|
||||
/// </summary>
|
||||
public string Token { get; set; }
|
||||
}
|
||||
}
|
||||
44
Api/Ewide.Core/Captcha/ClickWord/ClickWordCaptchaResult.cs
Normal file
44
Api/Ewide.Core/Captcha/ClickWord/ClickWordCaptchaResult.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using Furion.DependencyInjection;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 验证码输出参数
|
||||
/// </summary>
|
||||
[SkipScan]
|
||||
public class ClickWordCaptchaResult
|
||||
{
|
||||
public string repCode { get; set; } = "0000";
|
||||
public string repMsg { get; set; }
|
||||
public RepData repData { get; set; } = new RepData();
|
||||
public bool error { get; set; }
|
||||
public bool success { get; set; } = true;
|
||||
}
|
||||
|
||||
[SkipScan]
|
||||
public class RepData
|
||||
{
|
||||
public string captchaId { get; set; }
|
||||
public string projectCode { get; set; }
|
||||
public string captchaType { get; set; }
|
||||
public string captchaOriginalPath { get; set; }
|
||||
public string captchaFontType { get; set; }
|
||||
public string captchaFontSize { get; set; }
|
||||
public string secretKey { get; set; }
|
||||
public string originalImageBase64 { get; set; }
|
||||
public List<PointPosModel> point { get; set; } = new List<PointPosModel>();
|
||||
public string jigsawImageBase64 { get; set; }
|
||||
public List<string> wordList { get; set; } = new List<string>();
|
||||
public string pointList { get; set; }
|
||||
public string pointJson { get; set; }
|
||||
public string token { get; set; }
|
||||
public bool result { get; set; }
|
||||
public string captchaVerification { get; set; }
|
||||
}
|
||||
|
||||
[SkipScan]
|
||||
public class WordList
|
||||
{
|
||||
}
|
||||
}
|
||||
9
Api/Ewide.Core/Captcha/ClickWord/IClickWordCaptcha.cs
Normal file
9
Api/Ewide.Core/Captcha/ClickWord/IClickWordCaptcha.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Ewide.Core
|
||||
{
|
||||
public interface IClickWordCaptcha
|
||||
{
|
||||
dynamic CheckCode(ClickWordCaptchaInput input);
|
||||
ClickWordCaptchaResult CreateCaptchaImage(string code, int width, int height);
|
||||
string RandomCode(int number);
|
||||
}
|
||||
}
|
||||
130
Api/Ewide.Core/Captcha/General/GeneralCaptcha.cs
Normal file
130
Api/Ewide.Core/Captcha/General/GeneralCaptcha.cs
Normal file
@@ -0,0 +1,130 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 常规验证码
|
||||
/// </summary>
|
||||
public class GeneralCaptcha : IGeneralCaptcha, ITransient
|
||||
{
|
||||
private readonly IMemoryCache _memoryCache;
|
||||
|
||||
public GeneralCaptcha(IMemoryCache memoryCache)
|
||||
{
|
||||
_memoryCache = memoryCache;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成验证码图片
|
||||
/// </summary>
|
||||
/// <param name="length"></param>
|
||||
/// <returns></returns>
|
||||
public string CreateCaptchaImage(int length = 4)
|
||||
{
|
||||
return Convert.ToBase64String(Draw(length));
|
||||
}
|
||||
|
||||
private string GenerateRandom(int length)
|
||||
{
|
||||
var chars = new StringBuilder();
|
||||
// 验证码的字符集,去掉了一些容易混淆的字符
|
||||
char[] character = { '2', '3', '4', '5', '6', '8', '9', 'a', 'b', 'd', 'e', 'f', 'h', 'k', 'm', 'n', 'r', 'x', 'y', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'R', 'S', 'T', 'W', 'X', 'Y' };
|
||||
Random rnd = new Random();
|
||||
// 生成验证码字符串
|
||||
for (int i = 0; i < length; i++)
|
||||
{
|
||||
chars.Append(character[rnd.Next(character.Length)]);
|
||||
}
|
||||
return chars.ToString();
|
||||
}
|
||||
|
||||
private byte[] Draw(int length = 4)
|
||||
{
|
||||
int codeW = 110;
|
||||
int codeH = 36;
|
||||
int fontSize = 22;
|
||||
|
||||
// 颜色列表,用于验证码、噪线、噪点
|
||||
Color[] color = { Color.Black, Color.Red, Color.Blue, Color.Green, Color.Orange, Color.Brown, Color.Brown, Color.DarkBlue };
|
||||
// 字体列表,用于验证码
|
||||
string[] fonts = new[] { "Times New Roman", "Verdana", "Arial", "Gungsuh", "Impact" };
|
||||
|
||||
var code = GenerateRandom(length); // 随机字符串集合
|
||||
|
||||
using (Bitmap bmp = new Bitmap(codeW, codeH))
|
||||
using (Graphics g = Graphics.FromImage(bmp))
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
g.Clear(Color.White);
|
||||
Random rnd = new Random();
|
||||
// 画噪线
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
int x1 = rnd.Next(codeW);
|
||||
int y1 = rnd.Next(codeH);
|
||||
int x2 = rnd.Next(codeW);
|
||||
int y2 = rnd.Next(codeH);
|
||||
var clr = color[rnd.Next(color.Length)];
|
||||
g.DrawLine(new Pen(clr), x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
// 画验证码字符串
|
||||
string fnt;
|
||||
Font ft;
|
||||
for (int i = 0; i < code.Length; i++)
|
||||
{
|
||||
fnt = fonts[rnd.Next(fonts.Length)];
|
||||
ft = new Font(fnt, fontSize);
|
||||
var clr = color[rnd.Next(color.Length)];
|
||||
g.DrawString(code[i].ToString(), ft, new SolidBrush(clr), (float)i * 24 + 2, (float)0);
|
||||
}
|
||||
|
||||
// 缓存验证码正确集合
|
||||
var cacheOptions = new MemoryCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromSeconds(30));
|
||||
_memoryCache.Set(CommonConst.CACHE_KEY_CODE + Guid.NewGuid().ToString("N"), code, cacheOptions);
|
||||
|
||||
// 将验证码图片写入内存流
|
||||
bmp.Save(ms, ImageFormat.Png);
|
||||
return ms.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证码验证
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public dynamic CheckCode(GeneralCaptchaInput input)
|
||||
{
|
||||
var res = new ClickWordCaptchaResult();
|
||||
|
||||
var code = _memoryCache.Get(CommonConst.CACHE_KEY_CODE + input.Token);
|
||||
if (code == null)
|
||||
{
|
||||
res.repCode = "6110";
|
||||
res.repMsg = "验证码已失效,请重新获取";
|
||||
return res;
|
||||
}
|
||||
if (input.CaptchaCode != (string)code)
|
||||
{
|
||||
res.repCode = "6112";
|
||||
res.repMsg = "验证码错误";
|
||||
return res;
|
||||
}
|
||||
|
||||
_memoryCache.Remove(CommonConst.CACHE_KEY_CODE + input.Token);
|
||||
res.repCode = "0000";
|
||||
res.repMsg = "验证成功";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
29
Api/Ewide.Core/Captcha/General/GeneralCaptchaInput.cs
Normal file
29
Api/Ewide.Core/Captcha/General/GeneralCaptchaInput.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Furion.DependencyInjection;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 常规验证码输入
|
||||
/// </summary>
|
||||
[SkipScan]
|
||||
public class GeneralCaptchaInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 验证码类型
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "验证码类型")]
|
||||
public string CaptchaType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 验证码字符
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "验证码字符不能为空")]
|
||||
public string CaptchaCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Token
|
||||
/// </summary>
|
||||
public string Token { get; set; }
|
||||
}
|
||||
}
|
||||
8
Api/Ewide.Core/Captcha/General/IGeneralCaptcha.cs
Normal file
8
Api/Ewide.Core/Captcha/General/IGeneralCaptcha.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Ewide.Core
|
||||
{
|
||||
public interface IGeneralCaptcha
|
||||
{
|
||||
dynamic CheckCode(GeneralCaptchaInput input);
|
||||
string CreateCaptchaImage(int length = 4);
|
||||
}
|
||||
}
|
||||
26
Api/Ewide.Core/Const/ClaimConst.cs
Normal file
26
Api/Ewide.Core/Const/ClaimConst.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace Ewide.Core
|
||||
{
|
||||
public class ClaimConst
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
public const string CLAINM_USERID = "UserId";
|
||||
|
||||
/// <summary>
|
||||
/// 账号
|
||||
/// </summary>
|
||||
public const string CLAINM_ACCOUNT = "Account";
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public const string CLAINM_NAME = "Name";
|
||||
|
||||
/// <summary>
|
||||
/// 是否超级管理
|
||||
/// </summary>
|
||||
public const string CLAINM_SUPERADMIN = "SuperAdmin";
|
||||
|
||||
}
|
||||
}
|
||||
35
Api/Ewide.Core/Const/CommonConst.cs
Normal file
35
Api/Ewide.Core/Const/CommonConst.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
namespace Ewide.Core
|
||||
{
|
||||
public class CommonConst
|
||||
{
|
||||
/// <summary>
|
||||
/// 默认密码
|
||||
/// </summary>
|
||||
public const string DEFAULT_PASSWORD = "123456";
|
||||
|
||||
/// <summary>
|
||||
/// 用户缓存
|
||||
/// </summary>
|
||||
public const string CACHE_KEY_USER = "user_";
|
||||
|
||||
/// <summary>
|
||||
/// 菜单缓存
|
||||
/// </summary>
|
||||
public const string CACHE_KEY_MENU = "menu_";
|
||||
|
||||
/// <summary>
|
||||
/// 权限缓存
|
||||
/// </summary>
|
||||
public const string CACHE_KEY_PERMISSION = "permission_";
|
||||
|
||||
/// <summary>
|
||||
/// 数据范围缓存
|
||||
/// </summary>
|
||||
public const string CACHE_KEY_DATASCOPE = "datascope_";
|
||||
|
||||
/// <summary>
|
||||
/// 验证码缓存
|
||||
/// </summary>
|
||||
public const string CACHE_KEY_CODE = "vercode_";
|
||||
}
|
||||
}
|
||||
49
Api/Ewide.Core/Dilon.Core.csproj
Normal file
49
Api/Ewide.Core/Dilon.Core.csproj
Normal file
@@ -0,0 +1,49 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<NoWarn>1701;1702;1591</NoWarn>
|
||||
<DocumentationFile>Dilon.Core.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="OAuth\Wechat1\**" />
|
||||
<EmbeddedResource Remove="OAuth\Wechat1\**" />
|
||||
<None Remove="OAuth\Wechat1\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="OAuth\AuthorizeResult.cs" />
|
||||
<Compile Remove="OAuth\IUserInfoModel.cs" />
|
||||
<Compile Remove="OAuth\OAuthLoginBase.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Dilon.Core.xml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CSRedisCore" Version="3.6.6" />
|
||||
<PackageReference Include="Furion" Version="1.19.2" />
|
||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="1.19.2" />
|
||||
<PackageReference Include="Furion.Extras.Logging.Serilog" Version="1.19.2" />
|
||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="1.19.2" />
|
||||
<PackageReference Include="Quartz" Version="3.3.2" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="5.0.0" />
|
||||
<PackageReference Include="UAParser" Version="3.1.46" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Service\CodeGen\Dto\TableOutput.cs">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="applicationconfig.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
6997
Api/Ewide.Core/Dilon.Core.xml
Normal file
6997
Api/Ewide.Core/Dilon.Core.xml
Normal file
File diff suppressed because it is too large
Load Diff
72
Api/Ewide.Core/Entity/DEntityBase.cs
Normal file
72
Api/Ewide.Core/Entity/DEntityBase.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义实体基类
|
||||
/// </summary>
|
||||
public abstract class DEntityBase : IEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键Id
|
||||
/// </summary>
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
[Comment("Id主键")]
|
||||
[Column("Id", TypeName = "varchar(36)")]
|
||||
public virtual string Id { get; set; } = Guid.NewGuid().ToString();
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[Comment("创建时间")]
|
||||
public virtual DateTimeOffset? CreatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[Comment("更新时间")]
|
||||
public virtual DateTimeOffset? UpdatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者Id
|
||||
/// </summary>
|
||||
[Comment("创建者Id")]
|
||||
[Column("CreatedUserId", TypeName = "varchar(36)")]
|
||||
public virtual string CreatedUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者名称
|
||||
/// </summary>
|
||||
[Comment("创建者名称")]
|
||||
[MaxLength(20)]
|
||||
public virtual string CreatedUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者Id
|
||||
/// </summary>
|
||||
[Comment("修改者Id")]
|
||||
[Column("UpdatedUserId", TypeName = "varchar(36)")]
|
||||
public virtual string UpdatedUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改者名称
|
||||
/// </summary>
|
||||
[Comment("修改者名称")]
|
||||
[MaxLength(20)]
|
||||
public virtual string UpdatedUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 软删除
|
||||
/// </summary>
|
||||
[JsonIgnore, FakeDelete(true)]
|
||||
[Comment("软删除标记")]
|
||||
[Column("IsDeleted", TypeName = "bit")]
|
||||
public virtual bool IsDeleted { get; set; } = false;
|
||||
}
|
||||
}
|
||||
57
Api/Ewide.Core/Entity/SysApp.cs
Normal file
57
Api/Ewide.Core/Entity/SysApp.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统应用表
|
||||
/// </summary>
|
||||
[Table("sys_app")]
|
||||
[Comment("系统应用表")]
|
||||
public class SysApp : DEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[Comment("名称")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
[Comment("编码")]
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 图标
|
||||
/// </summary>
|
||||
[Comment("图标")]
|
||||
public string Icon { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 图标颜色
|
||||
/// </summary>
|
||||
[Comment("图标颜色")]
|
||||
public string Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否默认激活(Y-是,N-否),只能有一个系统默认激活
|
||||
/// 用户登录后默认展示此系统菜单
|
||||
/// </summary>
|
||||
[Comment("是否默认激活")]
|
||||
[Column("Active", TypeName = "bit")]
|
||||
public bool Active { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态(字典 0正常 1停用 2删除)
|
||||
/// </summary>
|
||||
[Comment("状态")]
|
||||
public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[Comment("排序")]
|
||||
public int Sort { get; set; }
|
||||
}
|
||||
}
|
||||
49
Api/Ewide.Core/Entity/SysCodeGen.cs
Normal file
49
Api/Ewide.Core/Entity/SysCodeGen.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成表
|
||||
/// </summary>
|
||||
[Table("sys_code_gen")]
|
||||
[Comment("代码生成表")]
|
||||
public class SysCodeGen : DEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 作者姓名
|
||||
/// </summary>
|
||||
[Comment("作者姓名")]
|
||||
public string AuthorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否移除表前缀
|
||||
/// </summary>
|
||||
[Comment("是否移除表前缀")]
|
||||
public string TablePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生成方式
|
||||
/// </summary>
|
||||
[Comment("生成方式")]
|
||||
public string GenerateType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库表名
|
||||
/// </summary>
|
||||
[Comment("数据库表名")]
|
||||
public string TableName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 命名空间
|
||||
/// </summary>
|
||||
[Comment("命名空间")]
|
||||
public string NameSpace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务名
|
||||
/// </summary>
|
||||
[Comment("业务名")]
|
||||
public string BusName { get; set; }
|
||||
}
|
||||
}
|
||||
104
Api/Ewide.Core/Entity/SysCodeGenConfig.cs
Normal file
104
Api/Ewide.Core/Entity/SysCodeGenConfig.cs
Normal file
@@ -0,0 +1,104 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成字段配置表
|
||||
/// </summary>
|
||||
[Table("sys_code_gen_config")]
|
||||
[Comment("代码生成字段配置表")]
|
||||
public class SysCodeGenConfig : DEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成主表ID
|
||||
/// </summary>
|
||||
[Comment("代码生成主表ID")]
|
||||
[Column("CodeGenId", TypeName = "varchar(36)")]
|
||||
public string CodeGenId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库字段名
|
||||
/// </summary>
|
||||
[Comment("数据库字段名")]
|
||||
public string ColumnName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 字段描述
|
||||
/// </summary>
|
||||
[Comment("字段描述")]
|
||||
public string ColumnComment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// .NET数据类型
|
||||
/// </summary>
|
||||
[Comment(".NET数据类型")]
|
||||
public string NetType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 作用类型(字典)
|
||||
/// </summary>
|
||||
[Comment("作用类型")]
|
||||
public string EffectType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 字典code
|
||||
/// </summary>
|
||||
[Comment("字典Code")]
|
||||
public string DictTypeCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 列表是否缩进(字典)
|
||||
/// </summary>
|
||||
[Comment("列表是否缩进")]
|
||||
public string WhetherRetract { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否必填(字典)
|
||||
/// </summary>
|
||||
[Comment("是否必填")]
|
||||
public string WhetherRequired { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否是查询条件
|
||||
/// </summary>
|
||||
[Comment("是否是查询条件")]
|
||||
public string QueryWhether { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询方式
|
||||
/// </summary>
|
||||
[Comment("查询方式")]
|
||||
public string QueryType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 列表显示
|
||||
/// </summary>
|
||||
[Comment("列表显示")]
|
||||
public string WhetherTable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 增改
|
||||
/// </summary>
|
||||
[Comment("增改")]
|
||||
public string WhetherAddUpdate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主外键
|
||||
/// </summary>
|
||||
[Comment("主外键")]
|
||||
public string ColumnKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库中类型(物理类型)
|
||||
/// </summary>
|
||||
[Comment("数据库中类型")]
|
||||
public string DataType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否通用字段
|
||||
/// </summary>
|
||||
[Comment("是否通用字段")]
|
||||
public string WhetherCommon { get; set; }
|
||||
}
|
||||
}
|
||||
73
Api/Ewide.Core/Entity/SysConfig.cs
Normal file
73
Api/Ewide.Core/Entity/SysConfig.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
using Dilon.Core.Service;
|
||||
using Furion;
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 参数配置表
|
||||
/// </summary>
|
||||
[Table("sys_config")]
|
||||
[Comment("参数配置表")]
|
||||
public class SysConfig : DEntityBase, IEntityChangedListener<SysConfig>
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[Comment("名称")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
[Comment("编码")]
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 属性值
|
||||
/// </summary>
|
||||
[Comment("属性值")]
|
||||
public string Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否是系统参数(Y-是,N-否)
|
||||
/// </summary>
|
||||
[Comment("是否是系统参数")]
|
||||
public string SysFlag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[Comment("备注")]
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态(字典 0正常 1停用 2删除)
|
||||
/// </summary>
|
||||
[Comment("状态")]
|
||||
public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
|
||||
|
||||
/// <summary>
|
||||
/// 常量所属分类的编码,来自于“常量的分类”字典
|
||||
/// </summary>
|
||||
[Comment("常量所属分类的编码")]
|
||||
public string GroupCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 监听实体更改之后
|
||||
/// </summary>
|
||||
/// <param name="newEntity"></param>
|
||||
/// <param name="oldEntity"></param>
|
||||
/// <param name="dbContext"></param>
|
||||
/// <param name="dbContextLocator"></param>
|
||||
/// <param name="state"></param>
|
||||
public void OnChanged(SysConfig newEntity, SysConfig oldEntity, DbContext dbContext, Type dbContextLocator, EntityState state)
|
||||
{
|
||||
// 刷新配置缓存
|
||||
App.GetService<ISysConfigService>().UpdateConfigCache(newEntity.Code, newEntity.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
55
Api/Ewide.Core/Entity/SysDictData.cs
Normal file
55
Api/Ewide.Core/Entity/SysDictData.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 字典值表
|
||||
/// </summary>
|
||||
[Table("sys_dict_data")]
|
||||
[Comment("字典值表")]
|
||||
public class SysDictData : DEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 字典类型Id
|
||||
/// </summary>
|
||||
[Comment("字典类型Id")]
|
||||
[Column("TypeId", TypeName = "varchar(36)")]
|
||||
public string TypeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 值
|
||||
/// </summary>
|
||||
[Comment("值")]
|
||||
public string Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
[Comment("编码")]
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[Comment("排序")]
|
||||
public int Sort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[Comment("备注")]
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态(字典 0正常 1停用 2删除)
|
||||
/// </summary>
|
||||
[Comment("状态")]
|
||||
public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
|
||||
|
||||
/// <summary>
|
||||
/// 所属类型
|
||||
/// </summary>
|
||||
public SysDictType SysDictType { get; set; }
|
||||
}
|
||||
}
|
||||
59
Api/Ewide.Core/Entity/SysDictType.cs
Normal file
59
Api/Ewide.Core/Entity/SysDictType.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 字典类型表
|
||||
/// </summary>
|
||||
[Table("sys_dict_type")]
|
||||
[Comment("字典类型表")]
|
||||
public class SysDictType : DEntityBase, IEntityTypeBuilder<SysDictType>
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[Comment("名称")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
[Comment("编码")]
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[Comment("排序")]
|
||||
public int Sort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[Comment("备注")]
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态(字典 0正常 1停用 2删除)
|
||||
/// </summary>
|
||||
[Comment("状态")]
|
||||
public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
|
||||
|
||||
/// <summary>
|
||||
/// 字典数据
|
||||
/// </summary>
|
||||
public ICollection<SysDictData> SysDictDatas { get; set; }
|
||||
|
||||
public void Configure(EntityTypeBuilder<SysDictType> entityBuilder, DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
entityBuilder.HasMany(x => x.SysDictDatas)
|
||||
.WithOne(x => x.SysDictType)
|
||||
.HasForeignKey(x => x.TypeId);
|
||||
}
|
||||
}
|
||||
}
|
||||
71
Api/Ewide.Core/Entity/SysEmp.cs
Normal file
71
Api/Ewide.Core/Entity/SysEmp.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 员工表
|
||||
/// </summary>
|
||||
[Table("sys_emp")]
|
||||
[Comment("员工表")]
|
||||
public class SysEmp : IEntity, IEntityTypeBuilder<SysEmp>
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
[Comment("用户Id")]
|
||||
[Column("Id", TypeName = "varchar(36)")]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工号
|
||||
/// </summary>
|
||||
[Comment("工号")]
|
||||
public string JobNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机构Id
|
||||
/// </summary>
|
||||
[Comment("机构Id")]
|
||||
[Column("OrgId", TypeName = "varchar(36)")]
|
||||
public string OrgId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机构名称
|
||||
/// </summary>
|
||||
[Comment("机构名称")]
|
||||
public string OrgName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多对多(职位)
|
||||
/// </summary>
|
||||
public ICollection<SysPos> SysPos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多对多中间表(员工-职位)
|
||||
/// </summary>
|
||||
public List<SysEmpPos> SysEmpPos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多对多配置关系
|
||||
/// </summary>
|
||||
/// <param name="entityBuilder"></param>
|
||||
/// <param name="dbContext"></param>
|
||||
/// <param name="dbContextLocator"></param>
|
||||
public void Configure(EntityTypeBuilder<SysEmp> entityBuilder, DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
entityBuilder.HasMany(p => p.SysPos).WithMany(p => p.SysEmps).UsingEntity<SysEmpPos>(
|
||||
u => u.HasOne(c => c.SysPos).WithMany(c => c.SysEmpPos).HasForeignKey(c => c.SysPosId),
|
||||
u => u.HasOne(c => c.SysEmp).WithMany(c => c.SysEmpPos).HasForeignKey(c => c.SysEmpId),
|
||||
u =>
|
||||
{
|
||||
u.HasKey(c => new { c.SysEmpId, c.SysPosId });
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
70
Api/Ewide.Core/Entity/SysEmpExtOrgPos.cs
Normal file
70
Api/Ewide.Core/Entity/SysEmpExtOrgPos.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 员工附属机构职位表
|
||||
/// </summary>
|
||||
[Table("sys_emp_ext_org_pos")]
|
||||
[Comment("员工附属机构职位表")]
|
||||
public class SysEmpExtOrgPos : IEntity, IEntityTypeBuilder<SysEmpExtOrgPos>, IEntitySeedData<SysEmpExtOrgPos>
|
||||
{
|
||||
/// <summary>
|
||||
/// 员工Id
|
||||
/// </summary>
|
||||
[Comment("员工Id")]
|
||||
[Column("SysEmpId", TypeName = "varchar(36)")]
|
||||
public string SysEmpId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 一对一引用(员工)
|
||||
/// </summary>
|
||||
public SysEmp SysEmp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机构Id
|
||||
/// </summary>
|
||||
[Comment("机构Id")]
|
||||
[Column("SysOrgId", TypeName = "varchar(36)")]
|
||||
public string SysOrgId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 一对一引用(机构)
|
||||
/// </summary>
|
||||
public SysOrg SysOrg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 职位Id
|
||||
/// </summary>
|
||||
[Comment("职位Id")]
|
||||
[Column("SysPosId", TypeName = "varchar(36)")]
|
||||
public string SysPosId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 一对一引用(职位)
|
||||
/// </summary>
|
||||
public SysPos SysPos { get; set; }
|
||||
|
||||
public void Configure(EntityTypeBuilder<SysEmpExtOrgPos> entityBuilder, DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
entityBuilder.HasKey(c => new { c.SysEmpId, c.SysOrgId, c.SysPosId });
|
||||
}
|
||||
|
||||
public IEnumerable<SysEmpExtOrgPos> HasData(DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new SysEmpExtOrgPos { SysEmpId = "d0ead3dc-5096-4e15-bc6d-f640be5301ec", SysOrgId = "12d888de-f55d-4c88-b0a0-7c3510664d97", SysPosId = "269236c4-d74e-4e54-9d50-f6f61580a197" },
|
||||
new SysEmpExtOrgPos { SysEmpId = "d0ead3dc-5096-4e15-bc6d-f640be5301ec", SysOrgId = "8a2271d6-5bda-4544-bdd3-27e53a8b418e", SysPosId = "46c68a62-f119-4ff7-b621-0bbd77504538" },
|
||||
new SysEmpExtOrgPos { SysEmpId = "d0ead3dc-5096-4e15-bc6d-f640be5301ec", SysOrgId = "127c0a5d-43ac-4370-b313-082361885aca", SysPosId = "5bd8c466-2bca-4386-a551-daac78e3cee8" },
|
||||
new SysEmpExtOrgPos { SysEmpId = "d0ead3dc-5096-4e15-bc6d-f640be5301ec", SysOrgId = "f236ab2d-e1b5-4e9d-844f-a59ec32c20e4", SysPosId = "d89a3afe-e6ba-4018-bdae-3c98bb47ad66" },
|
||||
new SysEmpExtOrgPos { SysEmpId = "16a74726-e156-499f-9942-0e0e24ad0c3f", SysOrgId = "f236ab2d-e1b5-4e9d-844f-a59ec32c20e4", SysPosId = "269236c4-d74e-4e54-9d50-f6f61580a197" }
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Api/Ewide.Core/Entity/SysEmpPos.cs
Normal file
38
Api/Ewide.Core/Entity/SysEmpPos.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 员工职位表
|
||||
/// </summary>
|
||||
[Table("sys_emp_pos")]
|
||||
[Comment("员工职位表")]
|
||||
public class SysEmpPos : IEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 员工Id
|
||||
/// </summary>
|
||||
[Comment("员工Id")]
|
||||
[Column("SysEmpId", TypeName = "varchar(36)")]
|
||||
public string SysEmpId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 一对一引用(员工)
|
||||
/// </summary>
|
||||
public SysEmp SysEmp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 职位Id
|
||||
/// </summary>
|
||||
[Comment("职位Id")]
|
||||
[Column("SysPosId", TypeName = "varchar(36)")]
|
||||
public string SysPosId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 一对一引用(职位)
|
||||
/// </summary>
|
||||
public SysPos SysPos { get; set; }
|
||||
}
|
||||
}
|
||||
61
Api/Ewide.Core/Entity/SysFile.cs
Normal file
61
Api/Ewide.Core/Entity/SysFile.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件信息表
|
||||
/// </summary>
|
||||
[Table("sys_file")]
|
||||
[Comment("文件信息表")]
|
||||
public class SysFile : DEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件存储位置(1:阿里云,2:腾讯云,3:minio,4:本地)
|
||||
/// </summary>
|
||||
[Comment("文件存储位置")]
|
||||
public int FileLocation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件仓库
|
||||
/// </summary>
|
||||
[Comment("文件仓库")]
|
||||
public string FileBucket { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件名称(上传时候的文件名)
|
||||
/// </summary>
|
||||
[Comment("文件名称")]
|
||||
public string FileOriginName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件后缀
|
||||
/// </summary>
|
||||
[Comment("文件后缀")]
|
||||
public string FileSuffix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件大小kb
|
||||
/// </summary>
|
||||
[Comment("文件大小kb")]
|
||||
public long FileSizeKb { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件大小信息,计算后的
|
||||
/// </summary>
|
||||
[Comment("文件大小信息")]
|
||||
public string FileSizeInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 存储到bucket的名称(文件唯一标识id)
|
||||
/// </summary>
|
||||
[Comment("存储到bucket的名称")]
|
||||
public string FileObjectName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 存储路径
|
||||
/// </summary>
|
||||
[Comment("存储路径")]
|
||||
public string FilePath { get; set; }
|
||||
}
|
||||
}
|
||||
64
Api/Ewide.Core/Entity/SysLogAudit.cs
Normal file
64
Api/Ewide.Core/Entity/SysLogAudit.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统操作/审计日志表
|
||||
/// </summary>
|
||||
[Table("sys_log_audit")]
|
||||
[Comment("审计日志表")]
|
||||
public class SysLogAudit : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 表名
|
||||
/// </summary>
|
||||
[Comment("表名")]
|
||||
public string TableName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 列名
|
||||
/// </summary>
|
||||
[Comment("列名")]
|
||||
public string ColumnName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 新值
|
||||
/// </summary>
|
||||
[Comment("新值")]
|
||||
public string NewValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 旧值
|
||||
/// </summary>
|
||||
[Comment("旧值")]
|
||||
public string OldValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作时间
|
||||
/// </summary>
|
||||
[Comment("操作时间")]
|
||||
public DateTimeOffset CreatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作人Id
|
||||
/// </summary>
|
||||
[Comment("操作人Id")]
|
||||
[Column("UserId", TypeName = "varchar(36)")]
|
||||
public string UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作人名称
|
||||
/// </summary>
|
||||
[Comment("操作人名称")]
|
||||
public string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作方式:新增、更新、删除
|
||||
/// </summary>
|
||||
[Comment("操作方式")]
|
||||
public string Operate { get; set; }
|
||||
}
|
||||
}
|
||||
117
Api/Ewide.Core/Entity/SysLogOp.cs
Normal file
117
Api/Ewide.Core/Entity/SysLogOp.cs
Normal file
@@ -0,0 +1,117 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 操作日志表
|
||||
/// </summary>
|
||||
[Table("sys_log_op")]
|
||||
[Comment("操作日志表")]
|
||||
public class SysLogOp : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[Comment("名称")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作类型(0其他 1增加 2删除 3编辑)(见LogAnnotionOpTypeEnum)
|
||||
/// </summary>
|
||||
[Comment("操作类型")]
|
||||
public int? OpType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否执行成功(Y-是,N-否)
|
||||
/// </summary>
|
||||
[Comment("是否执行成功")]
|
||||
public string Success { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 具体消息
|
||||
/// </summary>
|
||||
[Comment("具体消息")]
|
||||
public string Message { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// IP
|
||||
/// </summary>
|
||||
[Comment("IP")]
|
||||
public string Ip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
[Comment("地址")]
|
||||
public string Location { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 浏览器
|
||||
/// </summary>
|
||||
[Comment("浏览器")]
|
||||
public string Browser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作系统
|
||||
/// </summary>
|
||||
[Comment("操作系统")]
|
||||
public string Os { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求地址
|
||||
/// </summary>
|
||||
[Comment("请求地址")]
|
||||
public string Url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类名称
|
||||
/// </summary>
|
||||
[Comment("类名称")]
|
||||
public string ClassName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 方法名称
|
||||
/// </summary>
|
||||
[Comment("方法名称")]
|
||||
public string MethodName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求方式(GET POST PUT DELETE)
|
||||
/// </summary>
|
||||
[Comment("请求方式")]
|
||||
public string ReqMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求参数
|
||||
/// </summary>
|
||||
[Comment("请求参数")]
|
||||
public string Param { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回结果
|
||||
/// </summary>
|
||||
[Comment("返回结果")]
|
||||
public string Result { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 耗时(毫秒)
|
||||
/// </summary>
|
||||
[Comment("耗时")]
|
||||
public long ElapsedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作时间
|
||||
/// </summary>
|
||||
[Comment("操作时间")]
|
||||
public DateTimeOffset OpTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作人
|
||||
/// </summary>
|
||||
[Comment("操作人")]
|
||||
public string Account { get; set; }
|
||||
}
|
||||
}
|
||||
75
Api/Ewide.Core/Entity/SysLogVis.cs
Normal file
75
Api/Ewide.Core/Entity/SysLogVis.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 访问日志表
|
||||
/// </summary>
|
||||
[Table("sys_log_vis")]
|
||||
[Comment("访问日志表")]
|
||||
public class SysLogVis : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[Comment("名称")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否执行成功(Y-是,N-否)
|
||||
/// </summary>
|
||||
[Comment("是否执行成功")]
|
||||
public string Success { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 具体消息
|
||||
/// </summary>
|
||||
[Comment("具体消息")]
|
||||
public string Message { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// IP
|
||||
/// </summary>
|
||||
[Comment("IP")]
|
||||
public string Ip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
[Comment("地址")]
|
||||
public string Location { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 浏览器
|
||||
/// </summary>
|
||||
[Comment("浏览器")]
|
||||
public string Browser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作系统
|
||||
/// </summary>
|
||||
[Comment("操作系统")]
|
||||
public string Os { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访问类型(字典 1登入 2登出)
|
||||
/// </summary>
|
||||
[Comment("访问类型")]
|
||||
public int? VisType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访问时间
|
||||
/// </summary>
|
||||
[Comment("访问时间")]
|
||||
public DateTimeOffset VisTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访问人
|
||||
/// </summary>
|
||||
[Comment("访问人")]
|
||||
public string Account { get; set; }
|
||||
}
|
||||
}
|
||||
133
Api/Ewide.Core/Entity/SysMenu.cs
Normal file
133
Api/Ewide.Core/Entity/SysMenu.cs
Normal file
@@ -0,0 +1,133 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 菜单表
|
||||
/// </summary>
|
||||
[Table("sys_menu")]
|
||||
[Comment("菜单表")]
|
||||
public class SysMenu : DEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 父Id
|
||||
/// </summary>
|
||||
[Comment("父Id")]
|
||||
[Column("Pid", TypeName = "varchar(36)")]
|
||||
public string Pid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父Ids
|
||||
/// </summary>
|
||||
[Comment("父Ids")]
|
||||
public string Pids { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[Comment("名称")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
[Comment("编码")]
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单类型(字典 0目录 1菜单 2按钮)
|
||||
/// </summary>
|
||||
[Comment("菜单类型")]
|
||||
public int Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 图标
|
||||
/// </summary>
|
||||
[Comment("图标")]
|
||||
public string Icon { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 路由地址
|
||||
/// </summary>
|
||||
[Comment("路由地址")]
|
||||
public string Router { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组件地址
|
||||
/// </summary>
|
||||
[Comment("组件地址")]
|
||||
public string Component { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 权限标识
|
||||
/// </summary>
|
||||
[Comment("权限标识")]
|
||||
public string Permission { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 应用分类(应用编码)
|
||||
/// </summary>
|
||||
[Comment("应用分类")]
|
||||
public string Application { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 打开方式(字典 0无 1组件 2内链 3外链)
|
||||
/// </summary>
|
||||
[Comment("打开方式")]
|
||||
public int OpenType { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 是否可见(Y-是,N-否)
|
||||
/// </summary>
|
||||
[Comment("是否可见")]
|
||||
[Column("Visible", TypeName = "bit")]
|
||||
public bool Visible { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 内链地址
|
||||
/// </summary>
|
||||
[Comment("内链地址")]
|
||||
public string Link { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 重定向地址
|
||||
/// </summary>
|
||||
[Comment("重定向地址")]
|
||||
public string Redirect { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 权重(字典 1系统权重 2业务权重)
|
||||
/// </summary>
|
||||
[Comment("权重")]
|
||||
public int Weight { get; set; } = 2;
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[Comment("排序")]
|
||||
public int Sort { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[Comment("备注")]
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态(字典 0正常 1停用 2删除)
|
||||
/// </summary>
|
||||
public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
|
||||
|
||||
/// <summary>
|
||||
/// 多对多(角色)
|
||||
/// </summary>
|
||||
public ICollection<SysRole> SysRoles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多对多中间表(用户角色)
|
||||
/// </summary>
|
||||
public List<SysRoleMenu> SysRoleMenus { get; set; }
|
||||
}
|
||||
}
|
||||
76
Api/Ewide.Core/Entity/SysNotice.cs
Normal file
76
Api/Ewide.Core/Entity/SysNotice.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 通知公告表
|
||||
/// </summary>
|
||||
[Table("sys_notice")]
|
||||
[Comment("通知公告表")]
|
||||
public class SysNotice : DEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[Comment("标题")]
|
||||
public string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 内容
|
||||
/// </summary>
|
||||
[Comment("内容")]
|
||||
public string Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类型(字典 1通知 2公告)
|
||||
/// </summary>
|
||||
[Comment("类型")]
|
||||
public int Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发布人Id
|
||||
/// </summary>
|
||||
[Comment("发布人Id")]
|
||||
[Column("PublicUserId", TypeName = "varchar(36)")]
|
||||
public string PublicUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发布人姓名
|
||||
/// </summary>
|
||||
[Comment("发布人姓名")]
|
||||
public string PublicUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发布机构Id
|
||||
/// </summary>
|
||||
[Comment("发布机构Id")]
|
||||
[Column("PublicOrgId", TypeName = "varchar(36)")]
|
||||
public string PublicOrgId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发布机构名称
|
||||
/// </summary>
|
||||
[Comment("发布机构名称")]
|
||||
public string PublicOrgName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发布时间
|
||||
/// </summary>
|
||||
[Comment("发布时间")]
|
||||
public DateTimeOffset PublicTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 撤回时间
|
||||
/// </summary>
|
||||
[Comment("撤回时间")]
|
||||
public DateTimeOffset CancelTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态(字典 0草稿 1发布 2撤回 3删除)
|
||||
/// </summary>
|
||||
[Comment("状态")]
|
||||
public int Status { get; set; }
|
||||
}
|
||||
}
|
||||
47
Api/Ewide.Core/Entity/SysNoticeUser.cs
Normal file
47
Api/Ewide.Core/Entity/SysNoticeUser.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 通知公告用户表
|
||||
/// </summary>
|
||||
[Table("sys_notice_user")]
|
||||
[Comment("通知公告用户表")]
|
||||
public class SysNoticeUser : IEntity, IEntityTypeBuilder<SysNoticeUser>
|
||||
{
|
||||
/// <summary>
|
||||
/// 通知公告Id
|
||||
/// </summary>
|
||||
[Comment("通知公告Id")]
|
||||
[Column("NoticeId", TypeName = "varchar(36)")]
|
||||
public string NoticeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
[Comment("用户Id")]
|
||||
[Column("UserId", TypeName = "varchar(36)")]
|
||||
public string UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 阅读时间
|
||||
/// </summary>
|
||||
[Comment("阅读时间")]
|
||||
public DateTimeOffset ReadTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态(字典 0未读 1已读)
|
||||
/// </summary>
|
||||
[Comment("状态")]
|
||||
public int ReadStatus { get; set; }
|
||||
|
||||
public void Configure(EntityTypeBuilder<SysNoticeUser> entityBuilder, DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
entityBuilder.HasNoKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
85
Api/Ewide.Core/Entity/SysOauthUser.cs
Normal file
85
Api/Ewide.Core/Entity/SysOauthUser.cs
Normal file
@@ -0,0 +1,85 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Oauth登录用户表
|
||||
/// </summary>
|
||||
[Table("sys_oauth_user")]
|
||||
[Comment("Oauth登录用户表")]
|
||||
public class SysOauthUser : DEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 第三方平台的用户唯一Id
|
||||
/// </summary>
|
||||
[Comment("UUID")]
|
||||
public string Uuid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户授权的token
|
||||
/// </summary>
|
||||
[Comment("Token")]
|
||||
public string AccessToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 昵称
|
||||
/// </summary>
|
||||
[Comment("昵称")]
|
||||
public string NickName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 头像
|
||||
/// </summary>
|
||||
[Comment("头像")]
|
||||
public string Avatar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 性别
|
||||
/// </summary>
|
||||
[Comment("性别")]
|
||||
public string Gender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电话
|
||||
/// </summary>
|
||||
[Comment("电话")]
|
||||
public string Phone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱
|
||||
/// </summary>
|
||||
[Comment("邮箱")]
|
||||
public string Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 位置
|
||||
/// </summary>
|
||||
[Comment("位置")]
|
||||
public string Location { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户网址
|
||||
/// </summary>
|
||||
[Comment("用户网址")]
|
||||
public string Blog { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所在公司
|
||||
/// </summary>
|
||||
[Comment("所在公司")]
|
||||
public string Company { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户来源
|
||||
/// </summary>
|
||||
[Comment("用户来源")]
|
||||
public string Source { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户备注(各平台中的用户个人介绍)
|
||||
/// </summary>
|
||||
[Comment("备注")]
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
89
Api/Ewide.Core/Entity/SysOrg.cs
Normal file
89
Api/Ewide.Core/Entity/SysOrg.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 组织机构表
|
||||
/// </summary>
|
||||
[Table("sys_org")]
|
||||
[Comment("组织机构表")]
|
||||
public class SysOrg : DEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 父Id
|
||||
/// </summary>
|
||||
[Comment("父Id")]
|
||||
[Column("Pid", TypeName = "varchar(36)")]
|
||||
public string Pid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父Ids
|
||||
/// </summary>
|
||||
[Comment("Pids")]
|
||||
public string Pids { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[Comment("名称")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
[Comment("编码")]
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 联系人
|
||||
/// </summary>
|
||||
[Comment("联系人")]
|
||||
public string Contacts { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电话
|
||||
/// </summary>
|
||||
[Comment("电话")]
|
||||
public string Tel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[Comment("排序")]
|
||||
public int Sort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[Comment("备注")]
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态(字典 0正常 1停用 2删除)
|
||||
/// </summary>
|
||||
[Comment("状态")]
|
||||
public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
|
||||
|
||||
/// <summary>
|
||||
/// 多对多(用户)
|
||||
/// </summary>
|
||||
public ICollection<SysUser> SysUsers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多对多中间表(用户数据范围)
|
||||
/// </summary>
|
||||
public List<SysUserDataScope> SysUserDataScopes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多对多(角色)
|
||||
/// </summary>
|
||||
public ICollection<SysRole> SysRoles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多对多中间表(角色数据范围)
|
||||
/// </summary>
|
||||
public List<SysRoleDataScope> SysRoleDataScopes { get; set; }
|
||||
}
|
||||
}
|
||||
54
Api/Ewide.Core/Entity/SysPos.cs
Normal file
54
Api/Ewide.Core/Entity/SysPos.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 职位表
|
||||
/// </summary>
|
||||
[Table("sys_pos")]
|
||||
[Comment("职位表")]
|
||||
public class SysPos : DEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[Comment("名称")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
[Comment("编码")]
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[Comment("排序")]
|
||||
public int Sort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[Comment("备注")]
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态(字典 0正常 1停用 2删除)
|
||||
/// </summary>
|
||||
[Comment("状态")]
|
||||
public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
|
||||
|
||||
/// <summary>
|
||||
/// 多对多(员工)
|
||||
/// </summary>
|
||||
public ICollection<SysEmp> SysEmps { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多对多中间表(员工职位)
|
||||
/// </summary>
|
||||
public List<SysEmpPos> SysEmpPos { get; set; }
|
||||
}
|
||||
}
|
||||
112
Api/Ewide.Core/Entity/SysRole.cs
Normal file
112
Api/Ewide.Core/Entity/SysRole.cs
Normal file
@@ -0,0 +1,112 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色表
|
||||
/// </summary>
|
||||
[Table("sys_role")]
|
||||
[Comment("角色表")]
|
||||
public class SysRole : DEntityBase, IEntityTypeBuilder<SysRole>
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[Comment("名称")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
[Comment("编码")]
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[Comment("排序")]
|
||||
public int Sort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据范围类型(字典 1全部数据 2本部门及以下数据 3本部门数据 4仅本人数据 5自定义数据)
|
||||
/// </summary>
|
||||
[Comment("数据范围类型")]
|
||||
public int DataScopeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[Comment("备注")]
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态(字典 0正常 1停用 2删除)
|
||||
/// </summary>
|
||||
[Comment("状态")]
|
||||
public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
|
||||
|
||||
/// <summary>
|
||||
/// 多对多(用户)
|
||||
/// </summary>
|
||||
public ICollection<SysUser> SysUsers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多对多中间表(用户角色)
|
||||
/// </summary>
|
||||
public List<SysUserRole> SysUserRoles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多对多(机构)
|
||||
/// </summary>
|
||||
public ICollection<SysOrg> SysOrgs { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多对多中间表(角色-机构 数据范围)
|
||||
/// </summary>
|
||||
public List<SysRoleDataScope> SysRoleDataScopes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多对多(菜单)
|
||||
/// </summary>
|
||||
public ICollection<SysMenu> SysMenus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多对多中间表(角色-菜单)
|
||||
/// </summary>
|
||||
public List<SysRoleMenu> SysRoleMenus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 配置多对多关系
|
||||
/// </summary>
|
||||
/// <param name="entityBuilder"></param>
|
||||
/// <param name="dbContext"></param>
|
||||
/// <param name="dbContextLocator"></param>
|
||||
public void Configure(EntityTypeBuilder<SysRole> entityBuilder, DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
entityBuilder.HasMany(p => p.SysOrgs)
|
||||
.WithMany(p => p.SysRoles)
|
||||
.UsingEntity<SysRoleDataScope>(
|
||||
u => u.HasOne(c => c.SysOrg).WithMany(c => c.SysRoleDataScopes).HasForeignKey(c => c.SysOrgId),
|
||||
u => u.HasOne(c => c.SysRole).WithMany(c => c.SysRoleDataScopes).HasForeignKey(c => c.SysRoleId),
|
||||
u =>
|
||||
{
|
||||
u.HasKey(c => new { c.SysRoleId, c.SysOrgId });
|
||||
});
|
||||
|
||||
entityBuilder.HasMany(p => p.SysMenus)
|
||||
.WithMany(p => p.SysRoles)
|
||||
.UsingEntity<SysRoleMenu>(
|
||||
u => u.HasOne(c => c.SysMenu).WithMany(c => c.SysRoleMenus).HasForeignKey(c => c.SysMenuId),
|
||||
u => u.HasOne(c => c.SysRole).WithMany(c => c.SysRoleMenus).HasForeignKey(c => c.SysRoleId),
|
||||
u =>
|
||||
{
|
||||
u.HasKey(c => new { c.SysRoleId, c.SysMenuId });
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Api/Ewide.Core/Entity/SysRoleDataScope.cs
Normal file
38
Api/Ewide.Core/Entity/SysRoleDataScope.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色数据范围表
|
||||
/// </summary>
|
||||
[Table("sys_role_data_scope")]
|
||||
[Comment("角色数据范围表")]
|
||||
public class SysRoleDataScope : IEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色Id
|
||||
/// </summary>
|
||||
[Comment("角色Id")]
|
||||
[Column("SysRoleId", TypeName = "varchar(36)")]
|
||||
public string SysRoleId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 一对一引用(系统角色)
|
||||
/// </summary>
|
||||
public SysRole SysRole { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机构Id
|
||||
/// </summary>
|
||||
[Comment("机构Id")]
|
||||
[Column("SysOrgId", TypeName = "varchar(36)")]
|
||||
public string SysOrgId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 一对一引用(系统机构)
|
||||
/// </summary>
|
||||
public SysOrg SysOrg { get; set; }
|
||||
}
|
||||
}
|
||||
38
Api/Ewide.Core/Entity/SysRoleMenu.cs
Normal file
38
Api/Ewide.Core/Entity/SysRoleMenu.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色菜单表
|
||||
/// </summary>
|
||||
[Table("sys_role_menu")]
|
||||
[Comment("角色菜单表")]
|
||||
public class SysRoleMenu : IEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色Id
|
||||
/// </summary>
|
||||
[Comment("角色Id")]
|
||||
[Column("SysRoleId", TypeName = "varchar(36)")]
|
||||
public string SysRoleId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 一对一引用(系统用户)
|
||||
/// </summary>
|
||||
public SysRole SysRole { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单Id
|
||||
/// </summary>
|
||||
[Comment("菜单Id")]
|
||||
[Column("SysMenuId", TypeName = "varchar(36)")]
|
||||
public string SysMenuId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 一对一引用(系统菜单)
|
||||
/// </summary>
|
||||
public SysMenu SysMenu { get; set; }
|
||||
}
|
||||
}
|
||||
56
Api/Ewide.Core/Entity/SysTenant.cs
Normal file
56
Api/Ewide.Core/Entity/SysTenant.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 租户表
|
||||
/// </summary>
|
||||
[Table("sys_tenant")]
|
||||
[Comment("租户表")]
|
||||
public class SysTenant : DEntityBase, IEntity<MultiTenantDbContextLocator>
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[Comment("名称")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主机
|
||||
/// </summary>
|
||||
[Comment("主机")]
|
||||
public string Host { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电子邮箱
|
||||
/// </summary>
|
||||
[Comment("电子邮箱")]
|
||||
public string Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电话
|
||||
/// </summary>
|
||||
[Comment("电话")]
|
||||
public string Phone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库连接
|
||||
/// </summary>
|
||||
[Comment("数据库连接")]
|
||||
public string Connection { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 架构
|
||||
/// </summary>
|
||||
[Comment("架构")]
|
||||
public string Schema { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[Comment("备注")]
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
101
Api/Ewide.Core/Entity/SysTimer.cs
Normal file
101
Api/Ewide.Core/Entity/SysTimer.cs
Normal file
@@ -0,0 +1,101 @@
|
||||
using Dilon.Core.Service;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 定时任务
|
||||
/// </summary>
|
||||
[Table("sys_timer")]
|
||||
[Comment("定时任务表")]
|
||||
public class SysTimer : DEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务名称
|
||||
/// </summary>
|
||||
/// <example>dilon</example>
|
||||
[Comment("任务名称")]
|
||||
public string JobName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务分组
|
||||
/// </summary>
|
||||
/// <example>dilon</example>
|
||||
[Comment("任务分组")]
|
||||
public string JobGroup { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
[Comment("开始时间")]
|
||||
public DateTimeOffset BeginTime { get; set; } = DateTimeOffset.Now;
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
/// <example>null</example>
|
||||
[Comment("结束时间")]
|
||||
public DateTimeOffset? EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Cron表达式
|
||||
/// </summary>
|
||||
/// <example></example>
|
||||
[Comment("Cron表达式")]
|
||||
public string Cron { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 执行次数(默认无限循环)
|
||||
/// </summary>
|
||||
/// <example>10</example>
|
||||
[Comment("执行次数")]
|
||||
public int? RunNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 执行间隔时间,单位秒(如果有Cron,则IntervalSecond失效)
|
||||
/// </summary>
|
||||
/// <example>5</example>
|
||||
[Comment("执行间隔时间")]
|
||||
public int? Interval { get; set; } = 5;
|
||||
|
||||
/// <summary>
|
||||
/// 触发器类型
|
||||
/// </summary>
|
||||
[Comment("触发器类型")]
|
||||
public TriggerTypeEnum TriggerType { get; set; } = TriggerTypeEnum.Simple;
|
||||
|
||||
/// <summary>
|
||||
/// 请求url
|
||||
/// </summary>
|
||||
[Comment("请求url")]
|
||||
public string RequestUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求参数(Post,Put请求用)
|
||||
/// </summary>
|
||||
[Comment("请求参数")]
|
||||
public string RequestParameters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Headers(可以包含如:Authorization授权认证)
|
||||
/// 格式:{"Authorization":"userpassword.."}
|
||||
/// </summary>
|
||||
[Comment("Headers")]
|
||||
public string Headers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求类型
|
||||
/// </summary>
|
||||
/// <example>2</example>
|
||||
[Comment("请求类型")]
|
||||
public RequestTypeEnum RequestType { get; set; } = RequestTypeEnum.Post;
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[Comment("备注")]
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
155
Api/Ewide.Core/Entity/SysUser.cs
Normal file
155
Api/Ewide.Core/Entity/SysUser.cs
Normal file
@@ -0,0 +1,155 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户表
|
||||
/// </summary>
|
||||
[Table("sys_user")]
|
||||
[Comment("用户表")]
|
||||
public class SysUser : DEntityBase, IEntityTypeBuilder<SysUser>
|
||||
{
|
||||
/// <summary>
|
||||
/// 账号
|
||||
/// </summary>
|
||||
[Comment("账号")]
|
||||
[Required, MaxLength(20)]
|
||||
public string Account { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 密码(采用MD5加密)
|
||||
/// </summary>
|
||||
[Comment("密码")]
|
||||
[Required]
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 昵称
|
||||
/// </summary>
|
||||
[Comment("昵称")]
|
||||
[MaxLength(20)]
|
||||
public string NickName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 姓名
|
||||
/// </summary>
|
||||
[Comment("姓名")]
|
||||
[MaxLength(20)]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 头像
|
||||
/// </summary>
|
||||
[Comment("头像")]
|
||||
public string Avatar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生日
|
||||
/// </summary>
|
||||
[Comment("生日")]
|
||||
public DateTimeOffset Birthday { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 性别-男_1、女_2
|
||||
/// </summary>
|
||||
[Comment("性别-男_1、女_2")]
|
||||
public int Sex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱
|
||||
/// </summary>
|
||||
[Comment("邮箱")]
|
||||
[MaxLength(30)]
|
||||
public string Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机
|
||||
/// </summary>
|
||||
[Comment("手机")]
|
||||
[MaxLength(30)]
|
||||
public string Phone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电话
|
||||
/// </summary>
|
||||
[Comment("电话")]
|
||||
[MaxLength(30)]
|
||||
public string Tel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后登录IP
|
||||
/// </summary>
|
||||
[Comment("最后登录IP")]
|
||||
[MaxLength(30)]
|
||||
public string LastLoginIp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后登录时间
|
||||
/// </summary>
|
||||
[Comment("最后登录时间")]
|
||||
public DateTimeOffset LastLoginTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管理员类型-超级管理员_1、非管理员_2
|
||||
/// </summary>
|
||||
[Comment("管理员类型-超级管理员_1、非管理员_2")]
|
||||
public AdminType AdminType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态-正常_0、停用_1、删除_2
|
||||
/// </summary>
|
||||
[Comment("状态-正常_0、停用_1、删除_2")]
|
||||
public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
|
||||
|
||||
/// <summary>
|
||||
/// 多对多(角色)
|
||||
/// </summary>
|
||||
public ICollection<SysRole> SysRoles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多对多中间表(用户-角色)
|
||||
/// </summary>
|
||||
public List<SysUserRole> SysUserRoles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多对多(机构)
|
||||
/// </summary>
|
||||
public ICollection<SysOrg> SysOrgs { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多对多中间表(用户-机构 数据范围)
|
||||
/// </summary>
|
||||
public List<SysUserDataScope> SysUserDataScopes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 配置多对多关系
|
||||
/// </summary>
|
||||
/// <param name="entityBuilder"></param>
|
||||
/// <param name="dbContext"></param>
|
||||
/// <param name="dbContextLocator"></param>
|
||||
public void Configure(EntityTypeBuilder<SysUser> entityBuilder, DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
entityBuilder.HasMany(p => p.SysRoles).WithMany(p => p.SysUsers).UsingEntity<SysUserRole>(
|
||||
u => u.HasOne(c => c.SysRole).WithMany(c => c.SysUserRoles).HasForeignKey(c => c.SysRoleId),
|
||||
u => u.HasOne(c => c.SysUser).WithMany(c => c.SysUserRoles).HasForeignKey(c => c.SysUserId),
|
||||
u =>
|
||||
{
|
||||
u.HasKey(c => new { c.SysUserId, c.SysRoleId });
|
||||
});
|
||||
|
||||
entityBuilder.HasMany(p => p.SysOrgs).WithMany(p => p.SysUsers).UsingEntity<SysUserDataScope>(
|
||||
u => u.HasOne(c => c.SysOrg).WithMany(c => c.SysUserDataScopes).HasForeignKey(c => c.SysOrgId),
|
||||
u => u.HasOne(c => c.SysUser).WithMany(c => c.SysUserDataScopes).HasForeignKey(c => c.SysUserId),
|
||||
u =>
|
||||
{
|
||||
u.HasKey(c => new { c.SysUserId, c.SysOrgId });
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Api/Ewide.Core/Entity/SysUserDataScope.cs
Normal file
38
Api/Ewide.Core/Entity/SysUserDataScope.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户数据范围表
|
||||
/// </summary>
|
||||
[Table("sys_user_data_scope")]
|
||||
[Comment("用户数据范围表")]
|
||||
public class SysUserDataScope : IEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
[Comment("用户Id")]
|
||||
[Column("SysUserId", TypeName = "varchar(36)")]
|
||||
public string SysUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 一对一引用(系统用户)
|
||||
/// </summary>
|
||||
public SysUser SysUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机构Id
|
||||
/// </summary>
|
||||
[Comment("机构Id")]
|
||||
[Column("SysOrgId", TypeName = "varchar(36)")]
|
||||
public string SysOrgId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 一对一引用(系统机构)
|
||||
/// </summary>
|
||||
public SysOrg SysOrg { get; set; }
|
||||
}
|
||||
}
|
||||
38
Api/Ewide.Core/Entity/SysUserRole.cs
Normal file
38
Api/Ewide.Core/Entity/SysUserRole.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户角色表
|
||||
/// </summary>
|
||||
[Table("sys_user_role")]
|
||||
[Comment("用户角色表")]
|
||||
public class SysUserRole : IEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
[Comment("用户Id")]
|
||||
[Column("SysUserId", TypeName = "varchar(36)")]
|
||||
public string SysUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 一对一引用(系统用户)
|
||||
/// </summary>
|
||||
public SysUser SysUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 系统角色Id
|
||||
/// </summary>
|
||||
[Comment("角色Id")]
|
||||
[Column("SysRoleId", TypeName = "varchar(36)")]
|
||||
public string SysRoleId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 一对一引用(系统角色)
|
||||
/// </summary>
|
||||
public SysRole SysRole { get; set; }
|
||||
}
|
||||
}
|
||||
22
Api/Ewide.Core/Enum/AdminType.cs
Normal file
22
Api/Ewide.Core/Enum/AdminType.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 账号类型
|
||||
/// </summary>
|
||||
public enum AdminType
|
||||
{
|
||||
/// <summary>
|
||||
/// 超级管理员
|
||||
/// </summary>
|
||||
[Description("超级管理员")]
|
||||
SuperAdmin = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 非管理员
|
||||
/// </summary>
|
||||
[Description("非管理员")]
|
||||
None = 2
|
||||
}
|
||||
}
|
||||
28
Api/Ewide.Core/Enum/CommonStatus.cs
Normal file
28
Api/Ewide.Core/Enum/CommonStatus.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 公共状态
|
||||
/// </summary>
|
||||
public enum CommonStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// 正常
|
||||
/// </summary>
|
||||
[Description("正常")]
|
||||
ENABLE = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 停用
|
||||
/// </summary>
|
||||
[Description("停用")]
|
||||
DISABLE = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
[Description("删除")]
|
||||
DELETED = 2
|
||||
}
|
||||
}
|
||||
37
Api/Ewide.Core/Enum/DataScopeType.cs
Normal file
37
Api/Ewide.Core/Enum/DataScopeType.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
public enum DataScopeType
|
||||
{
|
||||
/// <summary>
|
||||
/// 全部数据
|
||||
/// </summary>
|
||||
[Description("全部数据")]
|
||||
ALL = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 本部门及以下数据
|
||||
/// </summary>
|
||||
[Description("本部门及以下数据")]
|
||||
DEPT_WITH_CHILD = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 本部门数据
|
||||
/// </summary>
|
||||
[Description("本部门数据")]
|
||||
DEPT = 3,
|
||||
|
||||
/// <summary>
|
||||
/// 仅本人数据
|
||||
/// </summary>
|
||||
[Description("仅本人数据")]
|
||||
SELF = 4,
|
||||
|
||||
/// <summary>
|
||||
/// 自定义数据
|
||||
/// </summary>
|
||||
[Description("自定义数据")]
|
||||
DEFINE = 5
|
||||
}
|
||||
}
|
||||
360
Api/Ewide.Core/Enum/ErrorCode.cs
Normal file
360
Api/Ewide.Core/Enum/ErrorCode.cs
Normal file
@@ -0,0 +1,360 @@
|
||||
using Furion.FriendlyException;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统错误码
|
||||
/// </summary>
|
||||
[ErrorCodeType]
|
||||
public enum ErrorCode
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户名或密码不正确
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("用户名或密码不正确")]
|
||||
D1000,
|
||||
|
||||
/// <summary>
|
||||
/// 非法操作!禁止删除自己
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("非法操作,禁止删除自己")]
|
||||
D1001,
|
||||
|
||||
/// <summary>
|
||||
/// 记录不存在
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("记录不存在")]
|
||||
D1002,
|
||||
|
||||
/// <summary>
|
||||
/// 账号已存在
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("账号已存在")]
|
||||
D1003,
|
||||
|
||||
/// <summary>
|
||||
/// 旧密码不匹配
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("旧密码输入错误")]
|
||||
D1004,
|
||||
|
||||
/// <summary>
|
||||
/// 测试数据禁止更改admin密码
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("测试数据禁止更改用户【admin】密码")]
|
||||
D1005,
|
||||
|
||||
/// <summary>
|
||||
/// 数据已存在
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("数据已存在")]
|
||||
D1006,
|
||||
|
||||
/// <summary>
|
||||
/// 数据不存在或含有关联引用,禁止删除
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("数据不存在或含有关联引用,禁止删除")]
|
||||
D1007,
|
||||
|
||||
/// <summary>
|
||||
/// 禁止为管理员分配角色
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("禁止为管理员分配角色")]
|
||||
D1008,
|
||||
|
||||
/// <summary>
|
||||
/// 重复数据或记录含有不存在数据
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("重复数据或记录含有不存在数据")]
|
||||
D1009,
|
||||
|
||||
/// <summary>
|
||||
/// 禁止为超级管理员角色分配权限
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("禁止为超级管理员角色分配权限")]
|
||||
D1010,
|
||||
|
||||
/// <summary>
|
||||
/// 非法数据
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("非法数据")]
|
||||
D1011,
|
||||
|
||||
/// <summary>
|
||||
/// Id不能为空
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("Id不能为空")]
|
||||
D1012,
|
||||
|
||||
/// <summary>
|
||||
/// 所属机构不在自己的数据范围内
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("没有权限操作该数据")]
|
||||
D1013,
|
||||
|
||||
/// <summary>
|
||||
/// 禁止删除超级管理员
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("禁止删除超级管理员")]
|
||||
D1014,
|
||||
|
||||
/// <summary>
|
||||
/// 禁止修改超级管理员状态
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("禁止修改超级管理员状态")]
|
||||
D1015,
|
||||
|
||||
/// <summary>
|
||||
/// 没有权限
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("没有权限")]
|
||||
D1016,
|
||||
|
||||
/// <summary>
|
||||
/// 账号已冻结
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("账号已冻结")]
|
||||
D1017,
|
||||
|
||||
/// <summary>
|
||||
/// 父机构不存在
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("父机构不存在")]
|
||||
D2000,
|
||||
|
||||
/// <summary>
|
||||
/// 当前机构Id不能与父机构Id相同
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("当前机构Id不能与父机构Id相同")]
|
||||
D2001,
|
||||
|
||||
/// <summary>
|
||||
/// 已有相同组织机构,编码或名称相同
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("已有相同组织机构,编码或名称相同")]
|
||||
D2002,
|
||||
|
||||
/// <summary>
|
||||
/// 没有权限操作机构
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("没有权限操作机构")]
|
||||
D2003,
|
||||
|
||||
/// <summary>
|
||||
/// 该机构下有员工禁止删除
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("该机构下有员工禁止删除")]
|
||||
D2004,
|
||||
|
||||
/// <summary>
|
||||
/// 附属机构下有员工禁止删除
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("附属机构下有员工禁止删除")]
|
||||
D2005,
|
||||
|
||||
/// <summary>
|
||||
/// 字典类型不存在
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("字典类型不存在")]
|
||||
D3000,
|
||||
|
||||
/// <summary>
|
||||
/// 字典类型已存在
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("字典类型已存在,名称或编码重复")]
|
||||
D3001,
|
||||
|
||||
/// <summary>
|
||||
/// 字典类型下面有字典值禁止删除
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("字典类型下面有字典值禁止删除")]
|
||||
D3002,
|
||||
|
||||
/// <summary>
|
||||
/// 字典值已存在
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("字典值已存在,名称或编码重复")]
|
||||
D3003,
|
||||
|
||||
/// <summary>
|
||||
/// 字典值不存在
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("字典值不存在")]
|
||||
D3004,
|
||||
|
||||
/// <summary>
|
||||
/// 字典状态错误
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("字典状态错误")]
|
||||
D3005,
|
||||
|
||||
/// <summary>
|
||||
/// 菜单已存在
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("菜单已存在")]
|
||||
D4000,
|
||||
|
||||
/// <summary>
|
||||
/// 路由地址为空
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("路由地址为空")]
|
||||
D4001,
|
||||
|
||||
/// <summary>
|
||||
/// 打开方式为空
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("打开方式为空")]
|
||||
D4002,
|
||||
|
||||
/// <summary>
|
||||
/// 权限标识格式为空
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("权限标识格式为空")]
|
||||
D4003,
|
||||
|
||||
/// <summary>
|
||||
/// 权限标识格式错误
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("权限标识格式错误")]
|
||||
D4004,
|
||||
|
||||
/// <summary>
|
||||
/// 权限不存在
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("权限不存在")]
|
||||
D4005,
|
||||
|
||||
/// <summary>
|
||||
/// 父级菜单不能为当前节点,请重新选择父级菜单
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("父级菜单不能为当前节点,请重新选择父级菜单")]
|
||||
D4006,
|
||||
|
||||
/// <summary>
|
||||
/// 不能移动根节点
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("不能移动根节点")]
|
||||
D4007,
|
||||
|
||||
/// <summary>
|
||||
/// 已存在同名或同编码应用
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("已存在同名或同编码应用")]
|
||||
D5000,
|
||||
|
||||
/// <summary>
|
||||
/// 默认激活系统只能有一个
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("默认激活系统只能有一个")]
|
||||
D5001,
|
||||
|
||||
/// <summary>
|
||||
/// 该应用下有菜单禁止删除
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("该应用下有菜单禁止删除")]
|
||||
D5002,
|
||||
|
||||
/// <summary>
|
||||
/// 已存在同名或同编码应用
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("已存在同名或同编码应用")]
|
||||
D5003,
|
||||
|
||||
/// <summary>
|
||||
/// 已存在同名或同编码职位
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("已存在同名或同编码职位")]
|
||||
D6000,
|
||||
|
||||
/// <summary>
|
||||
/// 该职位下有员工禁止删除
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("该职位下有员工禁止删除")]
|
||||
D6001,
|
||||
|
||||
/// <summary>
|
||||
/// 通知公告状态错误
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("通知公告状态错误")]
|
||||
D7000,
|
||||
|
||||
/// <summary>
|
||||
/// 通知公告删除失败
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("通知公告删除失败")]
|
||||
D7001,
|
||||
|
||||
/// <summary>
|
||||
/// 通知公告编辑失败
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("通知公告编辑失败,类型必须为草稿")]
|
||||
D7002,
|
||||
|
||||
/// <summary>
|
||||
/// 文件不存在
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("文件不存在")]
|
||||
D8000,
|
||||
|
||||
/// <summary>
|
||||
/// 已存在同名或同编码参数配置
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("已存在同名或同编码参数配置")]
|
||||
D9000,
|
||||
|
||||
/// <summary>
|
||||
/// 禁止删除系统参数
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("禁止删除系统参数")]
|
||||
D9001,
|
||||
|
||||
/// <summary>
|
||||
/// 已存在同名任务调度
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("已存在同名任务调度")]
|
||||
D1100,
|
||||
|
||||
/// <summary>
|
||||
/// 任务调度不存在
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("任务调度不存在")]
|
||||
D1101,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 演示环境禁止修改数据
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("演示环境禁止修改数据")]
|
||||
D1200,
|
||||
|
||||
/// <summary>
|
||||
/// 已存在同名或同主机租户
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("已存在同名或同主机租户")]
|
||||
D1300,
|
||||
|
||||
/// <summary>
|
||||
/// 该表代码模板已经生成过
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("该表代码模板已经生成过")]
|
||||
D1400,
|
||||
|
||||
/// <summary>
|
||||
/// 已存在同名或同编码项目
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("已存在同名或同编码项目")]
|
||||
xg1000,
|
||||
|
||||
/// <summary>
|
||||
/// 已存在相同证件号码人员
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("已存在相同证件号码人员")]
|
||||
xg1001,
|
||||
|
||||
/// <summary>
|
||||
/// 检测数据不存在
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("检测数据不存在")]
|
||||
xg1002,
|
||||
}
|
||||
}
|
||||
34
Api/Ewide.Core/Enum/FileLocation.cs
Normal file
34
Api/Ewide.Core/Enum/FileLocation.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件存储位置
|
||||
/// </summary>
|
||||
public enum FileLocation
|
||||
{
|
||||
/// <summary>
|
||||
/// 阿里云
|
||||
/// </summary>
|
||||
[Description("阿里云")]
|
||||
ALIYUN = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 腾讯云
|
||||
/// </summary>
|
||||
[Description("腾讯云")]
|
||||
TENCENT = 2,
|
||||
|
||||
/// <summary>
|
||||
/// minio服务器
|
||||
/// </summary>
|
||||
[Description("minio服务器")]
|
||||
MINIO = 3,
|
||||
|
||||
/// <summary>
|
||||
/// 本地
|
||||
/// </summary>
|
||||
[Description("本地")]
|
||||
LOCAL = 4
|
||||
}
|
||||
}
|
||||
28
Api/Ewide.Core/Enum/Gender.cs
Normal file
28
Api/Ewide.Core/Enum/Gender.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 性别
|
||||
/// </summary>
|
||||
public enum Gender
|
||||
{
|
||||
/// <summary>
|
||||
/// 男
|
||||
/// </summary>
|
||||
[Description("男")]
|
||||
MALE = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 女
|
||||
/// </summary>
|
||||
[Description("女")]
|
||||
FEMALE = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 未知
|
||||
/// </summary>
|
||||
[Description("未知")]
|
||||
UNKNOWN = 3
|
||||
}
|
||||
}
|
||||
78
Api/Ewide.Core/Enum/LogOpType.cs
Normal file
78
Api/Ewide.Core/Enum/LogOpType.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志操作类型
|
||||
/// </summary>
|
||||
public enum LogOpType
|
||||
{
|
||||
/// <summary>
|
||||
/// 其它
|
||||
/// </summary>
|
||||
OTHER,
|
||||
|
||||
/// <summary>
|
||||
/// 增加
|
||||
/// </summary>
|
||||
ADD,
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
DELETE,
|
||||
|
||||
/// <summary>
|
||||
/// 编辑
|
||||
/// </summary>
|
||||
EDIT,
|
||||
|
||||
/// <summary>
|
||||
/// 更新
|
||||
/// </summary>
|
||||
UPDATE,
|
||||
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
QUERY,
|
||||
|
||||
/// <summary>
|
||||
/// 详情
|
||||
/// </summary>
|
||||
DETAIL,
|
||||
|
||||
/// <summary>
|
||||
/// 树
|
||||
/// </summary>
|
||||
TREE,
|
||||
|
||||
/// <summary>
|
||||
/// 导入
|
||||
/// </summary>
|
||||
IMPORT,
|
||||
|
||||
/// <summary>
|
||||
/// 导出
|
||||
/// </summary>
|
||||
EXPORT,
|
||||
|
||||
/// <summary>
|
||||
/// 授权
|
||||
/// </summary>
|
||||
GRANT,
|
||||
|
||||
/// <summary>
|
||||
/// 强退
|
||||
/// </summary>
|
||||
FORCE,
|
||||
|
||||
/// <summary>
|
||||
/// 清空
|
||||
/// </summary>
|
||||
CLEAN,
|
||||
|
||||
/// <summary>
|
||||
/// 修改状态
|
||||
/// </summary>
|
||||
CHANGE_STATUS
|
||||
}
|
||||
}
|
||||
34
Api/Ewide.Core/Enum/MenuOpenType.cs
Normal file
34
Api/Ewide.Core/Enum/MenuOpenType.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统菜单类型
|
||||
/// </summary>
|
||||
public enum MenuOpenType
|
||||
{
|
||||
/// <summary>
|
||||
/// 无
|
||||
/// </summary>
|
||||
[Description("无")]
|
||||
NONE = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 组件
|
||||
/// </summary>
|
||||
[Description("组件")]
|
||||
COMPONENT = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 内链
|
||||
/// </summary>
|
||||
[Description("内链")]
|
||||
INNER = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 外链
|
||||
/// </summary>
|
||||
[Description("外链")]
|
||||
OUTER = 3
|
||||
}
|
||||
}
|
||||
28
Api/Ewide.Core/Enum/MenuType.cs
Normal file
28
Api/Ewide.Core/Enum/MenuType.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统菜单类型
|
||||
/// </summary>
|
||||
public enum MenuType
|
||||
{
|
||||
/// <summary>
|
||||
/// 目录
|
||||
/// </summary>
|
||||
[Description("目录")]
|
||||
DIR = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 菜单
|
||||
/// </summary>
|
||||
[Description("菜单")]
|
||||
MENU = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 按钮
|
||||
/// </summary>
|
||||
[Description("按钮")]
|
||||
BTN = 2
|
||||
}
|
||||
}
|
||||
22
Api/Ewide.Core/Enum/MenuWeight.cs
Normal file
22
Api/Ewide.Core/Enum/MenuWeight.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 菜单权重
|
||||
/// </summary>
|
||||
public enum MenuWeight
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统权重
|
||||
/// </summary>
|
||||
[Description("系统权重")]
|
||||
SUPER_ADMIN_WEIGHT = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 业务权重
|
||||
/// </summary>
|
||||
[Description("业务权重")]
|
||||
DEFAULT_WEIGHT = 2
|
||||
}
|
||||
}
|
||||
34
Api/Ewide.Core/Enum/NoticeStatus.cs
Normal file
34
Api/Ewide.Core/Enum/NoticeStatus.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 通知公告状态
|
||||
/// </summary>
|
||||
public enum NoticeStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// 草稿
|
||||
/// </summary>
|
||||
[Description("草稿")]
|
||||
DRAFT = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 发布
|
||||
/// </summary>
|
||||
[Description("发布")]
|
||||
PUBLIC = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 撤回
|
||||
/// </summary>
|
||||
[Description("撤回")]
|
||||
CANCEL = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
[Description("删除")]
|
||||
DELETED = 3
|
||||
}
|
||||
}
|
||||
22
Api/Ewide.Core/Enum/NoticeUserStatus.cs
Normal file
22
Api/Ewide.Core/Enum/NoticeUserStatus.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 通知公告用户状态
|
||||
/// </summary>
|
||||
public enum NoticeUserStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// 未读
|
||||
/// </summary>
|
||||
[Description("未读")]
|
||||
UNREAD = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 已读
|
||||
/// </summary>
|
||||
[Description("已读")]
|
||||
READ = 1
|
||||
}
|
||||
}
|
||||
58
Api/Ewide.Core/Enum/QueryTypeEnum.cs
Normal file
58
Api/Ewide.Core/Enum/QueryTypeEnum.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询类型的枚举
|
||||
/// </summary>
|
||||
public enum QueryTypeEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// 等于
|
||||
/// </summary>
|
||||
[Description("等于")]
|
||||
eq = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 模糊
|
||||
/// </summary>
|
||||
[Description("模糊")]
|
||||
like = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 大于
|
||||
/// </summary>
|
||||
[Description("大于")]
|
||||
gt = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 小于
|
||||
/// </summary>
|
||||
[Description("小于")]
|
||||
lt = 3,
|
||||
|
||||
/// <summary>
|
||||
/// 不等于
|
||||
/// </summary>
|
||||
[Description("不等于")]
|
||||
ne = 4,
|
||||
|
||||
/// <summary>
|
||||
/// 大于等于
|
||||
/// </summary>
|
||||
[Description("大于等于")]
|
||||
ge = 5,
|
||||
|
||||
/// <summary>
|
||||
/// 小于等于
|
||||
/// </summary>
|
||||
[Description("小于等于")]
|
||||
le = 6,
|
||||
|
||||
/// <summary>
|
||||
/// 不为空
|
||||
/// </summary>
|
||||
[Description("不为空")]
|
||||
isNotNull = 7
|
||||
}
|
||||
}
|
||||
22
Api/Ewide.Core/Enum/YesOrNot.cs
Normal file
22
Api/Ewide.Core/Enum/YesOrNot.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 菜单激活类型
|
||||
/// </summary>
|
||||
public enum YesOrNot
|
||||
{
|
||||
/// <summary>
|
||||
/// 是
|
||||
/// </summary>
|
||||
[Description("是")]
|
||||
Y = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 否
|
||||
/// </summary>
|
||||
[Description("否")]
|
||||
N = 1
|
||||
}
|
||||
}
|
||||
49
Api/Ewide.Core/Extension/DictionaryExtensions.cs
Normal file
49
Api/Ewide.Core/Extension/DictionaryExtensions.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 字典扩展
|
||||
/// </summary>
|
||||
public static class DictionaryExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// 将一个字典转化为 QueryString
|
||||
/// </summary>
|
||||
/// <param name="dict"></param>
|
||||
/// <param name="urlEncode"></param>
|
||||
/// <returns></returns>
|
||||
public static string ToQueryString(this Dictionary<string, string> dict, bool urlEncode = true)
|
||||
{
|
||||
return string.Join("&", dict.Select(p => $"{(urlEncode ? p.Key?.UrlEncode() : "")}={(urlEncode ? p.Value?.UrlEncode() : "")}"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将一个字符串 URL 编码
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <returns></returns>
|
||||
public static string UrlEncode(this string str)
|
||||
{
|
||||
if (string.IsNullOrEmpty(str))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return System.Web.HttpUtility.UrlEncode(str, Encoding.UTF8);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 移除空值项
|
||||
/// </summary>
|
||||
/// <param name="dict"></param>
|
||||
public static void RemoveEmptyValueItems(this Dictionary<string, string> dict)
|
||||
{
|
||||
dict.Where(item => string.IsNullOrEmpty(item.Value)).Select(item => item.Key).ToList().ForEach(key =>
|
||||
{
|
||||
dict.Remove(key);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
56
Api/Ewide.Core/Extension/XnInputBase.cs
Normal file
56
Api/Ewide.Core/Extension/XnInputBase.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 通用输入扩展参数(带权限)
|
||||
/// </summary>
|
||||
public class XnInputBase : PageInputBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 授权菜单
|
||||
/// </summary>
|
||||
public List<string> GrantMenuIdList { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// 授权角色
|
||||
/// </summary>
|
||||
public virtual List<string> GrantRoleIdList { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// 授权数据
|
||||
/// </summary>
|
||||
public virtual List<string> GrantOrgIdList { get; set; } = new List<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通用分页输入参数
|
||||
/// </summary>
|
||||
public class PageInputBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 搜索值
|
||||
/// </summary>
|
||||
public virtual string SearchValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前页码
|
||||
/// </summary>
|
||||
public virtual int PageNo { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 页码容量
|
||||
/// </summary>
|
||||
public virtual int PageSize { get; set; } = 20;
|
||||
|
||||
/// <summary>
|
||||
/// 搜索开始时间
|
||||
/// </summary>
|
||||
public virtual string SearchBeginTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 搜索结束时间
|
||||
/// </summary>
|
||||
public virtual string SearchEndTime { get; set; }
|
||||
}
|
||||
}
|
||||
24
Api/Ewide.Core/Extension/XnPageResult.cs
Normal file
24
Api/Ewide.Core/Extension/XnPageResult.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 小诺分页列表结果
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public static class XnPageResult<T> where T : new()
|
||||
{
|
||||
public static dynamic PageResult(PagedList<T> page)
|
||||
{
|
||||
return new
|
||||
{
|
||||
PageNo = page.PageIndex,
|
||||
PageSize = page.PageSize,
|
||||
TotalPage = page.TotalPages,
|
||||
TotalRows = page.TotalCount,
|
||||
Rows = page.Items //.Adapt<List<T>>(),
|
||||
//Rainbow = PageUtil.Rainbow(page.PageIndex, page.TotalPages, PageUtil.RAINBOW_NUM)
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
166
Api/Ewide.Core/Extension/XnRestfulResultProvider.cs
Normal file
166
Api/Ewide.Core/Extension/XnRestfulResultProvider.cs
Normal file
@@ -0,0 +1,166 @@
|
||||
using Furion.DataValidation;
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.UnifyResult;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 规范化RESTful风格返回值
|
||||
/// </summary>
|
||||
[SkipScan, UnifyModel(typeof(XnRestfulResult<>))]
|
||||
public class XnRestfulResultProvider : IUnifyResultProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// 异常返回值
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <returns></returns>
|
||||
public IActionResult OnException(ExceptionContext context)
|
||||
{
|
||||
// 解析异常信息
|
||||
var (StatusCode, ErrorCode, Errors) = UnifyContext.GetExceptionMetadata(context);
|
||||
|
||||
return new JsonResult(new XnRestfulResult<object>
|
||||
{
|
||||
Code = StatusCode,
|
||||
Success = false,
|
||||
Data = null,
|
||||
Message = Errors,
|
||||
Extras = UnifyContext.Take(),
|
||||
Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理输出状态码
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <param name="statusCode"></param>
|
||||
/// <returns></returns>
|
||||
public async Task OnResponseStatusCodes(HttpContext context, int statusCode)
|
||||
{
|
||||
switch (statusCode)
|
||||
{
|
||||
// 处理 401 状态码
|
||||
case StatusCodes.Status401Unauthorized:
|
||||
await context.Response.WriteAsJsonAsync(new XnRestfulResult<object>
|
||||
{
|
||||
Code = StatusCodes.Status401Unauthorized,
|
||||
Success = false,
|
||||
Data = null,
|
||||
Message = "401 未经授权",
|
||||
Extras = UnifyContext.Take(),
|
||||
Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
|
||||
});
|
||||
break;
|
||||
// 处理 403 状态码
|
||||
case StatusCodes.Status403Forbidden:
|
||||
await context.Response.WriteAsJsonAsync(new XnRestfulResult<object>
|
||||
{
|
||||
Code = StatusCodes.Status403Forbidden,
|
||||
Success = false,
|
||||
Data = null,
|
||||
Message = "403 禁止访问",
|
||||
Extras = UnifyContext.Take(),
|
||||
Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
|
||||
});
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 成功返回值
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <returns></returns>
|
||||
public IActionResult OnSucceeded(ActionExecutedContext context)
|
||||
{
|
||||
object data;
|
||||
// 处理内容结果
|
||||
if (context.Result is ContentResult contentResult) data = contentResult.Content;
|
||||
// 处理对象结果
|
||||
else if (context.Result is ObjectResult objectResult) data = objectResult.Value;
|
||||
else if (context.Result is EmptyResult) data = null;
|
||||
else return null;
|
||||
|
||||
return new JsonResult(new XnRestfulResult<object>
|
||||
{
|
||||
Code = context.Result is EmptyResult ? StatusCodes.Status204NoContent : StatusCodes.Status200OK, // 处理没有返回值情况 204
|
||||
Success = true,
|
||||
Data = data,
|
||||
Message = "请求成功",
|
||||
Extras = UnifyContext.Take(),
|
||||
Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证失败返回值
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <param name="modelStates"></param>
|
||||
/// <param name="validationResults"></param>
|
||||
/// <param name="validateFailedMessage"></param>
|
||||
/// <returns></returns>
|
||||
public IActionResult OnValidateFailed(ActionExecutingContext context, ModelStateDictionary modelStates, IEnumerable<ValidateFailedModel> validationResults, string validateFailedMessage)
|
||||
{
|
||||
return new JsonResult(new XnRestfulResult<object>
|
||||
{
|
||||
Code = StatusCodes.Status400BadRequest,
|
||||
Success = false,
|
||||
Data = null,
|
||||
Message = validationResults,
|
||||
Extras = UnifyContext.Take(),
|
||||
Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RESTful风格---XIAONUO返回格式
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
[SkipScan]
|
||||
public class XnRestfulResult<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// 执行成功
|
||||
/// </summary>
|
||||
public bool Success { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态码
|
||||
/// </summary>
|
||||
public int? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 错误信息
|
||||
/// </summary>
|
||||
public object Message { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据
|
||||
/// </summary>
|
||||
public T Data { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 附加数据
|
||||
/// </summary>
|
||||
public object Extras { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 时间戳
|
||||
/// </summary>
|
||||
public long Timestamp { get; set; }
|
||||
}
|
||||
}
|
||||
24
Api/Ewide.Core/Filter/LogExceptionHandler.cs
Normal file
24
Api/Ewide.Core/Filter/LogExceptionHandler.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.FriendlyException;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Serilog;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 全局异常处理
|
||||
/// </summary>
|
||||
public class LogExceptionHandler : IGlobalExceptionHandler, ISingleton
|
||||
{
|
||||
public Task OnExceptionAsync(ExceptionContext context)
|
||||
{
|
||||
//context.Exception.ToString().LogError("错误");
|
||||
|
||||
// 写日志
|
||||
Log.Error(context.Exception.ToString());
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
60
Api/Ewide.Core/Filter/RequestActionFilter.cs
Normal file
60
Api/Ewide.Core/Filter/RequestActionFilter.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using Furion.DatabaseAccessor.Extensions;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc.Controllers;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Security.Claims;
|
||||
using System.Threading.Tasks;
|
||||
using UAParser;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 请求日志拦截
|
||||
/// </summary>
|
||||
public class RequestActionFilter : IAsyncActionFilter
|
||||
{
|
||||
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
|
||||
{
|
||||
var httpContext = context.HttpContext;
|
||||
var httpRequest = httpContext.Request;
|
||||
|
||||
var sw = new Stopwatch();
|
||||
sw.Start();
|
||||
|
||||
var actionContext = await next();
|
||||
sw.Stop();
|
||||
|
||||
// 判断是否请求成功(没有异常就是请求成功)
|
||||
var isRequestSucceed = actionContext.Exception == null;
|
||||
|
||||
var clent = Parser.GetDefault().Parse(httpContext.Request.Headers["User-Agent"]);
|
||||
var actionDescriptor = context.ActionDescriptor as ControllerActionDescriptor;
|
||||
var descAtt = Attribute.GetCustomAttribute(actionDescriptor.MethodInfo, typeof(DescriptionAttribute)) as DescriptionAttribute;
|
||||
|
||||
var sysOpLog = new SysLogOp
|
||||
{
|
||||
Name = descAtt != null ? descAtt.Description : actionDescriptor.ActionName,
|
||||
OpType = 1,
|
||||
Success = isRequestSucceed ? YesOrNot.Y.ToString() : YesOrNot.N.ToString(),
|
||||
//Message = isRequestSucceed ? "成功" : "失败",
|
||||
Ip = httpContext.GetRemoteIpAddressToIPv4(),
|
||||
Location = httpRequest.GetRequestUrlAddress(),
|
||||
Browser = clent.UA.Family + clent.UA.Major,
|
||||
Os = clent.OS.Family + clent.OS.Major,
|
||||
Url = httpRequest.Path,
|
||||
ClassName = context.Controller.ToString(),
|
||||
MethodName = actionDescriptor.ActionName,
|
||||
ReqMethod = httpRequest.Method,
|
||||
//Param = JsonSerializerUtility.Serialize(context.ActionArguments),
|
||||
//Result = JsonSerializerUtility.Serialize(actionContext.Result),
|
||||
ElapsedTime = sw.ElapsedMilliseconds,
|
||||
OpTime = DateTimeOffset.Now,
|
||||
Account = httpContext.User?.FindFirstValue(ClaimConst.CLAINM_ACCOUNT)
|
||||
};
|
||||
await sysOpLog.InsertAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
16
Api/Ewide.Core/Manager/IUserManager.cs
Normal file
16
Api/Ewide.Core/Manager/IUserManager.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
public interface IUserManager
|
||||
{
|
||||
string Account { get; }
|
||||
string Name { get; }
|
||||
bool SuperAdmin { get; }
|
||||
SysUser User { get; }
|
||||
string UserId { get; }
|
||||
|
||||
Task<SysUser> CheckUserAsync(string userId, bool tracking = true);
|
||||
Task<SysEmp> GetUserEmpInfo(string userId);
|
||||
}
|
||||
}
|
||||
75
Api/Ewide.Core/Manager/UserManager.cs
Normal file
75
Api/Ewide.Core/Manager/UserManager.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.FriendlyException;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户管理
|
||||
/// </summary>
|
||||
public class UserManager : IUserManager, IScoped
|
||||
{
|
||||
private readonly IRepository<SysUser> _sysUserRep; // 用户表仓储
|
||||
private readonly IRepository<SysEmp> _sysEmpRep; // 员工表
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
|
||||
public string UserId
|
||||
{
|
||||
get => _httpContextAccessor.HttpContext.User.FindFirst(ClaimConst.CLAINM_USERID)?.Value;
|
||||
}
|
||||
|
||||
public string Account
|
||||
{
|
||||
get => _httpContextAccessor.HttpContext.User.FindFirst(ClaimConst.CLAINM_ACCOUNT)?.Value;
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get => _httpContextAccessor.HttpContext.User.FindFirst(ClaimConst.CLAINM_NAME)?.Value;
|
||||
}
|
||||
|
||||
public bool SuperAdmin
|
||||
{
|
||||
get => _httpContextAccessor.HttpContext.User.FindFirst(ClaimConst.CLAINM_SUPERADMIN)?.Value == ((int)AdminType.SuperAdmin).ToString();
|
||||
}
|
||||
|
||||
public SysUser User
|
||||
{
|
||||
get => _sysUserRep.Find(UserId);
|
||||
}
|
||||
|
||||
public UserManager(IRepository<SysUser> sysUserRep,
|
||||
IRepository<SysEmp> sysEmpRep,
|
||||
IHttpContextAccessor httpContextAccessor)
|
||||
{
|
||||
_sysUserRep = sysUserRep;
|
||||
_sysEmpRep = sysEmpRep;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户信息
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="tracking"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<SysUser> CheckUserAsync(string userId, bool tracking = true)
|
||||
{
|
||||
var user = await _sysUserRep.FirstOrDefaultAsync(u => u.Id == userId, tracking);
|
||||
return user ?? throw Oops.Oh(ErrorCode.D1002);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户员工信息
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<SysEmp> GetUserEmpInfo(string userId)
|
||||
{
|
||||
var emp = await _sysEmpRep.FirstOrDefaultAsync(u => u.Id == userId, false);
|
||||
return emp ?? throw Oops.Oh(ErrorCode.D1002);
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Api/Ewide.Core/OAuth/IWechatOAuth.cs
Normal file
12
Api/Ewide.Core/OAuth/IWechatOAuth.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core.OAuth
|
||||
{
|
||||
public interface IWechatOAuth
|
||||
{
|
||||
Task<TokenModel> GetAccessTokenAsync(string code, string state = "");
|
||||
string GetAuthorizeUrl(string state = "");
|
||||
Task<UserInfoModel> GetUserInfoAsync(string accessToken, string openId);
|
||||
Task<TokenModel> GetRefreshTokenAsync(string refreshToken);
|
||||
}
|
||||
}
|
||||
49
Api/Ewide.Core/OAuth/OAuthConfig.cs
Normal file
49
Api/Ewide.Core/OAuth/OAuthConfig.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace Ewide.Core.OAuth
|
||||
{
|
||||
/// <summary>
|
||||
/// OAuth配置---此结构方便拓展
|
||||
/// </summary>
|
||||
public class OAuthConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// AppId
|
||||
/// </summary>
|
||||
public string AppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Secret Key
|
||||
/// </summary>
|
||||
public string AppKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 回调地址
|
||||
/// </summary>
|
||||
public string RedirectUri { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 权限范围
|
||||
/// </summary>
|
||||
public string Scope { get; set; }
|
||||
|
||||
public static OAuthConfig LoadFrom(IConfiguration configuration, string prefix)
|
||||
{
|
||||
return With(appId: configuration[prefix + ":app_id"],
|
||||
appKey: configuration[prefix + ":app_key"],
|
||||
redirectUri: configuration[prefix + ":redirect_uri"],
|
||||
scope: configuration[prefix + ":scope"]);
|
||||
}
|
||||
|
||||
private static OAuthConfig With(string appId, string appKey, string redirectUri, string scope)
|
||||
{
|
||||
return new OAuthConfig()
|
||||
{
|
||||
AppId = appId,
|
||||
AppKey = appKey,
|
||||
RedirectUri = redirectUri,
|
||||
Scope = scope
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
67
Api/Ewide.Core/OAuth/TokenModel.cs
Normal file
67
Api/Ewide.Core/OAuth/TokenModel.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Ewide.Core.OAuth
|
||||
{
|
||||
/// <summary>
|
||||
/// AccessToken参数
|
||||
/// </summary>
|
||||
public class TokenModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户标识
|
||||
/// </summary>
|
||||
[JsonPropertyName("openid")]
|
||||
public string OpenId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Token 类型
|
||||
/// </summary>
|
||||
[JsonPropertyName("token_type")]
|
||||
public string TokenType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// AccessToken
|
||||
/// </summary>
|
||||
[JsonPropertyName("access_token")]
|
||||
public string AccessToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用于刷新 AccessToken 的 Token
|
||||
/// </summary>
|
||||
[JsonPropertyName("refresh_token")]
|
||||
public string RefreshToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 此 AccessToken 对应的权限
|
||||
/// </summary>
|
||||
[JsonPropertyName("scope")]
|
||||
public string Scope { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// AccessToken 过期时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("expires_in")]
|
||||
public dynamic ExpiresIn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 错误的详细描述
|
||||
/// </summary>
|
||||
[JsonPropertyName("error_description")]
|
||||
public string ErrorDescription { get; set; }
|
||||
}
|
||||
|
||||
public static class AccessTokenModelModelExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取的Token是否包含错误
|
||||
/// </summary>
|
||||
/// <param name="accessTokenModel"></param>
|
||||
/// <returns></returns>
|
||||
public static bool HasError(this TokenModel accessTokenModel)
|
||||
{
|
||||
return accessTokenModel == null ||
|
||||
string.IsNullOrEmpty(accessTokenModel.AccessToken) ||
|
||||
!string.IsNullOrEmpty(accessTokenModel.ErrorDescription);
|
||||
}
|
||||
}
|
||||
}
|
||||
62
Api/Ewide.Core/OAuth/UserInfoModel.cs
Normal file
62
Api/Ewide.Core/OAuth/UserInfoModel.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Ewide.Core.OAuth
|
||||
{
|
||||
/// <summary>
|
||||
/// 微信用户参数
|
||||
/// </summary>
|
||||
public class UserInfoModel
|
||||
{
|
||||
[JsonPropertyName("nickname")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("headimgurl")]
|
||||
public string Avatar { get; set; }
|
||||
|
||||
[JsonPropertyName("language")]
|
||||
public string Language { get; set; }
|
||||
|
||||
[JsonPropertyName("openid")]
|
||||
public string Openid { get; set; }
|
||||
|
||||
[JsonPropertyName("sex")]
|
||||
public int Sex { get; set; }
|
||||
|
||||
[JsonPropertyName("province")]
|
||||
public string Province { get; set; }
|
||||
|
||||
[JsonPropertyName("city")]
|
||||
public string City { get; set; }
|
||||
|
||||
[JsonPropertyName("country")]
|
||||
public string Country { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户特权信息,json 数组,如微信沃卡用户为(chinaunicom)
|
||||
/// </summary>
|
||||
[JsonPropertyName("privilege")]
|
||||
public List<string> Privilege { get; set; }
|
||||
|
||||
[JsonPropertyName("unionid")]
|
||||
public string UnionId { get; set; }
|
||||
|
||||
[JsonPropertyName("errmsg")]
|
||||
public string ErrorMessage { get; set; }
|
||||
}
|
||||
|
||||
public static class UserInfoModelExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取的用户是否包含错误
|
||||
/// </summary>
|
||||
/// <param name="userInfoModel"></param>
|
||||
/// <returns></returns>
|
||||
public static bool HasError(this UserInfoModel userInfoModel)
|
||||
{
|
||||
return userInfoModel == null ||
|
||||
string.IsNullOrEmpty(userInfoModel.Name) ||
|
||||
!string.IsNullOrEmpty(userInfoModel.ErrorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
102
Api/Ewide.Core/OAuth/WechatOAuth.cs
Normal file
102
Api/Ewide.Core/OAuth/WechatOAuth.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.FriendlyException;
|
||||
using Furion.RemoteRequest.Extensions;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core.OAuth
|
||||
{
|
||||
public class WechatOAuth : IWechatOAuth, ISingleton
|
||||
{
|
||||
private readonly string _authorizeUrl = "https://open.weixin.qq.com/connect/oauth2/authorize";
|
||||
private readonly string _accessTokenUrl = "https://api.weixin.qq.com/sns/oauth2/access_token";
|
||||
private readonly string _refreshTokenUrl = "https://api.weixin.qq.com/sns/oauth2/refresh_token";
|
||||
private readonly string _userInfoUrl = "https://api.weixin.qq.com/sns/userinfo";
|
||||
|
||||
private readonly OAuthConfig _oauthConfig;
|
||||
|
||||
public WechatOAuth(IConfiguration configuration)
|
||||
{
|
||||
_oauthConfig = OAuthConfig.LoadFrom(configuration, "oauth:wechat");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发起授权
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
public string GetAuthorizeUrl(string state = "")
|
||||
{
|
||||
var param = new Dictionary<string, string>()
|
||||
{
|
||||
["appid"] = _oauthConfig.AppId,
|
||||
["redirect_uri"] = _oauthConfig.RedirectUri,
|
||||
["response_type"] = "code",
|
||||
["scope"] = _oauthConfig.Scope,
|
||||
["state"] = state
|
||||
};
|
||||
return $"{_authorizeUrl}?{param.ToQueryString()}#wechat_redirect";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取微信Token
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<TokenModel> GetAccessTokenAsync(string code, string state = "")
|
||||
{
|
||||
var param = new Dictionary<string, string>()
|
||||
{
|
||||
["appid"] = _oauthConfig.AppId,
|
||||
["secret"] = _oauthConfig.AppKey,
|
||||
["code"] = code,
|
||||
["grant_type"] = "authorization_code"
|
||||
};
|
||||
var accessTokenModel = await $"{_accessTokenUrl}?{param.ToQueryString()}".GetAsAsync<TokenModel>();
|
||||
if (accessTokenModel.HasError())
|
||||
throw Oops.Oh($"{ accessTokenModel.ErrorDescription}");
|
||||
return accessTokenModel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取微信用户基本信息
|
||||
/// </summary>
|
||||
/// <param name="accessToken"></param>
|
||||
/// <param name="openId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<UserInfoModel> GetUserInfoAsync(string accessToken, string openId)
|
||||
{
|
||||
var param = new Dictionary<string, string>()
|
||||
{
|
||||
["access_token"] = accessToken,
|
||||
["openid"] = openId,
|
||||
["lang"] = "zh_CN",
|
||||
};
|
||||
var userInfoModel = await $"{_userInfoUrl}?{param.ToQueryString()}".GetAsAsync<UserInfoModel>();
|
||||
if (userInfoModel.HasError())
|
||||
throw Oops.Oh($"{ userInfoModel.ErrorMessage}");
|
||||
return userInfoModel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 刷新微信Token
|
||||
/// </summary>
|
||||
/// <param name="refreshToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<TokenModel> GetRefreshTokenAsync(string refreshToken)
|
||||
{
|
||||
var param = new Dictionary<string, string>()
|
||||
{
|
||||
["appid"] = _oauthConfig.AppId,
|
||||
["grant_type"] = "refresh_token",
|
||||
["refresh_token"] = refreshToken
|
||||
};
|
||||
var refreshTokenModel = await $"{_refreshTokenUrl}?{param.ToQueryString()}".GetAsAsync<TokenModel>();
|
||||
if (refreshTokenModel.HasError())
|
||||
throw Oops.Oh($"{ refreshTokenModel.ErrorDescription}");
|
||||
return refreshTokenModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
30
Api/Ewide.Core/SeedData/SysAppSeedData.cs
Normal file
30
Api/Ewide.Core/SeedData/SysAppSeedData.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统应用表种子数据
|
||||
/// </summary>
|
||||
public class SysAppSeedData : IEntitySeedData<SysApp>
|
||||
{
|
||||
/// <summary>
|
||||
/// 种子数据
|
||||
/// </summary>
|
||||
/// <param name="dbContext"></param>
|
||||
/// <param name="dbContextLocator"></param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<SysApp> HasData(DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new SysApp{Id="8b2aeb5e-09a6-4afd-bcae-8ee8e5a1e6ec", Name="业务应用", Code="busapp", Active=false, Status=0, Sort=100 }, // 142307070922869
|
||||
new SysApp{Id="d781b8f1-0d08-48c8-b7a5-ed75ddfa676c", Name="系统管理", Code="system", Active=true, Status=0, Sort=100 }, // 142307070898245
|
||||
new SysApp{Id="850ab86f-cd6a-4d49-b920-77dfa5d78813", Name="系统工具", Code="system_tool", Active=false, Status=0, Sort=100 }, // 142307070902341
|
||||
new SysApp{Id="05a32be5-82e8-423f-affa-e17232a63ee1", Name="高级功能", Code="advanced", Active=false, Status=0, Sort=100 } // 142307070922826
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
59
Api/Ewide.Core/SeedData/SysConfigSeedData.cs
Normal file
59
Api/Ewide.Core/SeedData/SysConfigSeedData.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统参数配置表种子数据
|
||||
/// </summary>
|
||||
public class SysConfigSeedData : IEntitySeedData<SysConfig>
|
||||
{
|
||||
/// <summary>
|
||||
/// 种子数据
|
||||
/// </summary>
|
||||
/// <param name="dbContext"></param>
|
||||
/// <param name="dbContextLocator"></param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<SysConfig> HasData(DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new SysConfig{Id="7c2765cd-d39b-4772-8d6c-0dbcdcfa1ff8", Name="jwt密钥", Code="DILON_JWT_SECRET", Value="xiaonuo",SysFlag="Y", Remark="(重要)jwt密钥,默认为空,自行设置", Status=0, GroupCode="DEFAULT"},
|
||||
new SysConfig{Id="e3553657-14cf-4c26-ba7b-dbb4bfd4bc55", Name="默认密码", Code="DILON_DEFAULT_PASSWORD", Value="123456",SysFlag="Y", Remark="默认密码", Status=0, GroupCode="DEFAULT"},
|
||||
new SysConfig{Id="2c677cd2-2a54-46c6-971d-f9fe20f101f3", Name="token过期时间", Code="DILON_TOKEN_EXPIRE", Value="86400",SysFlag="Y", Remark="token过期时间(单位:秒)", Status=0, GroupCode="DEFAULT"},
|
||||
new SysConfig{Id="8938506d-2e00-44e0-8592-48453d43f9f5", Name="session会话过期时间", Code="DILON_SESSION_EXPIRE", Value="7200",SysFlag="Y", Remark="session会话过期时间(单位:秒)", Status=0, GroupCode="DEFAULT"},
|
||||
new SysConfig{Id="beb2e9e7-f4d9-43b1-bfab-3557ea232f8d", Name="阿里云短信keyId", Code="DILON_ALIYUN_SMS_ACCESSKEY_ID", Value="你的keyId",SysFlag="Y", Remark="阿里云短信keyId", Status=0, GroupCode="ALIYUN_SMS"},
|
||||
new SysConfig{Id="ead14cd0-9fd4-4fd6-b75c-239d8b2ebed8", Name="阿里云短信secret", Code="DILON_ALIYUN_SMS_ACCESSKEY_SECRET", Value="你的secret",SysFlag="Y", Remark="阿里云短信secret", Status=0, GroupCode="ALIYUN_SMS"},
|
||||
new SysConfig{Id="beaaafc2-3fdf-42af-9b06-ead3a6dd6306", Name="阿里云短信签名", Code="DILON_ALIYUN_SMS_SIGN_NAME", Value="你的签名",SysFlag="Y", Remark="阿里云短信签名", Status=0, GroupCode="ALIYUN_SMS"},
|
||||
new SysConfig{Id="e26a10cf-911a-4fe0-a113-76965be749a0", Name="阿里云短信-登录模板号", Code="DILON_ALIYUN_SMS_LOGIN_TEMPLATE_CODE", Value="SMS_1877123456",SysFlag="Y", Remark="阿里云短信-登录模板号", Status=0, GroupCode="ALIYUN_SMS"},
|
||||
new SysConfig{Id="24d3f286-efca-49af-91b4-e3ce42cce36e", Name="阿里云短信默认失效时间", Code="DILON_ALIYUN_SMS_INVALIDATE_MINUTES", Value="5",SysFlag="Y", Remark="阿里云短信默认失效时间(单位:分钟)", Status=0, GroupCode="ALIYUN_SMS"},
|
||||
new SysConfig{Id="c6540a07-ce32-47b4-ab83-b647bdb14491", Name="腾讯云短信secretId", Code="DILON_TENCENT_SMS_SECRET_ID", Value="你的secretId",SysFlag="Y", Remark="腾讯云短信secretId", Status=0, GroupCode="TENCENT_SMS"},
|
||||
new SysConfig{Id="a0412212-d50b-42aa-9484-3cef8fe3cc59", Name="腾讯云短信secretKey", Code="DILON_TENCENT_SMS_SECRET_KEY", Value="你的secretkey",SysFlag="Y", Remark="腾讯云短信secretKey", Status=0, GroupCode="TENCENT_SMS"},
|
||||
new SysConfig{Id="c928ca11-5137-4b71-bf1c-f3bc95bcd34d", Name="腾讯云短信sdkAppId", Code="DILON_TENCENT_SMS_SDK_APP_ID", Value="1400375123",SysFlag="Y", Remark="腾讯云短信sdkAppId", Status=0, GroupCode="TENCENT_SMS"},
|
||||
new SysConfig{Id="16ce1b6e-c8ad-4299-9293-6caff0e5cb49", Name="腾讯云短信签名", Code="DILON_TENCENT_SMS_SIGN", Value="你的签名",SysFlag="Y", Remark="腾讯云短信签名", Status=0, GroupCode="TENCENT_SMS"},
|
||||
new SysConfig{Id="66e63d64-b7eb-4e6a-b5b6-c87811c2e700", Name="邮箱host", Code="DILON_EMAIL_HOST", Value="smtp.126.com",SysFlag="Y", Remark="邮箱host", Status=0, GroupCode="EMAIL"},
|
||||
new SysConfig{Id="997a9bc6-22ed-4fe6-a20c-c3c2a0b682a0", Name="邮箱用户名", Code="DILON_EMAIL_USERNAME", Value="test@126.com",SysFlag="Y", Remark="邮箱用户名", Status=0, GroupCode="EMAIL"},
|
||||
new SysConfig{Id="633d1851-41d9-4ebd-b83b-3aa4501cd1a7", Name="邮箱密码", Code="DILON_EMAIL_PASSWORD", Value="你的邮箱密码",SysFlag="Y", Remark="邮箱密码", Status=0, GroupCode="EMAIL"},
|
||||
new SysConfig{Id="67e468f7-e791-4e91-a896-62e9f7411635", Name="邮箱端口", Code="DILON_EMAIL_PORT", Value="465",SysFlag="Y", Remark="邮箱端口", Status=0, GroupCode="EMAIL"},
|
||||
new SysConfig{Id="dc462c05-de23-4f90-bcdc-88de4abcdf22", Name="邮箱是否开启ssl", Code="DILON_EMAIL_SSL", Value="true",SysFlag="Y", Remark="邮箱是否开启ssl", Status=0, GroupCode="EMAIL"},
|
||||
new SysConfig{Id="8beac2a0-4c67-4499-a7ce-27e989546ce9", Name="邮箱发件人", Code="DILON_EMAIL_FROM", Value="test@126.com",SysFlag="Y", Remark="邮箱发件人", Status=0, GroupCode="EMAIL"},
|
||||
new SysConfig{Id="55756524-ecb8-444e-9cdd-a0fc767c4b96", Name="Win本地上传文件路径", Code="DILON_FILE_UPLOAD_PATH_FOR_WINDOWS", Value="D:/tmp",SysFlag="Y", Remark="Win本地上传文件路径", Status=0, GroupCode="FILE_PATH"},
|
||||
new SysConfig{Id="d2db41ee-ce1f-46de-ac00-5860634afed9", Name="Linux/Mac本地上传文件路径", Code="DILON_FILE_UPLOAD_PATH_FOR_LINUX", Value="/tmp",SysFlag="Y", Remark="Linux/Mac本地上传文件路径", Status=0, GroupCode="FILE_PATH"},
|
||||
new SysConfig{Id="ff8debdd-eca0-4f91-8213-e2080f76b35d", Name="放开XSS过滤的接口", Code="DILON_UN_XSS_FILTER_URL", Value="/demo/xssfilter,/demo/unxss",SysFlag="Y", Remark="多个url可以用英文逗号隔开", Status=0, GroupCode="DEFAULT"},
|
||||
new SysConfig{Id="5584fb84-f580-463f-b06d-bbb80a4dfb72", Name="单用户登陆的开关", Code="DILON_ENABLE_SINGLE_LOGIN", Value="false",SysFlag="Y", Remark="true-打开,false-关闭,如果一个人登录两次,就会将上一次登陆挤下去", Status=0, GroupCode="DEFAULT"},
|
||||
new SysConfig{Id="53b0afb2-4917-4b85-bcca-fe7c7723ae22", Name="登录验证码的开关", Code="DILON_CAPTCHA_OPEN", Value="true",SysFlag="Y", Remark="true-打开,false-关闭", Status=0, GroupCode="DEFAULT"},
|
||||
new SysConfig{Id="974740d8-8647-4cf8-8102-542eea53e97f", Name="Druid监控登录账号", Code="DILON_DRUID_USERNAME", Value="superAdmin",SysFlag="Y", Remark="Druid监控登录账号", Status=0, GroupCode="DEFAULT"},
|
||||
new SysConfig{Id="8cee44ea-ba4c-42db-a57d-69b8b5316ca5", Name="Druid监控界面登录密码", Code="DILON_DRUID_PASSWORD", Value="123456",SysFlag="Y", Remark="Druid监控界面登录密码", Status=0, GroupCode="DEFAULT"},
|
||||
new SysConfig{Id="efc235ab-9b05-4820-afe4-32a1eb59e4de", Name="阿里云定位api接口地址", Code="DILON_IP_GEO_API", Value="http://api01.aliyun.venuscn.com/ip?ip=%s",SysFlag="Y", Remark="阿里云定位api接口地址", Status=0, GroupCode="DEFAULT"},
|
||||
new SysConfig{Id="d3597d8a-562a-4b24-93c7-8655c5445d74", Name="阿里云定位appCode", Code="DILON_IP_GEO_APP_CODE", Value="461535aabeae4f34861884d392f5d452",SysFlag="Y", Remark="阿里云定位appCode", Status=0, GroupCode="DEFAULT"},
|
||||
new SysConfig{Id="59c8a6f2-9e3c-4e9e-b9cf-8ecad5f0cb45", Name="Oauth用户登录的开关", Code="DILON_ENABLE_OAUTH_LOGIN", Value="true",SysFlag="Y", Remark="Oauth用户登录的开关", Status=0, GroupCode="OAUTH"},
|
||||
new SysConfig{Id="ff502ee7-8129-4828-8d16-fb04562ef52c", Name="Oauth码云登录ClientId", Code="DILON_OAUTH_GITEE_CLIENT_ID", Value="你的clientId",SysFlag="Y", Remark="Oauth码云登录ClientId", Status=0, GroupCode="OAUTH"},
|
||||
new SysConfig{Id="a1d957ef-2b70-456f-8eda-b70a4cf01535", Name="Oauth码云登录ClientSecret", Code="DILON_OAUTH_GITEE_CLIENT_SECRET", Value="你的clientSecret",SysFlag="Y", Remark="Oauth码云登录ClientSecret", Status=0, GroupCode="OAUTH"},
|
||||
new SysConfig{Id="b32ee22b-671d-40bf-8070-32e1054fef96", Name="Oauth码云登录回调地址", Code="DILON_OAUTH_GITEE_REDIRECT_URI", Value="http://127.0.0.1:5566/oauth/callback/gitee",SysFlag="Y", Remark="Oauth码云登录回调地址", Status=0, GroupCode="OAUTH"},
|
||||
new SysConfig{Id="38dda85c-2a98-4768-aebd-a60ab286052c", Name="演示环境", Code="DILON_DEMO_ENV_FLAG", Value="false",SysFlag="Y", Remark="演示环境的开关,true-打开,false-关闭,如果演示环境开启,则只能读数据不能写数据", Status=0, GroupCode="DEFAULT"},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
124
Api/Ewide.Core/SeedData/SysDictDataSeedData.cs
Normal file
124
Api/Ewide.Core/SeedData/SysDictDataSeedData.cs
Normal file
@@ -0,0 +1,124 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统字典值种子数据
|
||||
/// </summary>
|
||||
public class SysDictDataSeedData : IEntitySeedData<SysDictData>
|
||||
{
|
||||
/// <summary>
|
||||
/// 种子数据
|
||||
/// </summary>
|
||||
/// <param name="dbContext"></param>
|
||||
/// <param name="dbContextLocator"></param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<SysDictData> HasData(DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new SysDictData{Id="99b965d3-1f2b-4f5b-a62a-6763b8d64a64", TypeId="d5b311fd-4b60-4b51-9156-b0e6d6cfa4d1", Value="通知", Code="1", Sort=100, Remark="通知", Status=0 },
|
||||
new SysDictData{Id="2616e6c2-a504-4fc6-993e-72701b48e79a", TypeId="d5b311fd-4b60-4b51-9156-b0e6d6cfa4d1", Value="公告", Code="2", Sort=100, Remark="公告", Status=0 },
|
||||
new SysDictData{Id="40d336cd-918a-4e90-8836-cba7c1bf6cdf", TypeId="b30937e6-03cd-4d98-a413-10b06d605e5a", Value="草稿", Code="0", Sort=100, Remark="草稿", Status=0 },
|
||||
new SysDictData{Id="f5b49fa9-31a1-44c2-9df0-b28bf5daeee0", TypeId="b30937e6-03cd-4d98-a413-10b06d605e5a", Value="发布", Code="1", Sort=100, Remark="发布", Status=0 },
|
||||
new SysDictData{Id="d2f73bb4-05a1-4aa5-9273-e9f3c393996d", TypeId="b30937e6-03cd-4d98-a413-10b06d605e5a", Value="撤回", Code="2", Sort=100, Remark="撤回", Status=0 },
|
||||
new SysDictData{Id="6385916f-6ead-470e-889b-cfb9d2da6256", TypeId="b30937e6-03cd-4d98-a413-10b06d605e5a", Value="删除", Code="3", Sort=100, Remark="删除", Status=0 },
|
||||
new SysDictData{Id="1f432e9d-f031-4787-a527-f37bb20ebe3a", TypeId="80aea9e7-ad1b-4f57-b4db-9d15813707bd", Value="是", Code="true", Sort=100, Remark="是", Status=0 },
|
||||
new SysDictData{Id="0724636d-e870-46c6-8e1e-67f1ea5f58e5", TypeId="80aea9e7-ad1b-4f57-b4db-9d15813707bd", Value="否", Code="false", Sort=100, Remark="否", Status=0 },
|
||||
new SysDictData{Id="881ebcf2-94a6-4938-81a4-55b81736f3b3", TypeId="430d0538-054a-4b37-a459-1095d0ccf4ae", Value="下载压缩包", Code="1", Sort=100, Remark="下载压缩包", Status=0 },
|
||||
new SysDictData{Id="5bc8662d-b795-48f1-a88e-2f4be5279d37", TypeId="430d0538-054a-4b37-a459-1095d0ccf4ae", Value="生成到本项目", Code="2", Sort=100, Remark="生成到本项目", Status=0 },
|
||||
new SysDictData{Id="b2a00b40-23e1-40e1-8995-60ab420eafe1", TypeId="bc0dc25b-b85e-4dd1-8368-e014fe1bf30b", Value="GET", Code="1", Sort=100, Remark="GET", Status=0 },
|
||||
new SysDictData{Id="10070836-0c89-4b89-96e3-c65c7e33a86c", TypeId="bc0dc25b-b85e-4dd1-8368-e014fe1bf30b", Value="POST", Code="2", Sort=100, Remark="POST", Status=0 },
|
||||
new SysDictData{Id="69a34c0b-85ce-4e53-9ad4-a592057dddd4", TypeId="bc0dc25b-b85e-4dd1-8368-e014fe1bf30b", Value="PUT", Code="3", Sort=100, Remark="PUT", Status=0 },
|
||||
new SysDictData{Id="0e4dc1f1-8654-401b-800a-22b31f62ced1", TypeId="bc0dc25b-b85e-4dd1-8368-e014fe1bf30b", Value="DELETE", Code="4", Sort=100, Remark="DELETE", Status=0 },
|
||||
new SysDictData{Id="443f965e-96b4-4fd2-93e9-07fe00a47205", TypeId="5bdf9b7a-a483-4b61-8e22-e2b25b255b91", Value="输入框", Code="input", Sort=100, Remark="输入框", Status=0 },
|
||||
new SysDictData{Id="bf7be9a2-53fb-4250-87fe-49d7f741d159", TypeId="5bdf9b7a-a483-4b61-8e22-e2b25b255b91", Value="时间选择", Code="datepicker", Sort=100, Remark="时间选择", Status=0 },
|
||||
new SysDictData{Id="cea10919-47e2-43ab-a19b-9d41fe648310", TypeId="5bdf9b7a-a483-4b61-8e22-e2b25b255b91", Value="下拉框", Code="select", Sort=100, Remark="下拉框", Status=0 },
|
||||
new SysDictData{Id="7d534f44-cf66-472e-b0d3-20a4cc2ad432", TypeId="5bdf9b7a-a483-4b61-8e22-e2b25b255b91", Value="单选框", Code="radio", Sort=100, Remark="单选框", Status=0 },
|
||||
new SysDictData{Id="d63b06d4-be11-4ab7-9905-87f6f2ca056f", TypeId="5bdf9b7a-a483-4b61-8e22-e2b25b255b91", Value="开关", Code="switch", Sort=100, Remark="开关", Status=0 },
|
||||
new SysDictData{Id="46967f62-bac9-47fd-9278-b29c047b0c38", TypeId="5bdf9b7a-a483-4b61-8e22-e2b25b255b91", Value="多选框", Code="checkbox", Sort=100, Remark="多选框", Status=0 },
|
||||
new SysDictData{Id="a8ac5009-93d3-4405-a6b9-81ed3e2811f2", TypeId="5bdf9b7a-a483-4b61-8e22-e2b25b255b91", Value="数字输入框", Code="inputnumber", Sort=100, Remark="数字输入框", Status=0 },
|
||||
new SysDictData{Id="d00b3efa-2f9d-464c-8134-aa7013ef52bb", TypeId="5bdf9b7a-a483-4b61-8e22-e2b25b255b91", Value="文本域", Code="textarea", Sort=100, Remark="文本域", Status=0 },
|
||||
new SysDictData{Id="ad759239-e34e-4fdf-a0d0-6b39eb41f880", TypeId="41bc31f6-cef5-400d-b03a-bf51d27b2432", Value="等于", Code="==", Sort=1, Remark="等于", Status=0 },
|
||||
new SysDictData{Id="2c8e1240-f3ef-4df1-bd68-3047109ad5b4", TypeId="41bc31f6-cef5-400d-b03a-bf51d27b2432", Value="模糊", Code="like", Sort=2, Remark="模糊", Status=0 },
|
||||
new SysDictData{Id="efc18513-c17b-4fc1-8e0e-2e79fb9b0107", TypeId="41bc31f6-cef5-400d-b03a-bf51d27b2432", Value="大于", Code=">", Sort=3, Remark="大于", Status=0 },
|
||||
new SysDictData{Id="a6812d98-7785-4db2-b2f8-d476a459c5ed", TypeId="41bc31f6-cef5-400d-b03a-bf51d27b2432", Value="小于", Code="<", Sort=4, Remark="小于", Status=0 },
|
||||
new SysDictData{Id="218b5bac-343e-4594-a9da-30e391c7735c", TypeId="41bc31f6-cef5-400d-b03a-bf51d27b2432", Value="不等于", Code="!=", Sort=5, Remark="不等于", Status=0 },
|
||||
new SysDictData{Id="4825f15d-077b-4c16-8ee7-0205d653e14d", TypeId="41bc31f6-cef5-400d-b03a-bf51d27b2432", Value="大于等于", Code=">=", Sort=6, Remark="大于等于", Status=0 },
|
||||
new SysDictData{Id="7c9e8270-db5a-45b7-acd7-f95c8ee31547", TypeId="41bc31f6-cef5-400d-b03a-bf51d27b2432", Value="小于等于", Code="<=", Sort=7, Remark="小于等于", Status=0 },
|
||||
new SysDictData{Id="759ea7de-a18f-4ed7-9032-bbd1a4dadc9e", TypeId="41bc31f6-cef5-400d-b03a-bf51d27b2432", Value="不为空", Code="isNotNull", Sort=8, Remark="不为空", Status=0 },
|
||||
new SysDictData{Id="a5cdf75e-6361-490d-a043-f5929ccf65a9", TypeId="28f653d4-e573-4f54-8e5c-4e308780145a", Value="int", Code="int", Sort=100, Remark="int", Status=0 },
|
||||
new SysDictData{Id="cffdd4b5-d4e0-4196-81b9-02045de8b189", TypeId="28f653d4-e573-4f54-8e5c-4e308780145a", Value="long", Code="long", Sort=100, Remark="long", Status=0 },
|
||||
new SysDictData{Id="25be90ea-b439-4e9d-993c-48a5ce3b9358", TypeId="28f653d4-e573-4f54-8e5c-4e308780145a", Value="string", Code="string", Sort=100, Remark="string", Status=0 },
|
||||
new SysDictData{Id="496eef62-3849-4263-b274-a3e6090942e3", TypeId="28f653d4-e573-4f54-8e5c-4e308780145a", Value="bool", Code="bool", Sort=100, Remark="bool", Status=0 },
|
||||
new SysDictData{Id="681c02ea-7570-4a97-85a7-957a77314df6", TypeId="28f653d4-e573-4f54-8e5c-4e308780145a", Value="double", Code="double", Sort=100, Remark="double", Status=0 },
|
||||
new SysDictData{Id="259698cf-b25d-427a-8d22-33b9c1899eea", TypeId="28f653d4-e573-4f54-8e5c-4e308780145a", Value="DateTime", Code="DateTime", Sort=100, Remark="DateTime", Status=0 },
|
||||
new SysDictData{Id="a30c682e-744a-468d-a74f-827928c96c01", TypeId="28f653d4-e573-4f54-8e5c-4e308780145a", Value="float", Code="float", Sort=100, Remark="float", Status=0 },
|
||||
new SysDictData{Id="4b68cb83-f173-4864-bd10-a7a7d5248102", TypeId="28f653d4-e573-4f54-8e5c-4e308780145a", Value="decimal", Code="decimal", Sort=100, Remark="decimal", Status=0 },
|
||||
new SysDictData{Id="134d4173-8d93-4c19-bf6b-a640d35da097", TypeId="28f653d4-e573-4f54-8e5c-4e308780145a", Value="Guid", Code="Guid", Sort=100, Remark="Guid", Status=0 },
|
||||
new SysDictData{Id="c597306f-5fd0-4f75-9a46-12de340cd199", TypeId="28f653d4-e573-4f54-8e5c-4e308780145a", Value="DateTimeOffset", Code="DateTimeOffset", Sort=100, Remark="DateTimeOffset", Status=0 },
|
||||
new SysDictData{Id="9b44b297-f6f0-4c31-b680-83baabf4c5b7", TypeId="301ed120-dfc5-4d7c-af59-b56a519581c9", Value="男", Code="1", Sort=100, Remark="男性", Status=0 },
|
||||
new SysDictData{Id="46ba4c21-cbde-4561-8e57-19ed0f752c17", TypeId="301ed120-dfc5-4d7c-af59-b56a519581c9", Value="女", Code="2", Sort=100, Remark="女性", Status=0 },
|
||||
new SysDictData{Id="150e04a6-3bf5-4604-98d5-14fbd1608bc5", TypeId="301ed120-dfc5-4d7c-af59-b56a519581c9", Value="未知", Code="3", Sort=100, Remark="未知性别", Status=0 },
|
||||
new SysDictData{Id="b6ad194b-ccfb-4ee7-b402-7b78e8bb8680", TypeId="64afb5e7-9f00-4c4f-9ba6-6b41221bd862", Value="默认常量", Code="DEFAULT", Sort=100, Remark="默认常量,都以XIAONUO_开头的", Status=0 },
|
||||
new SysDictData{Id="e2271e0a-17a3-41f3-81fa-dbe895ce0466", TypeId="64afb5e7-9f00-4c4f-9ba6-6b41221bd862", Value="阿里云短信", Code="ALIYUN_SMS", Sort=100, Remark="阿里云短信配置", Status=0 },
|
||||
new SysDictData{Id="5e61f455-1975-438b-bd17-85a1f89abe84", TypeId="64afb5e7-9f00-4c4f-9ba6-6b41221bd862", Value="腾讯云短信", Code="TENCENT_SMS", Sort=100, Remark="腾讯云短信", Status=0 },
|
||||
new SysDictData{Id="9cba05e7-495a-43fb-b86b-fa459da5b04d", TypeId="64afb5e7-9f00-4c4f-9ba6-6b41221bd862", Value="邮件配置", Code="EMAIL", Sort=100, Remark="邮件配置", Status=0 },
|
||||
new SysDictData{Id="81d87a9c-a4ee-46dc-be69-71dcccb14d9d", TypeId="64afb5e7-9f00-4c4f-9ba6-6b41221bd862", Value="文件上传路径", Code="FILE_PATH", Sort=100, Remark="文件上传路径", Status=0 },
|
||||
new SysDictData{Id="fdf38fa8-3d1e-4a43-84bc-785c0a394160", TypeId="64afb5e7-9f00-4c4f-9ba6-6b41221bd862", Value="Oauth配置", Code="OAUTH", Sort=100, Remark="Oauth配置", Status=0 },
|
||||
new SysDictData{Id="e3c9ebce-bdae-45a3-92b1-fc2e35a23242", TypeId="b0cfa91c-1189-4f39-bc5a-f035885d0604", Value="正常", Code="0", Sort=100, Remark="正常", Status=0 },
|
||||
new SysDictData{Id="22492650-a92b-43f0-9954-3d3891ec6e45", TypeId="b0cfa91c-1189-4f39-bc5a-f035885d0604", Value="停用", Code="1", Sort=100, Remark="停用", Status=0 },
|
||||
new SysDictData{Id="297030a2-88d9-4646-b7c1-a17c9a8c0b98", TypeId="b0cfa91c-1189-4f39-bc5a-f035885d0604", Value="删除", Code="2", Sort=100, Remark="删除", Status=0 },
|
||||
new SysDictData{Id="1159fc34-ef51-4e0f-b55b-0220d2445a1e", TypeId="f2f0e8bf-04da-4a2f-9fb8-1d6549227302", Value="否", Code="N", Sort=100, Remark="否", Status=0 },
|
||||
new SysDictData{Id="7d3115a8-938a-4d09-a2c9-21ad65b8b65a", TypeId="f2f0e8bf-04da-4a2f-9fb8-1d6549227302", Value="是", Code="Y", Sort=100, Remark="是", Status=0 },
|
||||
new SysDictData{Id="8204daac-b2ea-41f6-ab52-ef299a05fd94", TypeId="2cecf329-cf95-44eb-a8d7-3fb77b13e093", Value="登录", Code="1", Sort=100, Remark="登录", Status=0 },
|
||||
new SysDictData{Id="934099f4-c1a6-4f63-8cff-a42356369dd9", TypeId="2cecf329-cf95-44eb-a8d7-3fb77b13e093", Value="登出", Code="2", Sort=100, Remark="登出", Status=0 },
|
||||
new SysDictData{Id="a8cd8263-4397-4d68-91db-d92330c67632", TypeId="e973d383-c28e-42e0-9e23-5f2bd592fef5", Value="目录", Code="0", Sort=100, Remark="目录", Status=0 },
|
||||
new SysDictData{Id="bb082602-57ea-4941-b68b-64460e7f63b6", TypeId="e973d383-c28e-42e0-9e23-5f2bd592fef5", Value="菜单", Code="1", Sort=100, Remark="菜单", Status=0 },
|
||||
new SysDictData{Id="a4cba529-769a-4309-add6-b15b25ebf05a", TypeId="e973d383-c28e-42e0-9e23-5f2bd592fef5", Value="按钮", Code="2", Sort=100, Remark="按钮", Status=0 },
|
||||
new SysDictData{Id="7ec98dee-8dc9-47fe-9276-f3312ed5dd24", TypeId="058db370-3718-42c3-8ba7-095341b1fe13", Value="未发送", Code="0", Sort=100, Remark="未发送", Status=0 },
|
||||
new SysDictData{Id="83cf4407-dbe1-4da2-883d-a3e16a780f37", TypeId="058db370-3718-42c3-8ba7-095341b1fe13", Value="发送成功", Code="1", Sort=100, Remark="发送成功", Status=0 },
|
||||
new SysDictData{Id="e1e71562-015e-466b-b98b-29f4b8966bce", TypeId="058db370-3718-42c3-8ba7-095341b1fe13", Value="发送失败", Code="2", Sort=100, Remark="发送失败", Status=0 },
|
||||
new SysDictData{Id="13e71f10-539b-4016-9acf-e3541c0f04db", TypeId="058db370-3718-42c3-8ba7-095341b1fe13", Value="失效", Code="3", Sort=100, Remark="失效", Status=0 },
|
||||
new SysDictData{Id="f965b257-b2ff-4a18-9084-6e805547e9e6", TypeId="ff6202cb-25ce-4ab9-9c39-910c418b1d2d", Value="无", Code="0", Sort=100, Remark="无", Status=0 },
|
||||
new SysDictData{Id="75c40b12-07d1-4828-9b6c-132f4bca194c", TypeId="ff6202cb-25ce-4ab9-9c39-910c418b1d2d", Value="组件", Code="1", Sort=100, Remark="组件", Status=0 },
|
||||
new SysDictData{Id="be3197fd-2fba-4e79-b252-793f05e51a21", TypeId="ff6202cb-25ce-4ab9-9c39-910c418b1d2d", Value="内链", Code="2", Sort=100, Remark="内链", Status=0 },
|
||||
new SysDictData{Id="2a10adc6-b286-4fad-9719-7e7321c7a93e", TypeId="ff6202cb-25ce-4ab9-9c39-910c418b1d2d", Value="外链", Code="3", Sort=100, Remark="外链", Status=0 },
|
||||
new SysDictData{Id="d3984ed0-29d5-416e-87c6-75364010677b", TypeId="b3235678-f7fe-442b-8fba-e792a89b78f2", Value="系统权重", Code="1", Sort=100, Remark="系统权重", Status=0 },
|
||||
new SysDictData{Id="f4771570-e4a5-416f-b82f-1e3082c35ee8", TypeId="b3235678-f7fe-442b-8fba-e792a89b78f2", Value="业务权重", Code="2", Sort=100, Remark="业务权重", Status=0 },
|
||||
new SysDictData{Id="a2d6bdfe-ee61-4425-94c9-7ece3de080fa", TypeId="a2068ed1-62a6-463c-b720-06111d994079", Value="全部数据", Code="1", Sort=100, Remark="全部数据", Status=0 },
|
||||
new SysDictData{Id="d0b25877-165e-41b8-9034-7a8fea7e5776", TypeId="a2068ed1-62a6-463c-b720-06111d994079", Value="本部门及以下数据", Code="2", Sort=100, Remark="本部门及以下数据", Status=0 },
|
||||
new SysDictData{Id="375362c8-d694-40d9-8c55-07669e472460", TypeId="a2068ed1-62a6-463c-b720-06111d994079", Value="本部门数据", Code="3", Sort=100, Remark="本部门数据", Status=0 },
|
||||
new SysDictData{Id="70afe4c1-3495-483a-bdd0-3d4ea45136b3", TypeId="a2068ed1-62a6-463c-b720-06111d994079", Value="仅本人数据", Code="4", Sort=100, Remark="仅本人数据", Status=0 },
|
||||
new SysDictData{Id="6f395e69-8add-40ae-a378-0881d64a4413", TypeId="a2068ed1-62a6-463c-b720-06111d994079", Value="自定义数据", Code="5", Sort=100, Remark="自定义数据", Status=0 },
|
||||
new SysDictData{Id="a819d549-6107-43a2-99d2-377cf0a5681a", TypeId="688f9a69-ec95-46f4-87bb-e19e3cc5c7fc", Value="app", Code="1", Sort=100, Remark="app", Status=0 },
|
||||
new SysDictData{Id="b1e821b3-4e7b-4e60-a67f-a40d327ab6d6", TypeId="688f9a69-ec95-46f4-87bb-e19e3cc5c7fc", Value="pc", Code="2", Sort=100, Remark="pc", Status=0 },
|
||||
new SysDictData{Id="2bce5da0-b386-4412-935d-d081b7cf4391", TypeId="688f9a69-ec95-46f4-87bb-e19e3cc5c7fc", Value="其他", Code="3", Sort=100, Remark="其他", Status=0 },
|
||||
new SysDictData{Id="35aac71b-9939-4b2e-8533-d087618c1dca", TypeId="8461bd1d-311b-487e-b579-d6049c6fb191", Value="其它", Code="0", Sort=100, Remark="其它", Status=0 },
|
||||
new SysDictData{Id="e7585292-d6c6-475f-bf87-8ad473ce6be4", TypeId="8461bd1d-311b-487e-b579-d6049c6fb191", Value="增加", Code="1", Sort=100, Remark="增加", Status=0 },
|
||||
new SysDictData{Id="387d403c-6af3-4bda-af05-d60472823480", TypeId="8461bd1d-311b-487e-b579-d6049c6fb191", Value="删除", Code="2", Sort=100, Remark="删除", Status=0 },
|
||||
new SysDictData{Id="4656bf7b-df6a-4c71-b963-18d8af3f93a7", TypeId="8461bd1d-311b-487e-b579-d6049c6fb191", Value="编辑", Code="3", Sort=100, Remark="编辑", Status=0 },
|
||||
new SysDictData{Id="9edba767-7008-4623-8dbf-75417f1a0c82", TypeId="8461bd1d-311b-487e-b579-d6049c6fb191", Value="更新", Code="4", Sort=100, Remark="更新", Status=0 },
|
||||
new SysDictData{Id="d1334517-ddfa-47f3-b053-88ea999babc7", TypeId="8461bd1d-311b-487e-b579-d6049c6fb191", Value="查询", Code="5", Sort=100, Remark="查询", Status=0 },
|
||||
new SysDictData{Id="fe6e46ee-208b-446f-8aaa-05bd5eaa459b", TypeId="8461bd1d-311b-487e-b579-d6049c6fb191", Value="详情", Code="6", Sort=100, Remark="详情", Status=0 },
|
||||
new SysDictData{Id="bf8f818f-060b-4815-8fe9-11bb356cb2e6", TypeId="8461bd1d-311b-487e-b579-d6049c6fb191", Value="树", Code="7", Sort=100, Remark="树", Status=0 },
|
||||
new SysDictData{Id="2b9cf0b8-74ba-4b36-8504-275a2387729a", TypeId="8461bd1d-311b-487e-b579-d6049c6fb191", Value="导入", Code="8", Sort=100, Remark="导入", Status=0 },
|
||||
new SysDictData{Id="db13458a-22b4-4f5e-b6f9-c3c9e1400909", TypeId="8461bd1d-311b-487e-b579-d6049c6fb191", Value="导出", Code="9", Sort=100, Remark="导出", Status=0 },
|
||||
new SysDictData{Id="e02d9274-aa68-4e2c-9211-b226f1e6423e", TypeId="8461bd1d-311b-487e-b579-d6049c6fb191", Value="授权", Code="10", Sort=100, Remark="授权", Status=0 },
|
||||
new SysDictData{Id="023244cd-eb32-4a19-bb3c-97301be1e769", TypeId="8461bd1d-311b-487e-b579-d6049c6fb191", Value="强退", Code="11", Sort=100, Remark="强退", Status=0 },
|
||||
new SysDictData{Id="beb773cd-a22a-44e2-ac4b-5ab6f21aa3c4", TypeId="8461bd1d-311b-487e-b579-d6049c6fb191", Value="清空", Code="12", Sort=100, Remark="清空", Status=0 },
|
||||
new SysDictData{Id="b6f55ff4-6b6a-452a-b372-32ac2f1f2b30", TypeId="8461bd1d-311b-487e-b579-d6049c6fb191", Value="修改状态", Code="13", Sort=100, Remark="修改状态", Status=0 },
|
||||
new SysDictData{Id="f86e19a0-8ba8-4588-91f6-be2af525f490", TypeId="b924e0c1-3f23-4e37-9f27-90e945381304", Value="阿里云", Code="1", Sort=100, Remark="阿里云", Status=0 },
|
||||
new SysDictData{Id="91c522b5-4f6f-48a5-ba79-962d56821bdc", TypeId="b924e0c1-3f23-4e37-9f27-90e945381304", Value="腾讯云", Code="2", Sort=100, Remark="腾讯云", Status=0 },
|
||||
new SysDictData{Id="cc64be62-3213-4442-a98a-c508bc35104b", TypeId="b924e0c1-3f23-4e37-9f27-90e945381304", Value="minio", Code="3", Sort=100, Remark="minio", Status=0 },
|
||||
new SysDictData{Id="cdc4a9ee-7436-4807-87cd-4350a72745b0", TypeId="b924e0c1-3f23-4e37-9f27-90e945381304", Value="本地", Code="4", Sort=100, Remark="本地", Status=0 },
|
||||
new SysDictData{Id="76e885e8-1b40-45b6-bb0f-5519c6839df2", TypeId="0f1b8660-d932-4a53-a681-a38bebae91e0", Value="运行", Code="1", Sort=100, Remark="运行", Status=0 },
|
||||
new SysDictData{Id="6e3591ec-2902-4bf3-b5a2-7ebc94ebc08f", TypeId="0f1b8660-d932-4a53-a681-a38bebae91e0", Value="停止", Code="2", Sort=100, Remark="停止", Status=0 },
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
48
Api/Ewide.Core/SeedData/SysDictTypeSeedData.cs
Normal file
48
Api/Ewide.Core/SeedData/SysDictTypeSeedData.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统字典类型种子数据
|
||||
/// </summary>
|
||||
public class SysDictTypeSeedData : IEntitySeedData<SysDictType>
|
||||
{
|
||||
/// <summary>
|
||||
/// 种子数据
|
||||
/// </summary>
|
||||
/// <param name="dbContext"></param>
|
||||
/// <param name="dbContextLocator"></param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<SysDictType> HasData(DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new SysDictType{Id="b0cfa91c-1189-4f39-bc5a-f035885d0604", Name="通用状态", Code="common_status", Sort=100, Remark="通用状态", Status=0 },
|
||||
new SysDictType{Id="301ed120-dfc5-4d7c-af59-b56a519581c9", Name="性别", Code="sex", Sort=100, Remark="性别字典", Status=0 },
|
||||
new SysDictType{Id="64afb5e7-9f00-4c4f-9ba6-6b41221bd862", Name="常量的分类", Code="consts_type", Sort=100, Remark="常量的分类,用于区别一组配置", Status=0 },
|
||||
new SysDictType{Id="f2f0e8bf-04da-4a2f-9fb8-1d6549227302", Name="是否", Code="yes_or_no", Sort=100, Remark="是否", Status=0 },
|
||||
new SysDictType{Id="2cecf329-cf95-44eb-a8d7-3fb77b13e093", Name="访问类型", Code="vis_type", Sort=100, Remark="访问类型", Status=0 },
|
||||
new SysDictType{Id="e973d383-c28e-42e0-9e23-5f2bd592fef5", Name="菜单类型", Code="menu_type", Sort=100, Remark="菜单类型", Status=0 },
|
||||
new SysDictType{Id="058db370-3718-42c3-8ba7-095341b1fe13", Name="发送类型", Code="send_type", Sort=100, Remark="发送类型", Status=0 },
|
||||
new SysDictType{Id="ff6202cb-25ce-4ab9-9c39-910c418b1d2d", Name="打开方式", Code="open_type", Sort=100, Remark="打开方式", Status=0 },
|
||||
new SysDictType{Id="b3235678-f7fe-442b-8fba-e792a89b78f2", Name="菜单权重", Code="menu_weight", Sort=100, Remark="菜单权重", Status=0 },
|
||||
new SysDictType{Id="a2068ed1-62a6-463c-b720-06111d994079", Name="数据范围类型", Code="data_scope_type", Sort=100, Remark="数据范围类型", Status=0 },
|
||||
new SysDictType{Id="688f9a69-ec95-46f4-87bb-e19e3cc5c7fc", Name="短信发送来源", Code="sms_send_source", Sort=100, Remark="短信发送来源", Status=0 },
|
||||
new SysDictType{Id="8461bd1d-311b-487e-b579-d6049c6fb191", Name="操作类型", Code="op_type", Sort=100, Remark="操作类型", Status=0 },
|
||||
new SysDictType{Id="b924e0c1-3f23-4e37-9f27-90e945381304", Name="文件存储位置", Code="file_storage_location", Sort=100, Remark="文件存储位置", Status=0 },
|
||||
new SysDictType{Id="0f1b8660-d932-4a53-a681-a38bebae91e0", Name="运行状态", Code="run_status", Sort=100, Remark="定时任务运行状态", Status=0 },
|
||||
new SysDictType{Id="d5b311fd-4b60-4b51-9156-b0e6d6cfa4d1", Name="通知公告类型", Code="notice_type", Sort=100, Remark="通知公告类型", Status=0 },
|
||||
new SysDictType{Id="b30937e6-03cd-4d98-a413-10b06d605e5a", Name="通知公告状态", Code="notice_status", Sort=100, Remark="通知公告状态", Status=0 },
|
||||
new SysDictType{Id="80aea9e7-ad1b-4f57-b4db-9d15813707bd", Name="是否boolean", Code="yes_true_false", Sort=100, Remark="是否boolean", Status=0 },
|
||||
new SysDictType{Id="430d0538-054a-4b37-a459-1095d0ccf4ae", Name="代码生成方式", Code="code_gen_create_type", Sort=100, Remark="代码生成方式", Status=0 },
|
||||
new SysDictType{Id="bc0dc25b-b85e-4dd1-8368-e014fe1bf30b", Name="请求方式", Code="request_type", Sort=100, Remark="请求方式", Status=0 },
|
||||
new SysDictType{Id="5bdf9b7a-a483-4b61-8e22-e2b25b255b91", Name="代码生成作用类型", Code="code_gen_effect_type", Sort=100, Remark="代码生成作用类型", Status=0 },
|
||||
new SysDictType{Id="41bc31f6-cef5-400d-b03a-bf51d27b2432", Name="代码生成查询类型", Code="code_gen_query_type", Sort=100, Remark="代码生成查询类型", Status=0 },
|
||||
new SysDictType{Id="28f653d4-e573-4f54-8e5c-4e308780145a", Name="代码生成.NET类型", Code="code_gen_net_type", Sort=100, Remark="代码生成.NET类型", Status=0 },
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
30
Api/Ewide.Core/SeedData/SysEmpPosSeedData.cs
Normal file
30
Api/Ewide.Core/SeedData/SysEmpPosSeedData.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统员工职位表种子数据
|
||||
/// </summary>
|
||||
public class SysEmpPosSeedData : IEntitySeedData<SysEmpPos>
|
||||
{
|
||||
/// <summary>
|
||||
/// 员工种子数据
|
||||
/// </summary>
|
||||
/// <param name="dbContext"></param>
|
||||
/// <param name="dbContextLocator"></param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<SysEmpPos> HasData(DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new SysEmpPos{SysEmpId="d0ead3dc-5096-4e15-bc6d-f640be5301ec", SysPosId="269236c4-d74e-4e54-9d50-f6f61580a197" },
|
||||
new SysEmpPos{SysEmpId="d0ead3dc-5096-4e15-bc6d-f640be5301ec", SysPosId="46c68a62-f119-4ff7-b621-0bbd77504538" },
|
||||
new SysEmpPos{SysEmpId="5398fb9a-2209-4ce7-a2c1-b6a983e502b5", SysPosId="5bd8c466-2bca-4386-a551-daac78e3cee8" },
|
||||
new SysEmpPos{SysEmpId="16a74726-e156-499f-9942-0e0e24ad0c3f", SysPosId="269236c4-d74e-4e54-9d50-f6f61580a197" }
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
29
Api/Ewide.Core/SeedData/SysEmpSeedData.cs
Normal file
29
Api/Ewide.Core/SeedData/SysEmpSeedData.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统员工表种子数据
|
||||
/// </summary>
|
||||
public class SysEmpSeedData : IEntitySeedData<SysEmp>
|
||||
{
|
||||
/// <summary>
|
||||
/// 员工种子数据
|
||||
/// </summary>
|
||||
/// <param name="dbContext"></param>
|
||||
/// <param name="dbContextLocator"></param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<SysEmp> HasData(DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new SysEmp{Id="d0ead3dc-5096-4e15-bc6d-f640be5301ec", JobNum="D1001", OrgId="12d888de-f55d-4c88-b0a0-7c3510664d97", OrgName="华夏集团" },//142307070910551
|
||||
new SysEmp{Id="5398fb9a-2209-4ce7-a2c1-b6a983e502b5", JobNum="D1002", OrgId="12d888de-f55d-4c88-b0a0-7c3510664d97", OrgName="华夏集团" },//142307070910552
|
||||
new SysEmp{Id="16a74726-e156-499f-9942-0e0e24ad0c3f", JobNum="D1003", OrgId="12d888de-f55d-4c88-b0a0-7c3510664d97", OrgName="华夏集团" }//142307070910553
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
179
Api/Ewide.Core/SeedData/SysMenuSeedData.cs
Normal file
179
Api/Ewide.Core/SeedData/SysMenuSeedData.cs
Normal file
@@ -0,0 +1,179 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统菜单表种子数据
|
||||
/// </summary>
|
||||
public class SysMenuSeedData : IEntitySeedData<SysMenu>
|
||||
{
|
||||
/// <summary>
|
||||
/// 种子数据
|
||||
/// </summary>
|
||||
/// <param name="dbContext"></param>
|
||||
/// <param name="dbContextLocator"></param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<SysMenu> HasData(DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new SysMenu{Id="83ce02c9-b37f-4885-96e3-9b34371edb2e", Pid="00000000-0000-0000-0000-000000000000", Pids="[00000000-0000-0000-0000-000000000000],", Name="主控面板", Code="system_index", Type=0, Icon="home", Router="/", Component="RouteView", Application="system", OpenType=0, Visible=true, Redirect="/analysis", Weight=1, Sort=1, Status=0 },
|
||||
new SysMenu{Id="914a520d-9e4f-465b-ae05-7248b37d4be1", Pid="83ce02c9-b37f-4885-96e3-9b34371edb2e", Pids="[00000000-0000-0000-0000-000000000000],[83ce02c9-b37f-4885-96e3-9b34371edb2e],", Name="分析页", Code="system_index_dashboard", Type=1, Router="analysis", Component="system/dashboard/Analysis", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="72981ad9-9036-4aa7-b8f4-dc407eda50b4", Pid="83ce02c9-b37f-4885-96e3-9b34371edb2e", Pids="[00000000-0000-0000-0000-000000000000],[83ce02c9-b37f-4885-96e3-9b34371edb2e],", Name="工作台", Code="system_index_workplace", Type=1, Router="workplace", Component="system/dashboard/Workplace", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="f7d60a3f-2de3-4dca-a1d6-385cee9638bc", Pid="00000000-0000-0000-0000-000000000000", Pids="[00000000-0000-0000-0000-000000000000],", Name="组织架构", Code="sys_mgr", Type=0, Icon="team", Router="/sys", Component="PageView", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="9f1f6051-15e6-474f-ab40-ab98a8713f7b", Pid="f7d60a3f-2de3-4dca-a1d6-385cee9638bc", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],", Name="用户管理", Code="sys_user_mgr", Type=1, Router="/mgr_user", Component="system/user/index", Application="system", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="bff7e542-6463-4f82-a03d-b1022e60d4b6", Pid="9f1f6051-15e6-474f-ab40-ab98a8713f7b", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9f1f6051-15e6-474f-ab40-ab98a8713f7b],", Name="用户查询", Code="sys_user_mgr_page", Type=2, Permission="sysUser:page", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="936440c7-93ef-4d2f-adff-6151f4317355", Pid="9f1f6051-15e6-474f-ab40-ab98a8713f7b", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9f1f6051-15e6-474f-ab40-ab98a8713f7b],", Name="用户编辑", Code="sys_user_mgr_edit", Type=2, Permission="sysUser:edit", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="281888e3-d183-4711-ba27-298ef6e64659", Pid="9f1f6051-15e6-474f-ab40-ab98a8713f7b", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9f1f6051-15e6-474f-ab40-ab98a8713f7b],", Name="用户增加", Code="sys_user_mgr_add", Type=2, Permission="sysUser:add", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0},
|
||||
new SysMenu{Id="e4aff800-d34a-416b-bd6e-dcebaa1dd436", Pid="9f1f6051-15e6-474f-ab40-ab98a8713f7b", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9f1f6051-15e6-474f-ab40-ab98a8713f7b],", Name="用户删除", Code="sys_user_mgr_delete", Type=2, Permission="sysUser:delete", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0},
|
||||
new SysMenu{Id="7a266494-e17b-480d-8f50-cc234e6fe424", Pid="9f1f6051-15e6-474f-ab40-ab98a8713f7b", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9f1f6051-15e6-474f-ab40-ab98a8713f7b],", Name="用户详情", Code="sys_user_mgr_detail", Type=2, Permission="sysUser:detail", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="0d93f763-20d3-4c95-add3-3d94770b110e", Pid="9f1f6051-15e6-474f-ab40-ab98a8713f7b", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9f1f6051-15e6-474f-ab40-ab98a8713f7b],", Name="用户导出", Code="sys_user_mgr_export", Type=2, Permission="sysUser:export", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="17d047c3-6e95-4f7d-93db-97817d886fa2", Pid="9f1f6051-15e6-474f-ab40-ab98a8713f7b", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9f1f6051-15e6-474f-ab40-ab98a8713f7b],", Name="用户选择器", Code="sys_user_mgr_selector", Type=2, Permission="sysUser:selector", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="5fc44256-2e56-4805-9382-b5504ca5b6cb", Pid="9f1f6051-15e6-474f-ab40-ab98a8713f7b", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9f1f6051-15e6-474f-ab40-ab98a8713f7b],", Name="用户授权角色", Code="sys_user_mgr_grant_role", Type=2, Permission="sysUser:grantRole", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="ceff7899-6779-4708-b9ed-a2d5b488cff2", Pid="9f1f6051-15e6-474f-ab40-ab98a8713f7b", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9f1f6051-15e6-474f-ab40-ab98a8713f7b],", Name="用户拥有角色", Code="sys_user_mgr_own_role", Type=2, Permission="sysUser:ownRole", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="38ba9ccc-eb96-4a60-a5ab-f6ea013f8291", Pid="9f1f6051-15e6-474f-ab40-ab98a8713f7b", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9f1f6051-15e6-474f-ab40-ab98a8713f7b],", Name="用户授权数据", Code="sys_user_mgr_grant_data", Type=2, Permission="sysUser:grantData", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="cf2f8faf-b280-456c-8865-64115e04019f", Pid="9f1f6051-15e6-474f-ab40-ab98a8713f7b", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9f1f6051-15e6-474f-ab40-ab98a8713f7b],", Name="用户拥有数据", Code="sys_user_mgr_own_data", Type=2, Permission="sysUser:ownData", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="711563e5-fed6-44d6-bcf3-138c73cfbfca", Pid="9f1f6051-15e6-474f-ab40-ab98a8713f7b", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9f1f6051-15e6-474f-ab40-ab98a8713f7b],", Name="用户更新信息", Code="sys_user_mgr_update_info", Type=2, Permission="sysUser:updateInfo", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="306fe9bf-3132-4011-9f3f-1a2f4ead7734", Pid="9f1f6051-15e6-474f-ab40-ab98a8713f7b", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9f1f6051-15e6-474f-ab40-ab98a8713f7b],", Name="用户修改密码", Code="sys_user_mgr_update_pwd", Type=2, Permission="sysUser:updatePwd", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="791b0d88-7e25-490f-a94f-a2e32bb3b6e6", Pid="9f1f6051-15e6-474f-ab40-ab98a8713f7b", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9f1f6051-15e6-474f-ab40-ab98a8713f7b],", Name="用户修改状态", Code="sys_user_mgr_change_status", Type=2, Permission="sysUser:changeStatus", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="9d681aac-528a-46b0-9718-ffc4abe9c29e", Pid="9f1f6051-15e6-474f-ab40-ab98a8713f7b", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9f1f6051-15e6-474f-ab40-ab98a8713f7b],", Name="用户修改头像", Code="sys_user_mgr_update_avatar", Type=2, Permission="sysUser:updateAvatar", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0},
|
||||
new SysMenu{Id="471b5259-5f55-4643-841c-f07089cfafdf", Pid="9f1f6051-15e6-474f-ab40-ab98a8713f7b", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9f1f6051-15e6-474f-ab40-ab98a8713f7b],", Name="用户重置密码", Code="sys_user_mgr_reset_pwd", Type=2, Permission="sysUser:resetPwd", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="471d3098-90a4-47e1-bd07-5d3ed8d21fb0", Pid="9f1f6051-15e6-474f-ab40-ab98a8713f7b", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9f1f6051-15e6-474f-ab40-ab98a8713f7b],", Name="用户登录信息", Code="sys_user_mgr_login", Type=2, Permission="getLoginUser", Application="system", OpenType=0, Visible=false, Weight=1, Sort=100, Status=CommonStatus.DISABLE },
|
||||
new SysMenu{Id="9c1b34f3-2412-496a-a42e-e4f6ae407ae1", Pid="f7d60a3f-2de3-4dca-a1d6-385cee9638bc", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],", Name="机构管理", Code="sys_org_mgr", Type=1, Router="/org", Component="system/org/index", Application="system", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="b7c34c9b-933e-4c48-b1d0-af15a1f7da1f", Pid="9c1b34f3-2412-496a-a42e-e4f6ae407ae1", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9c1b34f3-2412-496a-a42e-e4f6ae407ae1],", Name="机构查询", Code="sys_org_mgr_page", Type=2, Permission="sysOrg:page", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="917064b2-c715-4fa4-9b2d-20a11b784ed1", Pid="9c1b34f3-2412-496a-a42e-e4f6ae407ae1", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9c1b34f3-2412-496a-a42e-e4f6ae407ae1],", Name="机构列表", Code="sys_org_mgr_list", Type=2, Permission="sysOrg:list", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="d7c18d60-f28f-4a57-90b3-26fc95249ae0", Pid="9c1b34f3-2412-496a-a42e-e4f6ae407ae1", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9c1b34f3-2412-496a-a42e-e4f6ae407ae1],", Name="机构增加", Code="sys_org_mgr_add", Type=2, Permission="sysOrg:add", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="e65eb1e3-cc9e-4309-8c7a-9ac41765b239", Pid="9c1b34f3-2412-496a-a42e-e4f6ae407ae1", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9c1b34f3-2412-496a-a42e-e4f6ae407ae1],", Name="机构编辑", Code="sys_org_mgr_edit", Type=2, Permission="sysOrg:edit", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="c2450c4c-89c6-46e8-8f89-11331790cbe3", Pid="9c1b34f3-2412-496a-a42e-e4f6ae407ae1", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9c1b34f3-2412-496a-a42e-e4f6ae407ae1],", Name="机构删除", Code="sys_org_mgr_delete", Type=2, Permission="sysOrg:delete", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0},
|
||||
new SysMenu{Id="695a6018-82c3-466e-a2a1-dab16039bfdb", Pid="9c1b34f3-2412-496a-a42e-e4f6ae407ae1", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9c1b34f3-2412-496a-a42e-e4f6ae407ae1],", Name="机构详情", Code="sys_org_mgr_detail", Type=2, Permission="sysOrg:detail", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="2d153046-279b-43be-8f57-46875118fd2c", Pid="9c1b34f3-2412-496a-a42e-e4f6ae407ae1", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[9c1b34f3-2412-496a-a42e-e4f6ae407ae1],", Name="机构树", Code="sys_org_mgr_tree", Type=2, Permission="sysOrg:tree", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0},
|
||||
new SysMenu{Id="0f60d129-9d3b-42b5-9eb2-99bc066be6aa", Pid="f7d60a3f-2de3-4dca-a1d6-385cee9638bc", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],", Name="职位管理", Code="sys_pos_mgr", Type=1, Router="/pos", Component="system/pos/index", Application="system", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0},
|
||||
new SysMenu{Id="d2436601-bc48-4610-ba67-5b666f8ce33a", Pid="0f60d129-9d3b-42b5-9eb2-99bc066be6aa", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[0f60d129-9d3b-42b5-9eb2-99bc066be6aa],", Name="职位查询", Code="sys_pos_mgr_page", Type=2, Permission="sysPos:page", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="1305efaa-b81a-475f-9dde-8f6549ca7743", Pid="0f60d129-9d3b-42b5-9eb2-99bc066be6aa", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[0f60d129-9d3b-42b5-9eb2-99bc066be6aa],", Name="职位列表", Code="sys_pos_mgr_list", Type=2, Permission="sysPos:list", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="c227e732-f231-4488-89b0-d1c9dad78950", Pid="0f60d129-9d3b-42b5-9eb2-99bc066be6aa", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[0f60d129-9d3b-42b5-9eb2-99bc066be6aa],", Name="职位增加", Code="sys_pos_mgr_add", Type=2, Permission="sysPos:add", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="9dafbe04-83c9-482c-9c83-81f4da045da5", Pid="0f60d129-9d3b-42b5-9eb2-99bc066be6aa", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[0f60d129-9d3b-42b5-9eb2-99bc066be6aa],", Name="职位编辑", Code="sys_pos_mgr_edit", Type=2, Permission="sysPos:edit", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0},
|
||||
new SysMenu{Id="031df05e-b7c6-4ecd-aff2-f189c994e86d", Pid="0f60d129-9d3b-42b5-9eb2-99bc066be6aa", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[0f60d129-9d3b-42b5-9eb2-99bc066be6aa],", Name="职位删除", Code="sys_pos_mgr_delete", Type=2, Permission="sysPos:delete", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="fe5ee8a1-2145-43c6-bdeb-518f3a9c127d", Pid="0f60d129-9d3b-42b5-9eb2-99bc066be6aa", Pids="[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[0f60d129-9d3b-42b5-9eb2-99bc066be6aa],", Name="职位详情", Code="sys_pos_mgr_detail", Type=2, Permission="sysPos:detail", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="4c00d8c1-e871-4231-8b46-a3e3f3fd400c", Pid="00000000-0000-0000-0000-000000000000", Pids="[00000000-0000-0000-0000-000000000000],", Name="权限管理", Code="auth_manager", Type=0, Icon="safety-certificate", Router="/auth", Component="PageView", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="05175bfd-6e5f-4c3b-8daf-0f79df4e9694", Pid="4c00d8c1-e871-4231-8b46-a3e3f3fd400c", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],", Name="应用管理", Code="sys_app_mgr", Type=1, Router="/app", Component="system/app/index", Application="system", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="dbaa7a6d-234f-4cc9-977f-4544b8bb45b8", Pid="05175bfd-6e5f-4c3b-8daf-0f79df4e9694", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[05175bfd-6e5f-4c3b-8daf-0f79df4e9694],", Name="应用查询", Code="sys_app_mgr_page", Type=2, Permission="sysApp:page", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="ab7b2b41-b0bc-4b9c-9017-f5c6918e393e", Pid="05175bfd-6e5f-4c3b-8daf-0f79df4e9694", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[05175bfd-6e5f-4c3b-8daf-0f79df4e9694],", Name="应用列表", Code="sys_app_mgr_list", Type=2, Permission="sysApp:list", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="f4e1d63b-5d92-46eb-82aa-267335a5a3f3", Pid="05175bfd-6e5f-4c3b-8daf-0f79df4e9694", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[05175bfd-6e5f-4c3b-8daf-0f79df4e9694],", Name="应用增加", Code="sys_app_mgr_add", Type=2, Permission="sysApp:add", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="f33a3791-1c01-4d30-bcc3-d9fdf5246376", Pid="05175bfd-6e5f-4c3b-8daf-0f79df4e9694", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[05175bfd-6e5f-4c3b-8daf-0f79df4e9694],", Name="应用编辑", Code="sys_app_mgr_edit", Type=2, Permission="sysApp:edit", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="e0a6cf90-0a8b-44e4-a32f-5f43ef996b82", Pid="05175bfd-6e5f-4c3b-8daf-0f79df4e9694", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[05175bfd-6e5f-4c3b-8daf-0f79df4e9694],", Name="应用删除", Code="sys_app_mgr_delete", Type=2, Permission="sysApp:delete", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="a0abe974-5ae9-440b-9d16-2412eab52d70", Pid="05175bfd-6e5f-4c3b-8daf-0f79df4e9694", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[05175bfd-6e5f-4c3b-8daf-0f79df4e9694],", Name="应用详情", Code="sys_app_mgr_detail", Type=2, Permission="sysApp:detail", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="f640e243-b439-4109-8aea-c66205ef6b12", Pid="05175bfd-6e5f-4c3b-8daf-0f79df4e9694", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[05175bfd-6e5f-4c3b-8daf-0f79df4e9694],", Name="设为默认应用", Code="sys_app_mgr_set_as_default", Type=2, Permission="sysApp:setAsDefault", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="babff4e1-dd00-4e6b-909a-3aac76bb52cd", Pid="4c00d8c1-e871-4231-8b46-a3e3f3fd400c", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],", Name="菜单管理", Code="sys_menu_mgr", Type=1, Router="/menu", Component="system/menu/index", Application="system", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0},
|
||||
new SysMenu{Id="e9982e73-1833-4674-9403-ee3dee2efdf7", Pid="babff4e1-dd00-4e6b-909a-3aac76bb52cd", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[babff4e1-dd00-4e6b-909a-3aac76bb52cd],", Name="菜单列表", Code="sys_menu_mgr_list", Type=2, Permission="sysMenu:list", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="758e15e6-75a6-4b72-8f94-5da379e53354", Pid="babff4e1-dd00-4e6b-909a-3aac76bb52cd", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[babff4e1-dd00-4e6b-909a-3aac76bb52cd],", Name="菜单增加", Code="sys_menu_mgr_add", Type=2, Permission="sysMenu:add", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="07139c19-6b39-49f5-9e22-c4dc7e9d947b", Pid="babff4e1-dd00-4e6b-909a-3aac76bb52cd", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[babff4e1-dd00-4e6b-909a-3aac76bb52cd],", Name="菜单编辑", Code="sys_menu_mgr_edit", Type=2, Permission="sysMenu:edit", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="857fb581-78ff-4884-a6fb-8dfb4951fef9", Pid="babff4e1-dd00-4e6b-909a-3aac76bb52cd", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[babff4e1-dd00-4e6b-909a-3aac76bb52cd],", Name="菜单删除", Code="sys_menu_mgr_delete", Type=2, Permission="sysMenu:delete", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="cd43a8ee-9f98-4355-bf81-ba40f388b23f", Pid="babff4e1-dd00-4e6b-909a-3aac76bb52cd", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[babff4e1-dd00-4e6b-909a-3aac76bb52cd],", Name="菜单详情", Code="sys_menu_mgr_detail", Type=2, Permission="sysMenu:detail", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="ec318997-596d-403a-91be-f303b234b02d", Pid="babff4e1-dd00-4e6b-909a-3aac76bb52cd", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[babff4e1-dd00-4e6b-909a-3aac76bb52cd],", Name="菜单授权树", Code="sys_menu_mgr_grant_tree", Type=2, Permission="sysMenu:treeForGrant", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="3892ef5d-39b2-4a4d-8047-cb96542fb54f", Pid="babff4e1-dd00-4e6b-909a-3aac76bb52cd", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[babff4e1-dd00-4e6b-909a-3aac76bb52cd],", Name="菜单树", Code="sys_menu_mgr_tree", Type=2, Permission="sysMenu:tree", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="00831a3b-d080-411f-afb9-9f415334b192", Pid="babff4e1-dd00-4e6b-909a-3aac76bb52cd", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[babff4e1-dd00-4e6b-909a-3aac76bb52cd],", Name="菜单切换", Code="sys_menu_mgr_change", Type=2, Permission="sysMenu:change", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="ee63be7b-5d06-4c15-81f3-875e2eb164dd", Pid="4c00d8c1-e871-4231-8b46-a3e3f3fd400c", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],", Name="角色管理", Code="sys_role_mgr", Type=1, Router="/role", Component="system/role/index", Application="system", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0},
|
||||
new SysMenu{Id="4241f4a0-89ab-4a6a-80bb-2830f855d3be", Pid="ee63be7b-5d06-4c15-81f3-875e2eb164dd", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[ee63be7b-5d06-4c15-81f3-875e2eb164dd],", Name="角色查询", Code="sys_role_mgr_page", Type=2, Permission="sysRole:page", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="6a48beb1-c828-43d6-af3d-3e18ef163070", Pid="ee63be7b-5d06-4c15-81f3-875e2eb164dd", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[ee63be7b-5d06-4c15-81f3-875e2eb164dd],", Name="角色增加", Code="sys_role_mgr_add", Type=2, Permission="sysRole:add", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="1198a602-a23d-4a06-aa9a-76aaf5f065a7", Pid="ee63be7b-5d06-4c15-81f3-875e2eb164dd", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[ee63be7b-5d06-4c15-81f3-875e2eb164dd],", Name="角色编辑", Code="sys_role_mgr_edit", Type=2, Permission="sysRole:edit", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="e7708eeb-2c87-4c3d-bc71-c395e5d708db", Pid="ee63be7b-5d06-4c15-81f3-875e2eb164dd", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[ee63be7b-5d06-4c15-81f3-875e2eb164dd],", Name="角色删除", Code="sys_role_mgr_delete", Type=2, Permission="sysRole:delete", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="63ab477f-88fb-4f4b-9dcd-0cb83ac767f6", Pid="ee63be7b-5d06-4c15-81f3-875e2eb164dd", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[ee63be7b-5d06-4c15-81f3-875e2eb164dd],", Name="角色详情", Code="sys_role_mgr_detail", Type=2, Permission="sysRole:detail", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="2622348c-dd8f-4ade-a350-de0a8f01e1f6", Pid="ee63be7b-5d06-4c15-81f3-875e2eb164dd", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[ee63be7b-5d06-4c15-81f3-875e2eb164dd],", Name="角色下拉", Code="sys_role_mgr_drop_down", Type=2, Permission="sysRole:dropDown", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="73d84863-b381-40be-84bc-ec8381fa6c0a", Pid="ee63be7b-5d06-4c15-81f3-875e2eb164dd", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[ee63be7b-5d06-4c15-81f3-875e2eb164dd],", Name="角色授权菜单", Code="sys_role_mgr_grant_menu", Type=2, Permission="sysRole:grantMenu", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="bbc5e792-3d72-4d0d-8ddb-25cf2c4e1374", Pid="ee63be7b-5d06-4c15-81f3-875e2eb164dd", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[ee63be7b-5d06-4c15-81f3-875e2eb164dd],", Name="角色拥有菜单", Code="sys_role_mgr_own_menu", Type=2, Permission="sysRole:ownMenu", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="19234814-6007-484c-818c-88a664a2a339", Pid="ee63be7b-5d06-4c15-81f3-875e2eb164dd", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[ee63be7b-5d06-4c15-81f3-875e2eb164dd],", Name="角色授权数据", Code="sys_role_mgr_grant_data", Type=2, Permission="sysRole:grantData", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="19e5c5f6-b598-4c42-8eed-3d46fb11b465", Pid="ee63be7b-5d06-4c15-81f3-875e2eb164dd", Pids="[00000000-0000-0000-0000-000000000000],[4c00d8c1-e871-4231-8b46-a3e3f3fd400c],[ee63be7b-5d06-4c15-81f3-875e2eb164dd],", Name="角色拥有数据", Code="sys_role_mgr_own_data", Type=2, Permission="sysRole:ownData", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="ac0ee878-f713-4a77-9c8f-6e1ee1f4484e", Pid="00000000-0000-0000-0000-000000000000", Pids="[00000000-0000-0000-0000-000000000000],", Name="开发管理", Code="system_tools", Type=0, Icon="euro", Router="/tools", Component="PageView", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="abf3e33d-3d6a-4bbd-8743-179df5a95d48", Pid="ac0ee878-f713-4a77-9c8f-6e1ee1f4484e", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],", Name="系统配置", Code="system_tools_config", Type=1, Router="/config", Component="system/config/index", Application="system", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="c14c82bd-632d-4cc9-9236-37aa64b15ecf", Pid="abf3e33d-3d6a-4bbd-8743-179df5a95d48", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[abf3e33d-3d6a-4bbd-8743-179df5a95d48],", Name="配置查询", Code="system_tools_config_page", Type=2, Permission="sysConfig:page", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="78d31d68-9c9b-4e02-94c9-8a74eea4c1fb", Pid="abf3e33d-3d6a-4bbd-8743-179df5a95d48", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[abf3e33d-3d6a-4bbd-8743-179df5a95d48],", Name="配置列表", Code="system_tools_config_list", Type=2, Permission="sysConfig:list", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="fc91afb5-2b9e-428b-b5ff-b0ef35dd5336", Pid="abf3e33d-3d6a-4bbd-8743-179df5a95d48", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[abf3e33d-3d6a-4bbd-8743-179df5a95d48],", Name="配置增加", Code="system_tools_config_add", Type=2, Permission="sysConfig:add", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="1efb72e8-3449-490a-92e0-308b124c338f", Pid="abf3e33d-3d6a-4bbd-8743-179df5a95d48", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[abf3e33d-3d6a-4bbd-8743-179df5a95d48],", Name="配置编辑", Code="system_tools_config_edit", Type=2, Permission="sysConfig:edit", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="5760230f-e6fc-4c3d-ba38-1c8a5a923eb3", Pid="abf3e33d-3d6a-4bbd-8743-179df5a95d48", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[abf3e33d-3d6a-4bbd-8743-179df5a95d48],", Name="配置删除", Code="system_tools_config_delete", Type=2, Permission="sysConfig:delete", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="6bfc0c53-5d6c-437c-9757-bc79e664d0f5", Pid="abf3e33d-3d6a-4bbd-8743-179df5a95d48", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[abf3e33d-3d6a-4bbd-8743-179df5a95d48],", Name="配置详情", Code="system_tools_config_detail", Type=2, Permission="sysConfig:detail", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="f7fe47a3-86b2-4660-9920-0c9836755666", Pid="abf3e33d-3d6a-4bbd-8743-179df5a95d48", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[abf3e33d-3d6a-4bbd-8743-179df5a95d48],", Name="设为默认应用", Code="sys_app_mgr_set_as_default", Type=2, Permission="sysApp:setAsDefault", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="cde43456-baae-4e9b-b6f9-b0ea9ab49adb", Pid="ac0ee878-f713-4a77-9c8f-6e1ee1f4484e", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],", Name="邮件发送", Code="sys_email_mgr", Type=1, Router="/email", Component="system/email/index", Application="system", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0},
|
||||
new SysMenu{Id="4d4cf5b3-bd4c-4f17-9fb2-47b28b00681f", Pid="cde43456-baae-4e9b-b6f9-b0ea9ab49adb", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[cde43456-baae-4e9b-b6f9-b0ea9ab49adb],", Name="发送文本邮件", Code="sys_email_mgr_send_email", Type=2, Permission="email:sendEmail", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="51e45073-1461-4b3b-ae06-d0d3dcf222e0", Pid="cde43456-baae-4e9b-b6f9-b0ea9ab49adb", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[cde43456-baae-4e9b-b6f9-b0ea9ab49adb],", Name="发送html邮件", Code="sys_email_mgr_send_email_html", Type=2, Permission="email:sendEmailHtml", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="e571a1c9-8b43-459f-9dc6-1dcf967627b7", Pid="ac0ee878-f713-4a77-9c8f-6e1ee1f4484e", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],", Name="短信管理", Code="sys_sms_mgr", Type=1, Router="/sms", Component="system/sms/index", Application="system", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0},
|
||||
new SysMenu{Id="2afa4925-b927-457e-88a1-d215b7d75fb6", Pid="e571a1c9-8b43-459f-9dc6-1dcf967627b7", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[e571a1c9-8b43-459f-9dc6-1dcf967627b7],", Name="短信发送查询", Code="sys_sms_mgr_page", Type=2, Permission="sms:page", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="97c1b073-5e19-4542-89e2-d8da44d0f1df", Pid="e571a1c9-8b43-459f-9dc6-1dcf967627b7", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[e571a1c9-8b43-459f-9dc6-1dcf967627b7],", Name="发送验证码短信", Code="sys_sms_mgr_send_login_message", Type=2, Permission="sms:sendLoginMessage", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="d2454bd2-f300-4b28-95c0-12432c28cbdf", Pid="e571a1c9-8b43-459f-9dc6-1dcf967627b7", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[e571a1c9-8b43-459f-9dc6-1dcf967627b7],", Name="验证短信验证码", Code="sys_sms_mgr_validate_message", Type=2, Permission="sms:validateMessage", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="477739a3-53d8-4f9b-ba32-f6dda79ec8a8", Pid="ac0ee878-f713-4a77-9c8f-6e1ee1f4484e", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],", Name="字典管理", Code="sys_dict_mgr", Type=1, Router="/dict", Component="system/dict/index", Application="system", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0},
|
||||
new SysMenu{Id="70c5e8c5-6104-4e53-99c0-4743e557456b", Pid="477739a3-53d8-4f9b-ba32-f6dda79ec8a8", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[477739a3-53d8-4f9b-ba32-f6dda79ec8a8],", Name="字典类型查询", Code="sys_dict_mgr_dict_type_page", Type=2, Permission="sysDictType:page", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="1bd1d982-e05a-4bdc-a4e0-752d94f3196c", Pid="477739a3-53d8-4f9b-ba32-f6dda79ec8a8", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[477739a3-53d8-4f9b-ba32-f6dda79ec8a8],", Name="字典类型列表", Code="sys_dict_mgr_dict_type_list", Type=2, Permission="sysDictType:list", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="bd09b023-0884-4f31-8cf7-f66f789fa3db", Pid="477739a3-53d8-4f9b-ba32-f6dda79ec8a8", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[477739a3-53d8-4f9b-ba32-f6dda79ec8a8],", Name="字典类型增加", Code="sys_dict_mgr_dict_type_add", Type=2, Permission="sysDictType:add", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="1f7a41ff-5a46-449c-81f3-1618dfdcb4cd", Pid="477739a3-53d8-4f9b-ba32-f6dda79ec8a8", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[477739a3-53d8-4f9b-ba32-f6dda79ec8a8],", Name="字典类型删除", Code="sys_dict_mgr_dict_type_delete", Type=2, Permission="sysDictType:delete", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="2381cde4-2174-47e7-a1e5-e58da70e7a11", Pid="477739a3-53d8-4f9b-ba32-f6dda79ec8a8", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[477739a3-53d8-4f9b-ba32-f6dda79ec8a8],", Name="字典类型编辑", Code="sys_dict_mgr_dict_type_edit", Type=2, Permission="sysDictType:edit", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="8f7d3c74-8800-4922-9662-ac6af378c882", Pid="477739a3-53d8-4f9b-ba32-f6dda79ec8a8", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[477739a3-53d8-4f9b-ba32-f6dda79ec8a8],", Name="字典类型详情", Code="sys_dict_mgr_dict_type_detail", Type=2, Permission="sysDictType:detail", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="4f87b6de-be62-4398-b680-1f8611f2cd70", Pid="477739a3-53d8-4f9b-ba32-f6dda79ec8a8", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[477739a3-53d8-4f9b-ba32-f6dda79ec8a8],", Name="字典类型下拉", Code="sys_dict_mgr_dict_type_drop_down", Type=2, Permission="sysDictType:dropDown", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="07c799b2-e8e9-4955-83da-97560f161d87", Pid="477739a3-53d8-4f9b-ba32-f6dda79ec8a8", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[477739a3-53d8-4f9b-ba32-f6dda79ec8a8],", Name="字典类型修改状态", Code="sys_dict_mgr_dict_type_change_status", Type=2, Permission="sysDictType:changeStatus", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="29be8e3c-c2bb-4162-b282-fdf58c218b9d", Pid="477739a3-53d8-4f9b-ba32-f6dda79ec8a8", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[477739a3-53d8-4f9b-ba32-f6dda79ec8a8],", Name="字典值查询", Code="sys_dict_mgr_dict_page", Type=2, Permission="sysDictData:page", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="b8cbc4e1-ac10-4cda-b1e4-f816a2632d02", Pid="477739a3-53d8-4f9b-ba32-f6dda79ec8a8", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[477739a3-53d8-4f9b-ba32-f6dda79ec8a8],", Name="字典值列表", Code="sys_dict_mgr_dict_list", Type=2, Permission="sysDictData:list", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="54e97bde-94d6-42df-89e3-4c3ace153b22", Pid="477739a3-53d8-4f9b-ba32-f6dda79ec8a8", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[477739a3-53d8-4f9b-ba32-f6dda79ec8a8],", Name="字典值增加", Code="sys_dict_mgr_dict_add", Type=2, Permission="sysDictData:add", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="be98da08-a3b0-463c-8208-05d843620258", Pid="477739a3-53d8-4f9b-ba32-f6dda79ec8a8", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[477739a3-53d8-4f9b-ba32-f6dda79ec8a8],", Name="字典值删除", Code="sys_dict_mgr_dict_delete", Type=2, Permission="sysDictData:delete", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="38809fc3-163f-4fe9-a488-c9bb5bce752a", Pid="477739a3-53d8-4f9b-ba32-f6dda79ec8a8", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[477739a3-53d8-4f9b-ba32-f6dda79ec8a8],", Name="字典值编辑", Code="sys_dict_mgr_dict_edit", Type=2, Permission="sysDictData:edit", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="fc511b42-f0a1-489b-8418-7ef94b0fb374", Pid="477739a3-53d8-4f9b-ba32-f6dda79ec8a8", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[477739a3-53d8-4f9b-ba32-f6dda79ec8a8],", Name="字典值详情", Code="sys_role_mgr_grant_data", Type=2, Permission="sysDictData:detail", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="200428b3-1605-4c70-b840-e691e302ae69", Pid="477739a3-53d8-4f9b-ba32-f6dda79ec8a8", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],[477739a3-53d8-4f9b-ba32-f6dda79ec8a8],", Name="字典值修改状态", Code="sys_dict_mgr_dict_change_status", Type=2, Permission="sysDictData:changeStatus", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="d40f424d-d5fc-4b86-a2bd-3a5a76076bc1", Pid="ac0ee878-f713-4a77-9c8f-6e1ee1f4484e", Pids="[00000000-0000-0000-0000-000000000000],[ac0ee878-f713-4a77-9c8f-6e1ee1f4484e],", Name="接口文档", Code="sys_swagger_mgr", Type=1, Router="/swagger", Component="Iframe", Application="system", OpenType=2, Visible=true, Link="http://127.0.0.1:5566/", Weight=1, Sort=100, Status=0},
|
||||
new SysMenu{Id="eec4563e-9307-4ccd-ac3a-93598badb195", Pid="00000000-0000-0000-0000-000000000000", Pids="[00000000-0000-0000-0000-000000000000],", Name="日志管理", Code="sys_log_mgr", Type=0, Icon="read", Router="/log", Component="PageView", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="322b2cb6-df29-483b-b011-54dce1532fae", Pid="eec4563e-9307-4ccd-ac3a-93598badb195", Pids="[00000000-0000-0000-0000-000000000000],[eec4563e-9307-4ccd-ac3a-93598badb195],", Name="访问日志", Code="sys_log_mgr_vis_log", Type=1, Router="/vislog", Component="system/log/vislog/index", Application="system", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="122641c1-ab6d-4f91-9527-16fc8fea9708", Pid="322b2cb6-df29-483b-b011-54dce1532fae", Pids="[00000000-0000-0000-0000-000000000000],[eec4563e-9307-4ccd-ac3a-93598badb195],[322b2cb6-df29-483b-b011-54dce1532fae],", Name="访问日志查询", Code="sys_log_mgr_vis_log_page", Type=2, Permission="sysVisLog:page", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="f2367804-6382-4e72-8282-e4f6f988ecd1", Pid="322b2cb6-df29-483b-b011-54dce1532fae", Pids="[00000000-0000-0000-0000-000000000000],[eec4563e-9307-4ccd-ac3a-93598badb195],[322b2cb6-df29-483b-b011-54dce1532fae],", Name="访问日志清空", Code="sys_log_mgr_vis_log_delete", Type=2, Permission="sysVisLog:delete", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="1a1a13cb-f9a9-4ffe-924d-d523db79f7bf", Pid="eec4563e-9307-4ccd-ac3a-93598badb195", Pids="[00000000-0000-0000-0000-000000000000],[eec4563e-9307-4ccd-ac3a-93598badb195],", Name="操作日志", Code="sys_log_mgr_op_log", Type=1, Router="/oplog", Component="system/log/oplog/index", Application="system", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0},
|
||||
new SysMenu{Id="7f44f49e-6458-4149-bbcd-9a937f552cec", Pid="1a1a13cb-f9a9-4ffe-924d-d523db79f7bf", Pids="[00000000-0000-0000-0000-000000000000],[eec4563e-9307-4ccd-ac3a-93598badb195],[1a1a13cb-f9a9-4ffe-924d-d523db79f7bf],", Name="操作日志查询", Code="sys_log_mgr_op_log_page", Type=2, Permission="sysOpLog:page", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="263e0c00-2796-411c-9f50-0aa361f7781c", Pid="1a1a13cb-f9a9-4ffe-924d-d523db79f7bf", Pids="[00000000-0000-0000-0000-000000000000],[eec4563e-9307-4ccd-ac3a-93598badb195],[1a1a13cb-f9a9-4ffe-924d-d523db79f7bf],", Name="操作日志清空", Code="sys_log_mgr_op_log_delete", Type=2, Permission="sysOpLog:delete", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="cf72e37b-3d3b-4dba-bcd0-3fb4bd54757c", Pid="00000000-0000-0000-0000-000000000000", Pids="[00000000-0000-0000-0000-000000000000],", Name="系统监控", Code="sys_monitor_mgr", Type=0, Icon="deployment-unit", Router="/monitor", Component="PageView", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="c1e70042-fe3f-4efc-a6cc-86de8507f948", Pid="cf72e37b-3d3b-4dba-bcd0-3fb4bd54757c", Pids="[00000000-0000-0000-0000-000000000000],[cf72e37b-3d3b-4dba-bcd0-3fb4bd54757c],", Name="服务监控", Code="sys_monitor_mgr_machine_monitor", Type=1, Router="/machine", Component="system/machine/index", Application="system", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="444f3658-defe-47a7-880e-bf0af8b66591", Pid="c1e70042-fe3f-4efc-a6cc-86de8507f948", Pids="[00000000-0000-0000-0000-000000000000],[cf72e37b-3d3b-4dba-bcd0-3fb4bd54757c],[c1e70042-fe3f-4efc-a6cc-86de8507f948],", Name="服务监控查询", Code="sys_monitor_mgr_machine_monitor_query", Type=2, Permission="sysMachine:query", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="49a8b476-327b-4f33-87b8-2d9bc50dc390", Pid="cf72e37b-3d3b-4dba-bcd0-3fb4bd54757c", Pids="[00000000-0000-0000-0000-000000000000],[cf72e37b-3d3b-4dba-bcd0-3fb4bd54757c],", Name="在线用户", Code="sys_monitor_mgr_online_user", Type=1, Router="/onlineUser", Component="system/onlineUser/index", Application="system", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0},
|
||||
new SysMenu{Id="4785eb5a-678a-4f9c-b07c-3b92acdd6de0", Pid="49a8b476-327b-4f33-87b8-2d9bc50dc390", Pids="[00000000-0000-0000-0000-000000000000],[cf72e37b-3d3b-4dba-bcd0-3fb4bd54757c],[49a8b476-327b-4f33-87b8-2d9bc50dc390],", Name="在线用户列表", Code="sys_monitor_mgr_online_user_list", Type=2, Permission="sysOnlineUser:list", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="4dbf6765-ac79-4708-a9d5-16a4d4b09164", Pid="49a8b476-327b-4f33-87b8-2d9bc50dc390", Pids="[00000000-0000-0000-0000-000000000000],[cf72e37b-3d3b-4dba-bcd0-3fb4bd54757c],[49a8b476-327b-4f33-87b8-2d9bc50dc390],", Name="在线用户强退", Code="sys_monitor_mgr_online_user_force_exist", Type=2, Permission="sysOnlineUser:forceExist", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="31c2af01-b856-4a1d-a131-cdf8e847b1a4", Pid="cf72e37b-3d3b-4dba-bcd0-3fb4bd54757c", Pids="[00000000-0000-0000-0000-000000000000],[cf72e37b-3d3b-4dba-bcd0-3fb4bd54757c],", Name="数据监控", Code="sys_monitor_mgr_druid", Type=1, Router="/druid", Component="Iframe", Application="system", OpenType=2, Visible=false, Link="http://localhost:82/druid/login.html", Weight=1, Sort=100, Status=0},
|
||||
new SysMenu{Id="d4cac841-99e5-4014-af17-2986c9340306", Pid="00000000-0000-0000-0000-000000000000", Pids="[00000000-0000-0000-0000-000000000000],", Name="通知公告", Code="sys_notice", Type=0, Icon="sound", Router="/notice", Component="PageView", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="e8ca3968-e404-4ea6-a71a-d06d06b51bd5", Pid="d4cac841-99e5-4014-af17-2986c9340306", Pids="[00000000-0000-0000-0000-000000000000],[d4cac841-99e5-4014-af17-2986c9340306],", Name="公告管理", Code="sys_notice_mgr", Type=1, Router="/notice", Component="system/notice/index", Application="system", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="54584ab7-25d1-45b7-b3d4-76ba21511f97", Pid="e8ca3968-e404-4ea6-a71a-d06d06b51bd5", Pids="[00000000-0000-0000-0000-000000000000],[d4cac841-99e5-4014-af17-2986c9340306],[e8ca3968-e404-4ea6-a71a-d06d06b51bd5],", Name="公告查询", Code="sys_notice_mgr_page", Type=2, Permission="sysNotice:page", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="f27c8431-7da5-4ffe-a8f3-b511cf44c0c8", Pid="e8ca3968-e404-4ea6-a71a-d06d06b51bd5", Pids="[00000000-0000-0000-0000-000000000000],[d4cac841-99e5-4014-af17-2986c9340306],[e8ca3968-e404-4ea6-a71a-d06d06b51bd5],", Name="公告增加", Code="sys_notice_mgr_add", Type=2, Permission="sysNotice:add", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="f84c1f3a-3a51-4be2-97c9-7543b044e457", Pid="e8ca3968-e404-4ea6-a71a-d06d06b51bd5", Pids="[00000000-0000-0000-0000-000000000000],[d4cac841-99e5-4014-af17-2986c9340306],[e8ca3968-e404-4ea6-a71a-d06d06b51bd5],", Name="公告编辑", Code="sys_notice_mgr_edit", Type=2, Permission="sysNotice:edit", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="a8abcb85-ad3b-47b9-8c9b-e7d1876b90cf", Pid="e8ca3968-e404-4ea6-a71a-d06d06b51bd5", Pids="[00000000-0000-0000-0000-000000000000],[d4cac841-99e5-4014-af17-2986c9340306],[e8ca3968-e404-4ea6-a71a-d06d06b51bd5],", Name="公告删除", Code="sys_notice_mgr_delete", Type=2, Permission="sysNotice:delete", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="fe9cbb41-7b05-4f32-b960-87a1ef146166", Pid="e8ca3968-e404-4ea6-a71a-d06d06b51bd5", Pids="[00000000-0000-0000-0000-000000000000],[d4cac841-99e5-4014-af17-2986c9340306],[e8ca3968-e404-4ea6-a71a-d06d06b51bd5],", Name="公告查看", Code="sys_notice_mgr_detail", Type=2, Permission="sysNotice:detail", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="3e547bb0-4cf5-4cf0-8386-48d2f3c12dcb", Pid="e8ca3968-e404-4ea6-a71a-d06d06b51bd5", Pids="[00000000-0000-0000-0000-000000000000],[d4cac841-99e5-4014-af17-2986c9340306],[e8ca3968-e404-4ea6-a71a-d06d06b51bd5],", Name="公告修改状态", Code="sys_notice_mgr_changeStatus", Type=2, Permission="sysNotice:changeStatus", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="ac3065ff-d239-4e0e-86e5-d72cc658224c", Pid="d4cac841-99e5-4014-af17-2986c9340306", Pids="[00000000-0000-0000-0000-000000000000],[d4cac841-99e5-4014-af17-2986c9340306],", Name="已收公告", Code="sys_notice_mgr_received", Type=1, Router="/noticeReceived", Component="system/noticeReceived/index", Application="system", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0},
|
||||
new SysMenu{Id="e2d4b13b-eb3e-4ead-8fb8-4c61a3004726", Pid="ac3065ff-d239-4e0e-86e5-d72cc658224c", Pids="[00000000-0000-0000-0000-000000000000],[d4cac841-99e5-4014-af17-2986c9340306],[ac3065ff-d239-4e0e-86e5-d72cc658224c],", Name="已收公告查询", Code="sys_notice_mgr_received_page", Type=2, Permission="sysNotice:received", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="05326e62-f496-4950-8a29-40e8a479424f", Pid="00000000-0000-0000-0000-000000000000", Pids="[00000000-0000-0000-0000-000000000000],", Name="文件管理", Code="sys_file_mgr", Type=0, Icon="file", Router="/file", Component="PageView", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="0af2a460-bbb0-472c-b027-8532970425df", Pid="05326e62-f496-4950-8a29-40e8a479424f", Pids="[00000000-0000-0000-0000-000000000000],[05326e62-f496-4950-8a29-40e8a479424f],", Name="系统文件", Code="sys_file_mgr_sys_file", Type=1, Router="/file", Component="system/file/index", Application="system", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="c7bac800-b922-4173-bd8d-9888b4eab1d4", Pid="0af2a460-bbb0-472c-b027-8532970425df", Pids="[00000000-0000-0000-0000-000000000000],[05326e62-f496-4950-8a29-40e8a479424f],[0af2a460-bbb0-472c-b027-8532970425df],", Name="文件查询", Code="sys_file_mgr_sys_file_page", Type=2, Permission="sysFileInfo:page", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="f47e1fa7-6329-4d67-8fe6-36ca06aad54b", Pid="0af2a460-bbb0-472c-b027-8532970425df", Pids="[00000000-0000-0000-0000-000000000000],[05326e62-f496-4950-8a29-40e8a479424f],[0af2a460-bbb0-472c-b027-8532970425df],", Name="文件列表", Code="sys_file_mgr_sys_file_list", Type=2, Permission="sysFileInfo:list", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="cca0a2ee-cfb9-4996-affb-dc8d8168ac10", Pid="0af2a460-bbb0-472c-b027-8532970425df", Pids="[00000000-0000-0000-0000-000000000000],[05326e62-f496-4950-8a29-40e8a479424f],[0af2a460-bbb0-472c-b027-8532970425df],", Name="文件删除", Code="sys_file_mgr_sys_file_delete", Type=2, Permission="sysFileInfo:delete", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="eb738eaa-5eed-466d-b422-4eb6f4662dd9", Pid="0af2a460-bbb0-472c-b027-8532970425df", Pids="[00000000-0000-0000-0000-000000000000],[05326e62-f496-4950-8a29-40e8a479424f],[0af2a460-bbb0-472c-b027-8532970425df],", Name="文件详情", Code="sys_file_mgr_sys_file_detail", Type=2, Permission="sysFileInfo:detail", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="69b97ace-d849-4e52-8fc2-9da7d93e325f", Pid="0af2a460-bbb0-472c-b027-8532970425df", Pids="[00000000-0000-0000-0000-000000000000],[05326e62-f496-4950-8a29-40e8a479424f],[0af2a460-bbb0-472c-b027-8532970425df],", Name="文件上传", Code="sys_file_mgr_sys_file_upload", Type=2, Permission="sysFileInfo:upload", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="e286d53d-bf3c-4711-b0a3-15cfad0a7521", Pid="0af2a460-bbb0-472c-b027-8532970425df", Pids="[00000000-0000-0000-0000-000000000000],[05326e62-f496-4950-8a29-40e8a479424f],[0af2a460-bbb0-472c-b027-8532970425df],", Name="文件下载", Code="sys_file_mgr_sys_file_download", Type=2, Permission="sysFileInfo:download", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="1975891b-7940-44a8-a513-9f2e8b05dda1", Pid="0af2a460-bbb0-472c-b027-8532970425df", Pids="[00000000-0000-0000-0000-000000000000],[05326e62-f496-4950-8a29-40e8a479424f],[0af2a460-bbb0-472c-b027-8532970425df],", Name="图片预览", Code="sys_file_mgr_sys_file_preview", Type=2, Permission="sysFileInfo:preview", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="ba03cfd5-5d72-465f-87b6-71134da68fab", Pid="00000000-0000-0000-0000-000000000000", Pids="[00000000-0000-0000-0000-000000000000],", Name="定时任务", Code="sys_timers", Type=0, Icon="dashboard", Router="/timers", Component="PageView", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="8d4643d7-ec15-48ba-b896-816f8dab1b31", Pid="ba03cfd5-5d72-465f-87b6-71134da68fab", Pids="[00000000-0000-0000-0000-000000000000],[ba03cfd5-5d72-465f-87b6-71134da68fab],", Name="任务管理", Code="sys_timers_mgr", Type=1, Router="/timers", Component="system/timers/index", Application="system", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="db62154a-470e-43c8-8959-a686b954fe7d", Pid="8d4643d7-ec15-48ba-b896-816f8dab1b31", Pids="[00000000-0000-0000-0000-000000000000],[ba03cfd5-5d72-465f-87b6-71134da68fab],[8d4643d7-ec15-48ba-b896-816f8dab1b31],", Name="定时任务查询", Code="sys_timers_mgr_page", Type=2, Permission="sysTimers:page", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="dc07cd9f-4a53-40d9-988e-70290a146eff", Pid="8d4643d7-ec15-48ba-b896-816f8dab1b31", Pids="[00000000-0000-0000-0000-000000000000],[ba03cfd5-5d72-465f-87b6-71134da68fab],[8d4643d7-ec15-48ba-b896-816f8dab1b31],", Name="定时任务列表", Code="sys_timers_mgr_list", Type=2, Permission="sysTimers:list", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="1e562d31-c2f8-4af8-be4b-47e3b251d9a3", Pid="8d4643d7-ec15-48ba-b896-816f8dab1b31", Pids="[00000000-0000-0000-0000-000000000000],[ba03cfd5-5d72-465f-87b6-71134da68fab],[8d4643d7-ec15-48ba-b896-816f8dab1b31],", Name="定时任务详情", Code="sys_timers_mgr_detail", Type=2, Permission="sysTimers:detail", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="f27ba442-7d6f-499f-8053-a737adc3492a", Pid="8d4643d7-ec15-48ba-b896-816f8dab1b31", Pids="[00000000-0000-0000-0000-000000000000],[ba03cfd5-5d72-465f-87b6-71134da68fab],[8d4643d7-ec15-48ba-b896-816f8dab1b31],", Name="定时任务增加", Code="sys_timers_mgr_add", Type=2, Permission="sysTimers:add", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="99129601-0be5-43ee-842b-a428603f013b", Pid="8d4643d7-ec15-48ba-b896-816f8dab1b31", Pids="[00000000-0000-0000-0000-000000000000],[ba03cfd5-5d72-465f-87b6-71134da68fab],[8d4643d7-ec15-48ba-b896-816f8dab1b31],", Name="定时任务删除", Code="sys_timers_mgr_delete", Type=2, Permission="sysTimers:delete", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="5e118fc0-f580-4d06-a89d-f321a84e5654", Pid="8d4643d7-ec15-48ba-b896-816f8dab1b31", Pids="[00000000-0000-0000-0000-000000000000],[ba03cfd5-5d72-465f-87b6-71134da68fab],[8d4643d7-ec15-48ba-b896-816f8dab1b31],", Name="定时任务编辑", Code="sys_timers_mgr_edit", Type=2, Permission="sysTimers:edit", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="4272f2e4-4a8b-45bb-b688-2b9471c35e83", Pid="8d4643d7-ec15-48ba-b896-816f8dab1b31", Pids="[00000000-0000-0000-0000-000000000000],[ba03cfd5-5d72-465f-87b6-71134da68fab],[8d4643d7-ec15-48ba-b896-816f8dab1b31],", Name="定时任务可执行列表", Code="sys_timers_mgr_get_action_classes", Type=2, Permission="sysTimers:getActionClasses", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="54094687-f661-4cba-bdfc-e76f22db8d76", Pid="8d4643d7-ec15-48ba-b896-816f8dab1b31", Pids="[00000000-0000-0000-0000-000000000000],[ba03cfd5-5d72-465f-87b6-71134da68fab],[8d4643d7-ec15-48ba-b896-816f8dab1b31],", Name="定时任务启动", Code="sys_timers_mgr_start", Type=2, Permission="sysTimers:start", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="6b82d407-d1ea-440e-9245-128ad03dffc0", Pid="8d4643d7-ec15-48ba-b896-816f8dab1b31", Pids="[00000000-0000-0000-0000-000000000000],[ba03cfd5-5d72-465f-87b6-71134da68fab],[8d4643d7-ec15-48ba-b896-816f8dab1b31],", Name="定时任务关闭", Code="sys_timers_mgr_stop", Type=2, Permission="sysTimers:stop", Application="system", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="5172265d-eda3-4b8a-a542-d582467a51a1", Pid="00000000-0000-0000-0000-000000000000", Pids="[00000000-0000-0000-0000-000000000000],", Name="代码生成", Code="code_gen", Type=1, Icon="thunderbolt", Router="/codeGenerate/index", Component="gen/codeGenerate/index", Application="system_tool", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="cf51df0a-8e0b-4252-ba06-9646cad648d1", Pid="00000000-0000-0000-0000-000000000000", Pids="[00000000-0000-0000-0000-000000000000],", Name="表单设计", Code="form_design", Type=1, Icon="robot", Router="/formDesign/index", Component="system/formDesign/index", Application="system_tool", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="f4cf2a3d-0714-4ca4-a691-0b363c172f82", Pid="00000000-0000-0000-0000-000000000000", Pids="[00000000-0000-0000-0000-000000000000],", Name="SaaS租户", Code="sys_tenant", Type=1, Icon="switcher", Router="/tenant", Component="PageView", Application="advanced", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="a6e5cd91-e3de-401d-bc8c-86bd464ab32e", Pid="f4cf2a3d-0714-4ca4-a691-0b363c172f82", Pids="[00000000-0000-0000-0000-000000000000],[f4cf2a3d-0714-4ca4-a691-0b363c172f82],", Name="租户管理", Code="sys_tenant_mgr", Type=1, Router="/tenant", Component="system/tenant/index", Application="advanced", OpenType=1, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="8985ec0a-5060-4812-bf47-4f3102948066", Pid="a6e5cd91-e3de-401d-bc8c-86bd464ab32e", Pids="[00000000-0000-0000-0000-000000000000],[f4cf2a3d-0714-4ca4-a691-0b363c172f82],[a6e5cd91-e3de-401d-bc8c-86bd464ab32e],", Name="租户查询", Code="sys_tenant_mgr_page", Type=2, Permission="sysTenant:page", Application="advanced", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="d9584afb-18de-4f7e-b992-c21ad77b1aae", Pid="a6e5cd91-e3de-401d-bc8c-86bd464ab32e", Pids="[00000000-0000-0000-0000-000000000000],[f4cf2a3d-0714-4ca4-a691-0b363c172f82],[a6e5cd91-e3de-401d-bc8c-86bd464ab32e],", Name="租户详情", Code="sys_tenant_mgr_detail", Type=2, Permission="sysTenant:detail", Application="advanced", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="01ae6b95-9c1e-4882-a9ac-ebb9f1868c54", Pid="a6e5cd91-e3de-401d-bc8c-86bd464ab32e", Pids="[00000000-0000-0000-0000-000000000000],[f4cf2a3d-0714-4ca4-a691-0b363c172f82],[a6e5cd91-e3de-401d-bc8c-86bd464ab32e],", Name="租户增加", Code="sys_tenant_mgr_add", Type=2, Permission="sysTenant:add", Application="advanced", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="59e9f6da-151a-4201-bea1-00ef06fe5842", Pid="a6e5cd91-e3de-401d-bc8c-86bd464ab32e", Pids="[00000000-0000-0000-0000-000000000000],[f4cf2a3d-0714-4ca4-a691-0b363c172f82],[a6e5cd91-e3de-401d-bc8c-86bd464ab32e],", Name="租户删除", Code="sys_tenant_mgr_delete", Type=2, Permission="sysTenant:delete", Application="advanced", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
new SysMenu{Id="220b6a86-e65d-469b-8aa0-46c4f5e77ab8", Pid="a6e5cd91-e3de-401d-bc8c-86bd464ab32e", Pids="[00000000-0000-0000-0000-000000000000],[f4cf2a3d-0714-4ca4-a691-0b363c172f82],[a6e5cd91-e3de-401d-bc8c-86bd464ab32e],", Name="租户编辑", Code="sys_tenant_mgr_edit", Type=2, Permission="sysTenant:edit", Application="advanced", OpenType=0, Visible=true, Weight=1, Sort=100, Status=0 },
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
34
Api/Ewide.Core/SeedData/SysOrgSeedData.cs
Normal file
34
Api/Ewide.Core/SeedData/SysOrgSeedData.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统机构表种子数据
|
||||
/// </summary>
|
||||
public class SysOrgSeedData : IEntitySeedData<SysOrg>
|
||||
{
|
||||
/// <summary>
|
||||
/// 种子数据
|
||||
/// </summary>
|
||||
/// <param name="dbContext"></param>
|
||||
/// <param name="dbContextLocator"></param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<SysOrg> HasData(DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new SysOrg{Id="12d888de-f55d-4c88-b0a0-7c3510664d97", Pid="00000000-0000-0000-0000-000000000000", Pids="[00000000-0000-0000-0000-000000000000],", Name="华夏集团", Code="hxjt", Sort=100, Remark="华夏集团", Status=0 },//142307070910539
|
||||
new SysOrg{Id="8a2271d6-5bda-4544-bdd3-27e53a8b418e", Pid="12d888de-f55d-4c88-b0a0-7c3510664d97", Pids="[00000000-0000-0000-0000-000000000000],[12d888de-f55d-4c88-b0a0-7c3510664d97],", Name="华夏集团北京分公司", Code="hxjt_bj", Sort=100, Remark="华夏集团北京分公司", Status=0 },//142307070910540
|
||||
new SysOrg{Id="127c0a5d-43ac-4370-b313-082361885aca", Pid="12d888de-f55d-4c88-b0a0-7c3510664d97", Pids="[00000000-0000-0000-0000-000000000000],[12d888de-f55d-4c88-b0a0-7c3510664d97],", Name="华夏集团成都分公司", Code="hxjt_cd", Sort=100, Remark="华夏集团成都分公司", Status=0 },//142307070910541
|
||||
new SysOrg{Id="f236ab2d-e1b5-4e9d-844f-a59ec32c20e4", Pid="8a2271d6-5bda-4544-bdd3-27e53a8b418e", Pids="[00000000-0000-0000-0000-000000000000],[12d888de-f55d-4c88-b0a0-7c3510664d97],[8a2271d6-5bda-4544-bdd3-27e53a8b418e],", Name="研发部", Code="hxjt_bj_yfb", Sort=100, Remark="华夏集团北京分公司研发部", Status=0 },//142307070910542
|
||||
new SysOrg{Id="07322be0-2015-41f2-859e-132b5e142fca", Pid="8a2271d6-5bda-4544-bdd3-27e53a8b418e", Pids="[00000000-0000-0000-0000-000000000000],[12d888de-f55d-4c88-b0a0-7c3510664d97],[8a2271d6-5bda-4544-bdd3-27e53a8b418e],", Name="企划部", Code="hxjt_bj_qhb", Sort=100, Remark="华夏集团北京分公司企划部", Status=0 },//142307070910543
|
||||
new SysOrg{Id="49dc3f25-873d-4998-9767-46978d79d8e6", Pid="127c0a5d-43ac-4370-b313-082361885aca", Pids="[00000000-0000-0000-0000-000000000000],[12d888de-f55d-4c88-b0a0-7c3510664d97],[127c0a5d-43ac-4370-b313-082361885aca],", Name="市场部", Code="hxjt_cd_scb", Sort=100, Remark="华夏集团成都分公司市场部", Status=0 },//142307070910544
|
||||
new SysOrg{Id="56b7a823-cc62-492b-a91b-0b053ef2683b", Pid="127c0a5d-43ac-4370-b313-082361885aca", Pids="[00000000-0000-0000-0000-000000000000],[12d888de-f55d-4c88-b0a0-7c3510664d97],[127c0a5d-43ac-4370-b313-082361885aca],", Name="财务部", Code="hxjt_cd_cwb", Sort=100, Remark="华夏集团成都分公司财务部", Status=0 },//142307070910545
|
||||
new SysOrg{Id="e9f97d63-a585-40ff-bf0c-7406e785f660", Pid="49dc3f25-873d-4998-9767-46978d79d8e6", Pids="[00000000-0000-0000-0000-000000000000],[12d888de-f55d-4c88-b0a0-7c3510664d97],[127c0a5d-43ac-4370-b313-082361885aca],[49dc3f25-873d-4998-9767-46978d79d8e6],", Name="市场部二部", Code="hxjt_cd_scb_2b", Sort=100, Remark="华夏集团成都分公司市场部二部", Status=0 }//142307070910546
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
30
Api/Ewide.Core/SeedData/SysPosSeedData.cs
Normal file
30
Api/Ewide.Core/SeedData/SysPosSeedData.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统职位表种子数据
|
||||
/// </summary>
|
||||
public class SysPosSeedData : IEntitySeedData<SysPos>
|
||||
{
|
||||
/// <summary>
|
||||
/// 种子数据
|
||||
/// </summary>
|
||||
/// <param name="dbContext"></param>
|
||||
/// <param name="dbContextLocator"></param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<SysPos> HasData(DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new SysPos{Id="269236c4-d74e-4e54-9d50-f6f61580a197", Name="总经理", Code="zjl", Sort=100, Remark="总经理", Status=0 },//142307070910547
|
||||
new SysPos{Id="46c68a62-f119-4ff7-b621-0bbd77504538", Name="副总经理", Code="fzjl", Sort=101, Remark="副总经理", Status=0 },//142307070910548
|
||||
new SysPos{Id="5bd8c466-2bca-4386-a551-daac78e3cee8", Name="部门经理", Code="bmjl", Sort=102, Remark="部门经理", Status=0 },//142307070910549
|
||||
new SysPos{Id="d89a3afe-e6ba-4018-bdae-3c98bb47ad66", Name="工作人员", Code="gzry", Sort=103, Remark="工作人员", Status=0 }//142307070910550
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
28
Api/Ewide.Core/SeedData/SysRoleSeedData.cs
Normal file
28
Api/Ewide.Core/SeedData/SysRoleSeedData.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统角色表种子数据
|
||||
/// </summary>
|
||||
public class SysRoleSeedData : IEntitySeedData<SysRole>
|
||||
{
|
||||
/// <summary>
|
||||
/// 种子数据
|
||||
/// </summary>
|
||||
/// <param name="dbContext"></param>
|
||||
/// <param name="dbContextLocator"></param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<SysRole> HasData(DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new SysRole{Id="6dfe9189-ce10-434e-a7a7-5cdc46e85047", Name="系统管理员", Code="sys_manager_role", Sort=100, DataScopeType=1, Remark="系统管理员", Status=0 }, // 142307070910554
|
||||
new SysRole{Id="cd187ebd-ab3d-4768-9669-85e2219c2910", Name="普通用户", Code="common_role", Sort=101, DataScopeType=5, Remark="普通用户", Status=0 } // 142307070910555
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
35
Api/Ewide.Core/SeedData/SysTenantSeedData.cs
Normal file
35
Api/Ewide.Core/SeedData/SysTenantSeedData.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
public class SysTenantSeedData : IEntitySeedData<SysTenant, MultiTenantDbContextLocator>
|
||||
{
|
||||
public IEnumerable<SysTenant> HasData(DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
return new List<SysTenant>
|
||||
{
|
||||
new SysTenant
|
||||
{
|
||||
Id = "506a14b7-882d-4548-96fa-a55dbe79bfa1",
|
||||
Name = "默认租户",
|
||||
Host = "localhost:5566",
|
||||
CreatedTime = DateTime.Parse("2021-04-03 00:00:00"),
|
||||
Connection = "Data Source=./Dilon.db",
|
||||
Email = "zuohuaijun@163.com",
|
||||
Phone = "18020030720"
|
||||
}, // 142307070918780
|
||||
new SysTenant
|
||||
{
|
||||
Id = "eed8c4a6-70d8-49fd-9566-21a6966bb702",
|
||||
Name = "其他租户",
|
||||
Host = "localhost:5588",
|
||||
CreatedTime = DateTime.Parse("2021-04-03 00:00:00"),
|
||||
Connection = "Data Source=./Dilon_1.db"
|
||||
} // 142307070918781
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
28
Api/Ewide.Core/SeedData/SysTimerSeedData.cs
Normal file
28
Api/Ewide.Core/SeedData/SysTimerSeedData.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Dilon.Core.Service;
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统任务调度表种子数据
|
||||
/// </summary>
|
||||
public class SysTimerSeedData : IEntitySeedData<SysTimer>
|
||||
{
|
||||
/// <summary>
|
||||
/// 种子数据
|
||||
/// </summary>
|
||||
/// <param name="dbContext"></param>
|
||||
/// <param name="dbContextLocator"></param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<SysTimer> HasData(DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new SysTimer{Id="971bc338-0c03-46d4-8113-c7738d54ea18", JobName="百度api", JobGroup="默认分组", BeginTime=DateTimeOffset.Parse("2021-03-21 00:00:00+08:00"), Interval=30, TriggerType=TriggerTypeEnum.Simple, RequestUrl="https://www.baidu.com", RequestType=RequestTypeEnum.Post, IsDeleted=false }, // 142307070910556
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
29
Api/Ewide.Core/SeedData/SysUserSeedData.cs
Normal file
29
Api/Ewide.Core/SeedData/SysUserSeedData.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统用户表种子数据
|
||||
/// </summary>
|
||||
public class SysUserSeedData : IEntitySeedData<SysUser>
|
||||
{
|
||||
/// <summary>
|
||||
/// 种子数据
|
||||
/// </summary>
|
||||
/// <param name="dbContext"></param>
|
||||
/// <param name="dbContextLocator"></param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<SysUser> HasData(DbContext dbContext, Type dbContextLocator)
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new SysUser{Id="d0ead3dc-5096-4e15-bc6d-f640be5301ec", Account="superAdmin", Name="superAdmin", Password="e10adc3949ba59abbe56e057f20f883e", AdminType=AdminType.SuperAdmin, Birthday=DateTimeOffset.Parse("1986-07-26 00:00:00"), Phone="18020030720", Sex=1, IsDeleted=false }, // 142307070910551
|
||||
new SysUser{Id="5398fb9a-2209-4ce7-a2c1-b6a983e502b5", Account="admin", Name="admin", Password="e10adc3949ba59abbe56e057f20f883e", AdminType=AdminType.SuperAdmin, Birthday=DateTimeOffset.Parse("1986-07-26 00:00:00"), Phone="18020030720", Sex=2, IsDeleted=false }, // 142307070910552
|
||||
new SysUser{Id="16a74726-e156-499f-9942-0e0e24ad0c3f", Account="zuohuaijun", Name="zuohuaijun", Password="e10adc3949ba59abbe56e057f20f883e", AdminType=AdminType.None, Birthday=DateTimeOffset.Parse("1986-07-26 00:00:00"), Phone="18020030720", Sex=1, IsDeleted=false } // 142307070910553
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
100
Api/Ewide.Core/Service/App/Dto/AppInput.cs
Normal file
100
Api/Ewide.Core/Service/App/Dto/AppInput.cs
Normal file
@@ -0,0 +1,100 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Ewide.Core.Service
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统应用参数
|
||||
/// </summary>
|
||||
public class AppInput : PageInputBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public virtual string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
public virtual string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 图标
|
||||
/// </summary>
|
||||
public virtual string Icon { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 图标颜色
|
||||
/// </summary>
|
||||
public virtual string Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否默认激活(Y-是,N-否),只能有一个系统默认激活
|
||||
/// 用户登录后默认展示此系统菜单
|
||||
/// </summary>
|
||||
public bool Active { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态(字典 0正常 1停用 2删除)
|
||||
/// </summary>
|
||||
public CommonStatus Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public int Sort { get; set; }
|
||||
}
|
||||
|
||||
public class AddAppInput : AppInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "应用名称不能为空")]
|
||||
public override string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "应用编码不能为空")]
|
||||
public override string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 图标
|
||||
/// </summary>
|
||||
public override string Icon { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 图标颜色
|
||||
/// </summary>
|
||||
[RegularExpression("^#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3}$", ErrorMessage = "颜色格式不正确")]
|
||||
public override string Color { get; set; }
|
||||
}
|
||||
|
||||
public class DeleteAppInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 应用Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "应用Id不能为空")]
|
||||
public string Id { get; set; }
|
||||
}
|
||||
|
||||
public class UpdateAppInput : AppInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 应用Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "应用Id不能为空")]
|
||||
public string Id { get; set; }
|
||||
}
|
||||
|
||||
public class QueryAppInput : DeleteAppInput
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class SetDefaultAppInput : DeleteAppInput
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
33
Api/Ewide.Core/Service/App/Dto/AppOutput.cs
Normal file
33
Api/Ewide.Core/Service/App/Dto/AppOutput.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
namespace Ewide.Core.Service
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统应用参数
|
||||
/// </summary>
|
||||
public class AppOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// 应用Id
|
||||
/// </summary>
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否默认
|
||||
/// </summary>
|
||||
public bool Active { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public int Sort { get; set; }
|
||||
}
|
||||
}
|
||||
18
Api/Ewide.Core/Service/App/ISysAppService.cs
Normal file
18
Api/Ewide.Core/Service/App/ISysAppService.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core.Service
|
||||
{
|
||||
public interface ISysAppService
|
||||
{
|
||||
Task AddApp(AddAppInput input);
|
||||
Task DeleteApp(DeleteAppInput input);
|
||||
Task<SysApp> GetApp([FromQuery] QueryAppInput input);
|
||||
Task<dynamic> GetAppList([FromQuery] AppInput input);
|
||||
Task<dynamic> GetLoginApps(string userId);
|
||||
Task<dynamic> QueryAppPageList([FromQuery] AppInput input);
|
||||
Task SetAsDefault(SetDefaultAppInput input);
|
||||
Task UpdateApp(UpdateAppInput input);
|
||||
Task ChangeUserAppStatus(UpdateAppInput input);
|
||||
}
|
||||
}
|
||||
198
Api/Ewide.Core/Service/App/SysAppService.cs
Normal file
198
Api/Ewide.Core/Service/App/SysAppService.cs
Normal file
@@ -0,0 +1,198 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Furion.DatabaseAccessor.Extensions;
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.DynamicApiController;
|
||||
using Furion.FriendlyException;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core.Service
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统应用服务
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Name = "App", Order = 100)]
|
||||
public class SysAppService : ISysAppService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly IRepository<SysApp> _sysAppRep; // 应用表仓储
|
||||
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly ISysMenuService _sysMenuService;
|
||||
|
||||
public SysAppService(IRepository<SysApp> sysAppRep,
|
||||
IUserManager userManager,
|
||||
ISysMenuService sysMenuService)
|
||||
{
|
||||
_sysAppRep = sysAppRep;
|
||||
_userManager = userManager;
|
||||
_sysMenuService = sysMenuService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户应用相关信息
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public async Task<dynamic> GetLoginApps(string userId)
|
||||
{
|
||||
var apps = _sysAppRep.DetachedEntities.Where(u => u.Status == (int)CommonStatus.ENABLE);
|
||||
if (!_userManager.SuperAdmin)
|
||||
{
|
||||
var appCodeList = await _sysMenuService.GetUserMenuAppCodeList(userId);
|
||||
apps = apps.Where(u => appCodeList.Contains(u.Code));
|
||||
}
|
||||
var appList = await apps.OrderBy(u => u.Sort).Select(u => new AppOutput
|
||||
{
|
||||
Code = u.Code,
|
||||
Name = u.Name,
|
||||
Active = u.Active
|
||||
}).ToListAsync(); // .OrderByDescending(u => u.Active) // 将激活的放到第一个
|
||||
|
||||
//// 默认激活第一个应用
|
||||
//if (appList != null && appList.Count > 0 && appList[0].Active != YesOrNot.Y.ToString())
|
||||
// appList[0].Active = YesOrNot.Y.ToString();
|
||||
return appList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页查询系统应用
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/sysApp/page")]
|
||||
public async Task<dynamic> QueryAppPageList([FromQuery] AppInput input)
|
||||
{
|
||||
var name = !string.IsNullOrEmpty(input.Name?.Trim());
|
||||
var code = !string.IsNullOrEmpty(input.Code?.Trim());
|
||||
var apps = await _sysAppRep.DetachedEntities
|
||||
.Where((name, u => EF.Functions.Like(u.Name, $"%{input.Name.Trim()}%")),
|
||||
(code, u => EF.Functions.Like(u.Code, $"%{input.Code.Trim()}%")))
|
||||
//.Where(u => u.Status == (int)CommonStatus.ENABLE)
|
||||
.ToPagedListAsync(input.PageNo, input.PageSize);
|
||||
return XnPageResult<SysApp>.PageResult(apps);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加系统应用
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/sysApp/add")]
|
||||
public async Task AddApp(AddAppInput input)
|
||||
{
|
||||
var isExist = await _sysAppRep.DetachedEntities.AnyAsync(u => u.Name == input.Name || u.Code == input.Code);
|
||||
if (isExist)
|
||||
throw Oops.Oh(ErrorCode.D5000);
|
||||
|
||||
if (input.Active)
|
||||
{
|
||||
isExist = await _sysAppRep.DetachedEntities.AnyAsync(u => u.Active == input.Active);
|
||||
if (isExist)
|
||||
throw Oops.Oh(ErrorCode.D5001);
|
||||
}
|
||||
|
||||
var app = input.Adapt<SysApp>();
|
||||
await app.InsertAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除系统应用
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/sysApp/delete")]
|
||||
public async Task DeleteApp(DeleteAppInput input)
|
||||
{
|
||||
var app = await _sysAppRep.FirstOrDefaultAsync(u => u.Id == input.Id);
|
||||
// 该应用下是否有状态为正常的菜单
|
||||
var hasMenu = await _sysMenuService.HasMenu(app.Code);
|
||||
if (hasMenu)
|
||||
throw Oops.Oh(ErrorCode.D5002);
|
||||
|
||||
await app.DeleteAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新系统应用
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/sysApp/edit")]
|
||||
public async Task UpdateApp(UpdateAppInput input)
|
||||
{
|
||||
var isExist = await _sysAppRep.DetachedEntities.AnyAsync(u => (u.Name == input.Name || u.Code == input.Code) && u.Id != input.Id);
|
||||
if (isExist)
|
||||
throw Oops.Oh(ErrorCode.D5000);
|
||||
|
||||
if (input.Active)
|
||||
{
|
||||
isExist = await _sysAppRep.DetachedEntities.AnyAsync(u => u.Active == input.Active);
|
||||
if (isExist)
|
||||
throw Oops.Oh(ErrorCode.D5001);
|
||||
}
|
||||
|
||||
var app = input.Adapt<SysApp>();
|
||||
await app.UpdateExcludeAsync(new[] { nameof(SysApp.Status) }, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取系统应用
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/sysApp/detail")]
|
||||
public async Task<SysApp> GetApp([FromQuery] QueryAppInput input)
|
||||
{
|
||||
return await _sysAppRep.DetachedEntities.FirstOrDefaultAsync(u => u.Id == input.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取系统应用列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/sysApp/list")]
|
||||
public async Task<dynamic> GetAppList([FromQuery] AppInput input)
|
||||
{
|
||||
return await _sysAppRep.DetachedEntities.Where(u => u.Status == (int)CommonStatus.ENABLE).ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设为默认应用
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/sysApp/setAsDefault")]
|
||||
public async Task SetAsDefault(SetDefaultAppInput input)
|
||||
{
|
||||
var apps = await _sysAppRep.Where(u => u.Status == (int)CommonStatus.ENABLE).ToListAsync();
|
||||
apps.ForEach(u =>
|
||||
{
|
||||
u.Active = false;
|
||||
});
|
||||
|
||||
var app = await _sysAppRep.FirstOrDefaultAsync(u => u.Id == input.Id);
|
||||
app.Active = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改用户状态
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/sysApp/changeStatus")]
|
||||
public async Task ChangeUserAppStatus(UpdateAppInput input)
|
||||
{
|
||||
if (!Enum.IsDefined(typeof(CommonStatus), input.Status))
|
||||
throw Oops.Oh(ErrorCode.D3005);
|
||||
|
||||
var app = await _sysAppRep.FirstOrDefaultAsync(u => u.Id == input.Id);
|
||||
app.Status = input.Status;
|
||||
}
|
||||
}
|
||||
}
|
||||
227
Api/Ewide.Core/Service/Auth/AuthService.cs
Normal file
227
Api/Ewide.Core/Service/Auth/AuthService.cs
Normal file
@@ -0,0 +1,227 @@
|
||||
using Furion;
|
||||
using Furion.DatabaseAccessor;
|
||||
using Furion.DatabaseAccessor.Extensions;
|
||||
using Furion.DataEncryption;
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.DynamicApiController;
|
||||
using Furion.FriendlyException;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using UAParser;
|
||||
|
||||
namespace Ewide.Core.Service
|
||||
{
|
||||
/// <summary>
|
||||
/// 登录授权相关服务
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Name = "Auth", Order = 160)]
|
||||
public class AuthService : IAuthService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly IRepository<SysUser> _sysUserRep; // 用户表仓储
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
private readonly IUserManager _userManager; // 用户管理
|
||||
|
||||
private readonly ISysUserService _sysUserService; // 系统用户服务
|
||||
private readonly ISysEmpService _sysEmpService; // 系统员工服务
|
||||
private readonly ISysRoleService _sysRoleService; // 系统角色服务
|
||||
private readonly ISysMenuService _sysMenuService; // 系统菜单服务
|
||||
private readonly ISysAppService _sysAppService; // 系统应用服务
|
||||
private readonly IClickWordCaptcha _captchaHandle;// 验证码服务
|
||||
private readonly ISysConfigService _sysConfigService; // 验证码服务
|
||||
|
||||
public AuthService(IRepository<SysUser> sysUserRep,
|
||||
IHttpContextAccessor httpContextAccessor,
|
||||
IUserManager userManager,
|
||||
ISysUserService sysUserService,
|
||||
ISysEmpService sysEmpService,
|
||||
ISysRoleService sysRoleService,
|
||||
ISysMenuService sysMenuService,
|
||||
ISysAppService sysAppService,
|
||||
IClickWordCaptcha captchaHandle,
|
||||
ISysConfigService sysConfigService)
|
||||
{
|
||||
_sysUserRep = sysUserRep;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
_userManager = userManager;
|
||||
_sysUserService = sysUserService;
|
||||
_sysEmpService = sysEmpService;
|
||||
_sysRoleService = sysRoleService;
|
||||
_sysMenuService = sysMenuService;
|
||||
_sysAppService = sysAppService;
|
||||
_captchaHandle = captchaHandle;
|
||||
_sysConfigService = sysConfigService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户登录
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <remarks>默认用户名/密码:admin/admin</remarks>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/login")]
|
||||
[AllowAnonymous]
|
||||
public async Task<string> LoginAsync([Required] LoginInput input)
|
||||
{
|
||||
// 获取加密后的密码
|
||||
var encryptPasswod = MD5Encryption.Encrypt(input.Password);
|
||||
|
||||
// 判断用户名和密码是否正确
|
||||
var user = await _sysUserRep.FirstOrDefaultAsync(u => u.Account.Equals(input.Account) && u.Password.Equals(encryptPasswod));
|
||||
_ = user ?? throw Oops.Oh(ErrorCode.D1000);
|
||||
|
||||
// 验证账号是否被冻结
|
||||
if (user.Status == CommonStatus.DISABLE)
|
||||
throw Oops.Oh(ErrorCode.D1017);
|
||||
|
||||
// 生成Token令牌
|
||||
//var accessToken = await _jwtBearerManager.CreateTokenAdmin(user);
|
||||
var accessToken = JWTEncryption.Encrypt(new Dictionary<string, object>
|
||||
{
|
||||
{ ClaimConst.CLAINM_USERID, user.Id },
|
||||
{ ClaimConst.CLAINM_ACCOUNT, user.Account },
|
||||
{ ClaimConst.CLAINM_NAME, user.Name },
|
||||
{ ClaimConst.CLAINM_SUPERADMIN, user.AdminType },
|
||||
});
|
||||
|
||||
// 设置Swagger自动登录
|
||||
_httpContextAccessor.SigninToSwagger(accessToken);
|
||||
|
||||
// 生成刷新Token令牌
|
||||
var refreshToken = JWTEncryption.GenerateRefreshToken(accessToken, 30);
|
||||
|
||||
// 设置刷新Token令牌
|
||||
_httpContextAccessor.HttpContext.Response.Headers["x-access-token"] = refreshToken;
|
||||
|
||||
return accessToken;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前登录用户信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/getLoginUser")]
|
||||
public async Task<LoginOutput> GetLoginUserAsync()
|
||||
{
|
||||
var user = _userManager.User;
|
||||
var userId = user.Id;
|
||||
|
||||
var httpContext = App.GetService<IHttpContextAccessor>().HttpContext;
|
||||
var loginOutput = user.Adapt<LoginOutput>();
|
||||
|
||||
loginOutput.LastLoginTime = user.LastLoginTime = DateTimeOffset.Now;
|
||||
var ip = httpContext.Request.Headers["X-Real-IP"].FirstOrDefault();
|
||||
loginOutput.LastLoginIp = user.LastLoginIp = string.IsNullOrEmpty(user.LastLoginIp) ? httpContext.GetRemoteIpAddressToIPv4() : ip;
|
||||
|
||||
//var ipInfo = IpTool.Search(loginOutput.LastLoginIp);
|
||||
//loginOutput.LastLoginAddress = ipInfo.Country + ipInfo.Province + ipInfo.City + "[" + ipInfo.NetworkOperator + "][" + ipInfo.Latitude + ipInfo.Longitude + "]";
|
||||
|
||||
var clent = Parser.GetDefault().Parse(httpContext.Request.Headers["User-Agent"]);
|
||||
loginOutput.LastLoginBrowser = clent.UA.Family + clent.UA.Major;
|
||||
loginOutput.LastLoginOs = clent.OS.Family + clent.OS.Major;
|
||||
|
||||
// 员工信息
|
||||
loginOutput.LoginEmpInfo = await _sysEmpService.GetEmpInfo(userId);
|
||||
|
||||
// 角色信息
|
||||
loginOutput.Roles = await _sysRoleService.GetUserRoleList(userId);
|
||||
|
||||
// 权限信息
|
||||
loginOutput.Permissions = await _sysMenuService.GetLoginPermissionList(userId);
|
||||
|
||||
// 数据范围信息(机构Id集合)
|
||||
loginOutput.DataScopes = await _sysUserService.GetUserDataScopeIdList(userId);
|
||||
|
||||
// 具备应用信息(多系统,默认激活一个,可根据系统切换菜单),返回的结果中第一个为激活的系统
|
||||
loginOutput.Apps = await _sysAppService.GetLoginApps(userId);
|
||||
|
||||
// 菜单信息
|
||||
if (loginOutput.Apps.Count > 0)
|
||||
{
|
||||
var defaultActiveAppCode = loginOutput.Apps.FirstOrDefault(u => u.Active == true).Code; // loginOutput.Apps[0].Code;
|
||||
loginOutput.Menus = await _sysMenuService.GetLoginMenusAntDesign(userId, defaultActiveAppCode);
|
||||
}
|
||||
|
||||
// 增加登录日志
|
||||
await new SysLogVis
|
||||
{
|
||||
Name = "登录",
|
||||
Success = YesOrNot.Y.ToString(),
|
||||
Message = "登录成功",
|
||||
Ip = loginOutput.LastLoginIp,
|
||||
Browser = loginOutput.LastLoginBrowser,
|
||||
Os = loginOutput.LastLoginOs,
|
||||
VisType = 1,
|
||||
VisTime = loginOutput.LastLoginTime,
|
||||
Account = loginOutput.Account
|
||||
}.InsertAsync();
|
||||
|
||||
return loginOutput;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 退出
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/logout")]
|
||||
public async Task LogoutAsync()
|
||||
{
|
||||
_httpContextAccessor.SignoutToSwagger();
|
||||
//_httpContextAccessor.HttpContext.Response.Headers["access-token"] = "invalid token";
|
||||
|
||||
// 增加退出日志
|
||||
await new SysLogVis
|
||||
{
|
||||
Name = "退出",
|
||||
Success = YesOrNot.Y.ToString(),
|
||||
Message = "退出成功",
|
||||
VisType = 2
|
||||
}.InsertAsync();
|
||||
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取验证码开关
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/getCaptchaOpen")]
|
||||
[AllowAnonymous]
|
||||
public async Task<bool> GetCaptchaOpen()
|
||||
{
|
||||
return await _sysConfigService.GetCaptchaOpenFlag();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取验证码(默认点选模式)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/captcha/get")]
|
||||
[AllowAnonymous]
|
||||
[NonUnify]
|
||||
public async Task<dynamic> GetCaptcha()
|
||||
{
|
||||
// 图片大小要与前端保持一致(坐标范围)
|
||||
return await Task.FromResult(_captchaHandle.CreateCaptchaImage(_captchaHandle.RandomCode(6), 310, 155));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 校验验证码
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/captcha/check")]
|
||||
[AllowAnonymous]
|
||||
[NonUnify]
|
||||
public async Task<dynamic> VerificationCode(ClickWordCaptchaInput input)
|
||||
{
|
||||
return await Task.FromResult(_captchaHandle.CheckCode(input));
|
||||
}
|
||||
}
|
||||
}
|
||||
26
Api/Ewide.Core/Service/Auth/Dto/LoginInput.cs
Normal file
26
Api/Ewide.Core/Service/Auth/Dto/LoginInput.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Furion.DependencyInjection;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Ewide.Core.Service
|
||||
{
|
||||
/// <summary>
|
||||
/// 登录输入参数
|
||||
/// </summary>
|
||||
[SkipScan]
|
||||
public class LoginInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户名
|
||||
/// </summary>
|
||||
/// <example>superAdmin</example>
|
||||
[Required(ErrorMessage = "用户名不能为空"), MinLength(3, ErrorMessage = "用户名不能少于3位字符")]
|
||||
public string Account { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 密码
|
||||
/// </summary>
|
||||
/// <example>123456</example>
|
||||
[Required(ErrorMessage = "密码不能为空"), MinLength(5, ErrorMessage = "密码不能少于5位字符")]
|
||||
public string Password { get; set; }
|
||||
}
|
||||
}
|
||||
163
Api/Ewide.Core/Service/Auth/Dto/LoginOutput.cs
Normal file
163
Api/Ewide.Core/Service/Auth/Dto/LoginOutput.cs
Normal file
@@ -0,0 +1,163 @@
|
||||
using Furion.DependencyInjection;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ewide.Core.Service
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户登录输出参数
|
||||
/// </summary>
|
||||
[SkipScan]
|
||||
public class LoginOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账号
|
||||
/// </summary>
|
||||
public string Account { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 昵称
|
||||
/// </summary>
|
||||
public string NickName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 姓名
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 头像
|
||||
/// </summary>
|
||||
public string Avatar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生日
|
||||
/// </summary>
|
||||
public DateTimeOffset Birthday { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 性别(字典 1男 2女)
|
||||
/// </summary>
|
||||
public int Sex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱
|
||||
/// </summary>
|
||||
public String Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机
|
||||
/// </summary>
|
||||
public String Phone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电话
|
||||
/// </summary>
|
||||
public String Tel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管理员类型(0超级管理员 1非管理员)
|
||||
/// </summary>
|
||||
public int AdminType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后登陆IP
|
||||
/// </summary>
|
||||
public string LastLoginIp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后登陆时间
|
||||
/// </summary>
|
||||
public DateTimeOffset LastLoginTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后登陆地址
|
||||
/// </summary>
|
||||
public string LastLoginAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后登陆所用浏览器
|
||||
/// </summary>
|
||||
public string LastLoginBrowser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后登陆所用系统
|
||||
/// </summary>
|
||||
public string LastLoginOs { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工信息
|
||||
/// </summary>
|
||||
public EmpOutput LoginEmpInfo { get; set; } = new EmpOutput();
|
||||
|
||||
/// <summary>
|
||||
/// 具备应用信息
|
||||
/// </summary>
|
||||
public List<AppOutput> Apps { get; set; } = new List<AppOutput>();
|
||||
|
||||
/// <summary>
|
||||
/// 角色信息
|
||||
/// </summary>
|
||||
public List<RoleOutput> Roles { get; set; } = new List<RoleOutput>();
|
||||
|
||||
/// <summary>
|
||||
/// 权限信息
|
||||
/// </summary>
|
||||
public List<string> Permissions { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// 登录菜单信息---AntDesign版本菜单
|
||||
/// </summary>
|
||||
public List<AntDesignTreeNode> Menus { get; set; } = new List<AntDesignTreeNode>();
|
||||
|
||||
/// <summary>
|
||||
/// 数据范围(机构)信息
|
||||
/// </summary>
|
||||
public List<string> DataScopes { get; set; } = new List<string>();
|
||||
|
||||
///// <summary>
|
||||
///// 租户信息
|
||||
///// </summary>
|
||||
//public List<long> Tenants { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 密码
|
||||
///// </summary>
|
||||
//public string Password { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 账户过期
|
||||
///// </summary>
|
||||
//public string AccountNonExpired { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 凭证过期
|
||||
///// </summary>
|
||||
//public string CredentialsNonExpired { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 账户锁定
|
||||
///// </summary>
|
||||
//public bool AccountNonLocked { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 用户名称
|
||||
///// </summary>
|
||||
//public string UserName { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 权限
|
||||
///// </summary>
|
||||
//public List<long> Authorities { get; set; } = new List<long>();
|
||||
|
||||
///// <summary>
|
||||
///// 是否启动
|
||||
///// </summary>
|
||||
//public bool Enabled { get; set; }
|
||||
}
|
||||
}
|
||||
15
Api/Ewide.Core/Service/Auth/IAuthService.cs
Normal file
15
Api/Ewide.Core/Service/Auth/IAuthService.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core.Service
|
||||
{
|
||||
public interface IAuthService
|
||||
{
|
||||
Task<dynamic> GetCaptcha();
|
||||
Task<bool> GetCaptchaOpen();
|
||||
Task<LoginOutput> GetLoginUserAsync();
|
||||
Task<string> LoginAsync([Required] LoginInput input);
|
||||
Task LogoutAsync();
|
||||
Task<dynamic> VerificationCode(ClickWordCaptchaInput input);
|
||||
}
|
||||
}
|
||||
21
Api/Ewide.Core/Service/Cache/ISysCacheService.cs
Normal file
21
Api/Ewide.Core/Service/Cache/ISysCacheService.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core.Service
|
||||
{
|
||||
public interface ISysCacheService
|
||||
{
|
||||
Task<bool> DelAsync(string key);
|
||||
Task<bool> DelByPatternAsync(string key);
|
||||
List<string> GetAllCacheKeys();
|
||||
Task<List<string>> GetDataScope(string userId);
|
||||
Task<List<AntDesignTreeNode>> GetMenu(string userId, string appCode);
|
||||
Task<List<string>> GetPermission(string userId);
|
||||
Task SetDataScope(string userId, List<string> dataScopes);
|
||||
Task SetMenu(string userId, string appCode, List<AntDesignTreeNode> menus);
|
||||
Task SetPermission(string userId, List<string> permissions);
|
||||
Task<bool> SetAsync(string key, object value);
|
||||
Task<string> GetAsync(string key);
|
||||
Task<T> GetAsync<T>(string key);
|
||||
}
|
||||
}
|
||||
169
Api/Ewide.Core/Service/Cache/SysCacheService.cs
Normal file
169
Api/Ewide.Core/Service/Cache/SysCacheService.cs
Normal file
@@ -0,0 +1,169 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.DynamicApiController;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core.Service
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统缓存服务
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Name = "Cache", Order = 100)]
|
||||
public class SysCacheService : ISysCacheService, IDynamicApiController, ISingleton
|
||||
{
|
||||
private readonly ICache _cache;
|
||||
private readonly CacheOptions _cacheOptions;
|
||||
|
||||
public SysCacheService(IOptions<CacheOptions> cacheOptions, Func<string, ISingleton, object> resolveNamed)
|
||||
{
|
||||
_cacheOptions = cacheOptions.Value;
|
||||
_cache = resolveNamed(_cacheOptions.CacheType.ToString(), default) as ICache;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取数据范围缓存(机构Id集合)
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<string>> GetDataScope(string userId)
|
||||
{
|
||||
var cacheKey = CommonConst.CACHE_KEY_DATASCOPE + $"{userId}";
|
||||
return await _cache.GetAsync<List<string>>(cacheKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 缓存数据范围(机构Id集合)
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="dataScopes"></param>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public async Task SetDataScope(string userId, List<string> dataScopes)
|
||||
{
|
||||
var cacheKey = CommonConst.CACHE_KEY_DATASCOPE + $"{userId}";
|
||||
await _cache.SetAsync(cacheKey, dataScopes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取菜单缓存
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="appCode"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<AntDesignTreeNode>> GetMenu(string userId, string appCode)
|
||||
{
|
||||
var cacheKey = CommonConst.CACHE_KEY_MENU + $"{userId}-{appCode}";
|
||||
return await _cache.GetAsync<List<AntDesignTreeNode>>(cacheKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 缓存菜单
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="appCode"></param>
|
||||
/// <param name="menus"></param>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public async Task SetMenu(string userId, string appCode, List<AntDesignTreeNode> menus)
|
||||
{
|
||||
var cacheKey = CommonConst.CACHE_KEY_MENU + $"{userId}-{appCode}";
|
||||
await _cache.SetAsync(cacheKey, menus);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取权限缓存(按钮)
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<string>> GetPermission(string userId)
|
||||
{
|
||||
var cacheKey = CommonConst.CACHE_KEY_PERMISSION + $"{userId}";
|
||||
return await _cache.GetAsync<List<string>>(cacheKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 缓存权限
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="permissions"></param>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public async Task SetPermission(string userId, List<string> permissions)
|
||||
{
|
||||
var cacheKey = CommonConst.CACHE_KEY_PERMISSION + $"{userId}";
|
||||
await _cache.SetAsync(cacheKey, permissions);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有缓存关键字
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<string> GetAllCacheKeys()
|
||||
{
|
||||
const BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic;
|
||||
var entries = _cache.GetType().GetField("_entries", flags).GetValue(_cache);
|
||||
if (entries.GetType().GetProperty("Keys").GetValue(entries) is not ICollection<object> cacheItems) return new List<string>();
|
||||
return cacheItems.Where(u => !u.ToString().StartsWith("mini-profiler"))
|
||||
.Select(u => u.ToString()).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除指定关键字缓存
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public Task<bool> DelAsync(string key)
|
||||
{
|
||||
_cache.DelAsync(key);
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除某特征关键字缓存
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public Task<bool> DelByPatternAsync(string key)
|
||||
{
|
||||
_cache.DelByPatternAsync(key);
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置缓存
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> SetAsync(string key, object value)
|
||||
{
|
||||
return await _cache.SetAsync(key, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetAsync(string key)
|
||||
{
|
||||
return await _cache.GetAsync(key);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public Task<T> GetAsync<T>(string key)
|
||||
{
|
||||
return _cache.GetAsync<T>(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
207
Api/Ewide.Core/Service/CodeGen/CodeGenConfigService.cs
Normal file
207
Api/Ewide.Core/Service/CodeGen/CodeGenConfigService.cs
Normal file
@@ -0,0 +1,207 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Furion.DatabaseAccessor.Extensions;
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.DynamicApiController;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core.Service
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成详细配置服务
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Name = "CodeGenConfig", Order = 100)]
|
||||
public class CodeGenConfigService : ICodeGenConfigService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly IRepository<SysCodeGenConfig> _sysCodeGenConfigRep; // 代码生成详细配置仓储
|
||||
|
||||
public CodeGenConfigService(IRepository<SysCodeGenConfig> sysCodeGenConfigRep)
|
||||
{
|
||||
_sysCodeGenConfigRep = sysCodeGenConfigRep;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 代码生成详细配置列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
[HttpGet("/sysCodeGenerateConfig/list")]
|
||||
public async Task<List<CodeGenConfig>> List([FromQuery] CodeGenConfig input)
|
||||
{
|
||||
return await _sysCodeGenConfigRep.DetachedEntities.Where(u => u.CodeGenId == input.CodeGenId && u.WhetherCommon != YesOrNot.Y.ToString())
|
||||
.Select(u => u.Adapt<CodeGenConfig>()).ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public async Task Add(CodeGenConfig input)
|
||||
{
|
||||
var codeGenConfig = input.Adapt<SysCodeGenConfig>();
|
||||
await codeGenConfig.InsertAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="codeGenId"></param>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public async Task Delete(string codeGenId)
|
||||
{
|
||||
var codeGenConfigList = await _sysCodeGenConfigRep.Where(u => u.CodeGenId == codeGenId).ToListAsync();
|
||||
codeGenConfigList.ForEach(u =>
|
||||
{
|
||||
u.Delete();
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新
|
||||
/// </summary>
|
||||
/// <param name="inputList"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/sysCodeGenerateConfig/edit")]
|
||||
public async Task Update(List<CodeGenConfig> inputList)
|
||||
{
|
||||
if (inputList == null || inputList.Count < 1) return;
|
||||
inputList.ForEach(u =>
|
||||
{
|
||||
var codeGenConfig = u.Adapt<SysCodeGenConfig>();
|
||||
codeGenConfig.Update(true);
|
||||
});
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 详情
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/sysCodeGenerateConfig/detail")]
|
||||
public async Task<SysCodeGenConfig> Detail(CodeGenConfig input)
|
||||
{
|
||||
return await _sysCodeGenConfigRep.FirstOrDefaultAsync(u => u.Id == input.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量增加
|
||||
/// </summary>
|
||||
/// <param name="tableColumnOuputList"></param>
|
||||
/// <param name="codeGenerate"></param>
|
||||
[NonAction]
|
||||
public void AddList(List<TableColumnOuput> tableColumnOuputList, SysCodeGen codeGenerate)
|
||||
{
|
||||
if (tableColumnOuputList == null) return;
|
||||
|
||||
foreach (var tableColumn in tableColumnOuputList)
|
||||
{
|
||||
var codeGenConfig = new SysCodeGenConfig();
|
||||
|
||||
var YesOrNo = YesOrNot.Y.ToString();
|
||||
if (Convert.ToBoolean(tableColumn.ColumnKey))
|
||||
{
|
||||
YesOrNo = YesOrNot.N.ToString();
|
||||
}
|
||||
|
||||
if (IsCommonColumn(tableColumn.ColumnName))
|
||||
{
|
||||
codeGenConfig.WhetherCommon = YesOrNot.Y.ToString();
|
||||
YesOrNo = YesOrNot.N.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
codeGenConfig.WhetherCommon = YesOrNot.N.ToString();
|
||||
}
|
||||
|
||||
codeGenConfig.CodeGenId = codeGenerate.Id;
|
||||
codeGenConfig.ColumnName = tableColumn.ColumnName;
|
||||
codeGenConfig.ColumnComment = tableColumn.ColumnComment;
|
||||
codeGenConfig.NetType = ConvertDataType(tableColumn.DataType);
|
||||
codeGenConfig.WhetherRetract = YesOrNot.N.ToString();
|
||||
|
||||
codeGenConfig.WhetherRequired = YesOrNot.N.ToString();
|
||||
codeGenConfig.QueryWhether = YesOrNo;
|
||||
codeGenConfig.WhetherAddUpdate = YesOrNo;
|
||||
codeGenConfig.WhetherTable = YesOrNo;
|
||||
|
||||
codeGenConfig.ColumnKey = tableColumn.ColumnKey;
|
||||
|
||||
codeGenConfig.DataType = tableColumn.DataType;
|
||||
codeGenConfig.EffectType = DataTypeToEff(codeGenConfig.NetType);
|
||||
codeGenConfig.QueryType = "=="; // QueryTypeEnum.eq.ToString();
|
||||
|
||||
codeGenConfig.InsertAsync();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数据类型转显示类型
|
||||
/// </summary>
|
||||
/// <param name="dataType"></param>
|
||||
/// <returns></returns>
|
||||
private static string DataTypeToEff(string dataType)
|
||||
{
|
||||
if (string.IsNullOrEmpty(dataType)) return "";
|
||||
return dataType switch
|
||||
{
|
||||
"string" => "input",
|
||||
"int" => "inputnumber",
|
||||
"long" => "input",
|
||||
"float" => "input",
|
||||
"double" => "input",
|
||||
"decimal" => "input",
|
||||
"bool" => "switch",
|
||||
"Guid" => "input",
|
||||
"DateTime" => "datepicker",
|
||||
"DateTimeOffset" => "datepicker",
|
||||
_ => "input",
|
||||
};
|
||||
}
|
||||
|
||||
// 转换.NET数据类型
|
||||
[NonAction]
|
||||
public string ConvertDataType(string dataType)
|
||||
{
|
||||
if (string.IsNullOrEmpty(dataType)) return "";
|
||||
if (dataType.StartsWith("System.Nullable"))
|
||||
dataType = new Regex(@"(?i)(?<=\[)(.*)(?=\])").Match(dataType).Value; // 中括号[]里面值
|
||||
|
||||
switch (dataType)
|
||||
{
|
||||
case "System.Guid": return "Guid";
|
||||
case "System.String": return "string";
|
||||
case "System.Int32": return "int";
|
||||
case "System.Int64": return "long";
|
||||
case "System.Single": return "float";
|
||||
case "System.Double": return "double";
|
||||
case "System.Decimal": return "decimal";
|
||||
case "System.Boolean": return "bool";
|
||||
case "System.DateTime": return "DateTime";
|
||||
case "System.DateTimeOffset": return "DateTimeOffset";
|
||||
case "System.Byte": return "byte";
|
||||
case "System.Byte[]": return "byte[]";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return dataType;
|
||||
}
|
||||
|
||||
// 是否通用字段
|
||||
private static bool IsCommonColumn(string columnName)
|
||||
{
|
||||
var columnList = new List<string>() { "CreatedTime", "UpdatedTime", "CreatedUserId", "CreatedUserName", "UpdatedUserId", "UpdatedUserName", "IsDeleted" };
|
||||
return columnList.Contains(columnName);
|
||||
}
|
||||
}
|
||||
}
|
||||
348
Api/Ewide.Core/Service/CodeGen/CodeGenService.cs
Normal file
348
Api/Ewide.Core/Service/CodeGen/CodeGenService.cs
Normal file
@@ -0,0 +1,348 @@
|
||||
using Furion;
|
||||
using Furion.DatabaseAccessor;
|
||||
using Furion.DatabaseAccessor.Extensions;
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.DynamicApiController;
|
||||
using Furion.FriendlyException;
|
||||
using Furion.ViewEngine;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core.Service.CodeGen
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成器服务
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Name = "CodeGen", Order = 100)]
|
||||
public class CodeGenService : ICodeGenService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly IRepository<SysCodeGen> _sysCodeGenRep; // 代码生成器仓储
|
||||
private readonly ICodeGenConfigService _codeGenConfigService;
|
||||
private readonly IViewEngine _viewEngine;
|
||||
|
||||
private readonly IRepository<SysMenu> _sysMenuRep; // 菜单表仓储
|
||||
|
||||
public CodeGenService(IRepository<SysCodeGen> sysCodeGenRep,
|
||||
ICodeGenConfigService codeGenConfigService,
|
||||
IViewEngine viewEngine,
|
||||
IRepository<SysMenu> sysMenuRep)
|
||||
{
|
||||
_sysCodeGenRep = sysCodeGenRep;
|
||||
_codeGenConfigService = codeGenConfigService;
|
||||
_viewEngine = viewEngine;
|
||||
_sysMenuRep = sysMenuRep;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页查询
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/codeGenerate/page")]
|
||||
public async Task<dynamic> QueryCodeGenPageList([FromQuery] CodeGenInput input)
|
||||
{
|
||||
var tableName = !string.IsNullOrEmpty(input.TableName?.Trim());
|
||||
var codeGens = await _sysCodeGenRep.DetachedEntities
|
||||
.Where((tableName, u => EF.Functions.Like(u.TableName, $"%{input.TableName.Trim()}%")))
|
||||
.ToPagedListAsync(input.PageNo, input.PageSize);
|
||||
return XnPageResult<SysCodeGen>.PageResult(codeGens);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/codeGenerate/add")]
|
||||
public async Task AddCodeGen(AddCodeGenInput input)
|
||||
{
|
||||
var isExist = await _sysCodeGenRep.DetachedEntities.AnyAsync(u => u.TableName == input.TableName);
|
||||
if (isExist)
|
||||
throw Oops.Oh(ErrorCode.D1400);
|
||||
|
||||
var codeGen = input.Adapt<SysCodeGen>();
|
||||
var newCodeGen = await codeGen.InsertNowAsync();
|
||||
|
||||
// 加入配置表中
|
||||
_codeGenConfigService.AddList(GetColumnList(input), newCodeGen.Entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="inputs"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/codeGenerate/delete")]
|
||||
public async Task DeleteCodeGen(List<DeleteCodeGenInput> inputs)
|
||||
{
|
||||
if (inputs == null || inputs.Count < 1) return;
|
||||
|
||||
var codeGenConfigTaskList = new List<Task>();
|
||||
inputs.ForEach(u =>
|
||||
{
|
||||
_sysCodeGenRep.Delete(u.Id);
|
||||
|
||||
// 删除配置表中
|
||||
codeGenConfigTaskList.Add(_codeGenConfigService.Delete(u.Id));
|
||||
});
|
||||
await Task.WhenAll(codeGenConfigTaskList);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/codeGenerate/edit")]
|
||||
public async Task UpdateCodeGen(UpdateCodeGenInput input)
|
||||
{
|
||||
var isExist = await _sysCodeGenRep.DetachedEntities.AnyAsync(u => u.TableName == input.TableName && u.Id != input.Id);
|
||||
if (isExist)
|
||||
throw Oops.Oh(ErrorCode.D1400);
|
||||
|
||||
var codeGen = input.Adapt<SysCodeGen>();
|
||||
await codeGen.UpdateAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 详情
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/codeGenerate/detail")]
|
||||
public async Task<SysCodeGen> GetCodeGen([FromQuery] QueryCodeGenInput input)
|
||||
{
|
||||
return await _sysCodeGenRep.DetachedEntities.FirstOrDefaultAsync(u => u.Id == input.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取数据库表(实体)集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
[HttpGet("/codeGenerate/InformationList")]
|
||||
public List<TableOutput> GetTableList()
|
||||
{
|
||||
return Db.GetDbContext().Model.GetEntityTypes().Select(u => new TableOutput
|
||||
{
|
||||
TableName = u.GetDefaultTableName(),
|
||||
TableComment = u.GetComment()
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取数据表列(实体属性)集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public List<TableColumnOuput> GetColumnList(AddCodeGenInput input)
|
||||
{
|
||||
var entityType = Db.GetDbContext().Model.GetEntityTypes().FirstOrDefault(u => u.ClrType.Name == input.TableName);
|
||||
if (entityType == null) return null;
|
||||
|
||||
return entityType.GetProperties().Select(u => new TableColumnOuput
|
||||
{
|
||||
ColumnName = u.Name,
|
||||
ColumnKey = u.IsKey().ToString(),
|
||||
DataType = u.PropertyInfo.PropertyType.ToString(),
|
||||
ColumnComment = u.GetComment()
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 代码生成_本地项目
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/codeGenerate/runLocal")]
|
||||
public async void RunLocal(SysCodeGen input)
|
||||
{
|
||||
var templatePathList = GetTemplatePathList();
|
||||
var targetPathList = GetTargetPathList(input);
|
||||
for (var i = 0; i < templatePathList.Count; i++)
|
||||
{
|
||||
var tContent = File.ReadAllText(templatePathList[i]);
|
||||
|
||||
var tableFieldList = await _codeGenConfigService.List(new CodeGenConfig() { CodeGenId = input.Id }); // 字段集合
|
||||
if (i >= 4) // 适应前端首字母小写
|
||||
{
|
||||
tableFieldList.ForEach(u =>
|
||||
{
|
||||
u.ColumnName = u.ColumnName.Substring(0, 1).ToLower() + u.ColumnName.Substring(1);
|
||||
});
|
||||
}
|
||||
var queryWhetherList = tableFieldList.Where(u => u.QueryWhether == YesOrNot.Y.ToString()).ToList(); // 前端查询集合
|
||||
var tResult = _viewEngine.RunCompileFromCached(tContent, new
|
||||
{
|
||||
input.AuthorName,
|
||||
input.BusName,
|
||||
input.NameSpace,
|
||||
ClassName = input.TableName,
|
||||
QueryWhetherList = queryWhetherList,
|
||||
TableField = tableFieldList
|
||||
});
|
||||
|
||||
var dirPath = new DirectoryInfo(targetPathList[i]).Parent.FullName;
|
||||
if (!Directory.Exists(dirPath))
|
||||
Directory.CreateDirectory(dirPath);
|
||||
File.WriteAllText(targetPathList[i], tResult, Encoding.UTF8);
|
||||
}
|
||||
|
||||
await AddMenu(input.TableName, input.BusName);
|
||||
}
|
||||
|
||||
private async Task AddMenu(string className, string busName)
|
||||
{
|
||||
// 先删除该表已生成的菜单列表
|
||||
var menus = await _sysMenuRep.DetachedEntities.Where(u => u.Code.StartsWith("dilon_" + className.ToLower())).ToListAsync();
|
||||
menus.ForEach(u =>
|
||||
{
|
||||
u.Delete();
|
||||
});
|
||||
var emptyGuid = System.Guid.Empty.ToString();
|
||||
// 目录
|
||||
var menuType0 = new SysMenu
|
||||
{
|
||||
Pid = emptyGuid,
|
||||
Pids = "["+ emptyGuid + "],",
|
||||
Name = busName + "管理",
|
||||
Code = "dilon_" + className.ToLower(),
|
||||
Type = 1,
|
||||
Icon = "robot",
|
||||
Router = "/" + className.ToLower(),
|
||||
Component = "PageView",
|
||||
Application = "busapp"
|
||||
};
|
||||
var pid0 = _sysMenuRep.InsertNowAsync(menuType0).GetAwaiter().GetResult().Entity.Id;
|
||||
|
||||
// 菜单
|
||||
var menuType1 = new SysMenu
|
||||
{
|
||||
Pid = pid0,
|
||||
Pids = "[0],[" + pid0 + "],",
|
||||
Name = busName + "管理",
|
||||
Code = "dilon_" + className.ToLower() + "_mgr",
|
||||
Type = 1,
|
||||
Router = "/" + className.ToLower(),
|
||||
Component = "main/" + className + "/index",
|
||||
Application = "busapp",
|
||||
OpenType = 1
|
||||
};
|
||||
var pid1 = _sysMenuRep.InsertNowAsync(menuType1).GetAwaiter().GetResult().Entity.Id;
|
||||
|
||||
// 按钮-page
|
||||
var menuType2 = new SysMenu
|
||||
{
|
||||
Pid = pid1,
|
||||
Pids = "[0],[" + pid0 + "],[" + pid1 + "],",
|
||||
Name = busName + "查询",
|
||||
Code = "dilon_" + className.ToLower() + "_mgr_page",
|
||||
Type = 2,
|
||||
Permission = className + ":page",
|
||||
Application = "busapp",
|
||||
}.InsertAsync();
|
||||
|
||||
// 按钮-detail
|
||||
var menuType2_1 = new SysMenu
|
||||
{
|
||||
Pid = pid1,
|
||||
Pids = "[0],[" + pid0 + "],[" + pid1 + "],",
|
||||
Name = busName + "详情",
|
||||
Code = "dilon_" + className.ToLower() + "_mgr_detail",
|
||||
Type = 2,
|
||||
Permission = className + ":detail",
|
||||
Application = "busapp",
|
||||
}.InsertAsync();
|
||||
|
||||
// 按钮-add
|
||||
var menuType2_2 = new SysMenu
|
||||
{
|
||||
Pid = pid1,
|
||||
Pids = "[0],[" + pid0 + "],[" + pid1 + "],",
|
||||
Name = busName + "增加",
|
||||
Code = "dilon_" + className.ToLower() + "_mgr_add",
|
||||
Type = 2,
|
||||
Permission = className + ":add",
|
||||
Application = "busapp",
|
||||
}.InsertAsync();
|
||||
|
||||
// 按钮-delete
|
||||
var menuType2_3 = new SysMenu
|
||||
{
|
||||
Pid = pid1,
|
||||
Pids = "[0],[" + pid0 + "],[" + pid1 + "],",
|
||||
Name = busName + "删除",
|
||||
Code = "dilon_" + className.ToLower() + "_mgr_delete",
|
||||
Type = 2,
|
||||
Permission = className + ":delete",
|
||||
Application = "busapp",
|
||||
}.InsertAsync();
|
||||
|
||||
// 按钮-edit
|
||||
var menuType2_4 = new SysMenu
|
||||
{
|
||||
Pid = pid1,
|
||||
Pids = "[0],[" + pid0 + "],[" + pid1 + "],",
|
||||
Name = busName + "编辑",
|
||||
Code = "dilon_" + className.ToLower() + "_mgr_edit",
|
||||
Type = 2,
|
||||
Permission = className + ":edit",
|
||||
Application = "busapp",
|
||||
}.InsertAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取模板文件路径集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private List<string> GetTemplatePathList()
|
||||
{
|
||||
var templatePath = App.WebHostEnvironment.WebRootPath + @"\Template\";
|
||||
return new List<string>() {
|
||||
templatePath + "Service.cs.vm",
|
||||
templatePath + "IService.cs.vm",
|
||||
templatePath + "Input.cs.vm",
|
||||
templatePath + "Output.cs.vm",
|
||||
templatePath + "index.vue.vm",
|
||||
templatePath + "addForm.vue.vm",
|
||||
templatePath + "editForm.vue.vm",
|
||||
templatePath + "manage.js.vm",
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置生成文件路径
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
private List<string> GetTargetPathList(SysCodeGen input)
|
||||
{
|
||||
var backendPath = new DirectoryInfo(App.WebHostEnvironment.ContentRootPath).Parent.FullName + @"\Dilon.Application\Service\" + input.TableName + @"\";
|
||||
var servicePath = backendPath + input.TableName + "Service.cs";
|
||||
var iservicePath = backendPath + "I" + input.TableName + "Service.cs";
|
||||
var inputPath = backendPath + @"Dto\" + input.TableName + "Input.cs";
|
||||
var outputPath = backendPath + @"Dto\" + input.TableName + "Output.cs";
|
||||
var frontendPath = new DirectoryInfo(App.WebHostEnvironment.ContentRootPath).Parent.Parent.FullName + @"\frontend\src\views\main\";
|
||||
var indexPath = frontendPath + input.TableName + @"\index.vue";
|
||||
var addFormPath = frontendPath + input.TableName + @"\addForm.vue";
|
||||
var editFormPath = frontendPath + input.TableName + @"\editForm.vue";
|
||||
var apiJsPath = new DirectoryInfo(App.WebHostEnvironment.ContentRootPath).Parent.Parent.FullName + @"\frontend\src\api\modular\main\" + input.TableName + "Manage.js";
|
||||
|
||||
return new List<string>() {
|
||||
servicePath,
|
||||
iservicePath,
|
||||
inputPath,
|
||||
outputPath,
|
||||
indexPath,
|
||||
addFormPath,
|
||||
editFormPath,
|
||||
apiJsPath
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
88
Api/Ewide.Core/Service/CodeGen/Dto/CodeGenConfig.cs
Normal file
88
Api/Ewide.Core/Service/CodeGen/Dto/CodeGenConfig.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
namespace Ewide.Core.Service
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成详细配置参数
|
||||
/// </summary>
|
||||
public class CodeGenConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 代码生成主表ID
|
||||
/// </summary>
|
||||
public string CodeGenId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库字段名
|
||||
/// </summary>
|
||||
public string ColumnName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 字段描述
|
||||
/// </summary>
|
||||
public string ColumnComment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// .NET类型
|
||||
/// </summary>
|
||||
public string NetType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 作用类型(字典)
|
||||
/// </summary>
|
||||
public string EffectType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 字典code
|
||||
/// </summary>
|
||||
public string DictTypeCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 列表是否缩进(字典)
|
||||
/// </summary>
|
||||
public string WhetherRetract { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否必填(字典)
|
||||
/// </summary>
|
||||
public string WhetherRequired { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否是查询条件
|
||||
/// </summary>
|
||||
public string QueryWhether { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询方式
|
||||
/// </summary>
|
||||
public string QueryType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 列表显示
|
||||
/// </summary>
|
||||
public string WhetherTable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 增改
|
||||
/// </summary>
|
||||
public string WhetherAddUpdate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主外键
|
||||
/// </summary>
|
||||
public string ColumnKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库中类型(物理类型)
|
||||
/// </summary>
|
||||
public string DataType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否是通用字段
|
||||
/// </summary>
|
||||
public string WhetherCommon { get; set; }
|
||||
}
|
||||
}
|
||||
124
Api/Ewide.Core/Service/CodeGen/Dto/CodeGenInput.cs
Normal file
124
Api/Ewide.Core/Service/CodeGen/Dto/CodeGenInput.cs
Normal file
@@ -0,0 +1,124 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Ewide.Core.Service
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成参数类
|
||||
/// </summary>
|
||||
public class CodeGenInput : XnInputBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 作者姓名
|
||||
/// </summary>
|
||||
public virtual string AuthorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类名
|
||||
/// </summary>
|
||||
public virtual string ClassName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否移除表前缀
|
||||
/// </summary>
|
||||
public virtual string TablePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生成方式
|
||||
/// </summary>
|
||||
public virtual string GenerateType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库表名
|
||||
/// </summary>
|
||||
public virtual string TableName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 命名空间
|
||||
/// </summary>
|
||||
public virtual string NameSpace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务名(业务代码包名称)
|
||||
/// </summary>
|
||||
public virtual string BusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 功能名(数据库表名称)
|
||||
/// </summary>
|
||||
public virtual string TableComment { get; set; }
|
||||
}
|
||||
|
||||
public class AddCodeGenInput : CodeGenInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据库表名
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "数据库表名不能为空")]
|
||||
public override string TableName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务名(业务代码包名称)
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "业务名不能为空")]
|
||||
public override string BusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 命名空间
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "命名空间不能为空")]
|
||||
public override string NameSpace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 作者姓名
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "作者姓名不能为空")]
|
||||
public override string AuthorName { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 类名
|
||||
///// </summary>
|
||||
//[Required(ErrorMessage = "类名不能为空")]
|
||||
//public override string ClassName { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 是否移除表前缀
|
||||
///// </summary>
|
||||
//[Required(ErrorMessage = "是否移除表前缀不能为空")]
|
||||
//public override string TablePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生成方式
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "生成方式不能为空")]
|
||||
public override string GenerateType { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 功能名(数据库表名称)
|
||||
///// </summary>
|
||||
//[Required(ErrorMessage = "数据库表名不能为空")]
|
||||
//public override string TableComment { get; set; }
|
||||
}
|
||||
|
||||
public class DeleteCodeGenInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成器Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "代码生成器Id不能为空")]
|
||||
public string Id { get; set; }
|
||||
}
|
||||
|
||||
public class UpdateCodeGenInput : CodeGenInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成器Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "代码生成器Id不能为空")]
|
||||
public string Id { get; set; }
|
||||
}
|
||||
|
||||
public class QueryCodeGenInput : DeleteCodeGenInput
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
53
Api/Ewide.Core/Service/CodeGen/Dto/CodeGenOutput.cs
Normal file
53
Api/Ewide.Core/Service/CodeGen/Dto/CodeGenOutput.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
namespace Ewide.Core.Service
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成参数类
|
||||
/// </summary>
|
||||
public class CodeGenOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成器Id
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 作者姓名
|
||||
/// </summary>
|
||||
public string AuthorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类名
|
||||
/// </summary>
|
||||
public string ClassName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否移除表前缀
|
||||
/// </summary>
|
||||
public string TablePrefix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生成方式
|
||||
/// </summary>
|
||||
public string GenerateType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库表名
|
||||
/// </summary>
|
||||
public string TableName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 包名
|
||||
/// </summary>
|
||||
public string PackageName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务名(业务代码包名称)
|
||||
/// </summary>
|
||||
public string BusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 功能名(数据库表名称)
|
||||
/// </summary>
|
||||
public string TableComment { get; set; }
|
||||
}
|
||||
}
|
||||
28
Api/Ewide.Core/Service/CodeGen/Dto/TableColumnOuput.cs
Normal file
28
Api/Ewide.Core/Service/CodeGen/Dto/TableColumnOuput.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace Ewide.Core.Service
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据库表列
|
||||
/// </summary>
|
||||
public class TableColumnOuput
|
||||
{
|
||||
/// <summary>
|
||||
/// 字段名
|
||||
/// </summary>
|
||||
public string ColumnName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库中类型
|
||||
/// </summary>
|
||||
public string DataType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 字段描述
|
||||
/// </summary>
|
||||
public string ColumnComment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主外键
|
||||
/// </summary>
|
||||
public string ColumnKey { get; set; }
|
||||
}
|
||||
}
|
||||
28
Api/Ewide.Core/Service/CodeGen/Dto/TableOutput.cs
Normal file
28
Api/Ewide.Core/Service/CodeGen/Dto/TableOutput.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace Ewide.Core.Service
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据库表列表参数
|
||||
/// </summary>
|
||||
public class TableOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// 表名(字母形式的)
|
||||
/// </summary>
|
||||
public string TableName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public string CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
public string UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 表名称描述(注释)(功能名)
|
||||
/// </summary>
|
||||
public string TableComment { get; set; }
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user