├── .gitignore ├── CoreWebApi ├── Core.Common │ ├── Attributes │ │ └── CachingAttribute.cs │ ├── Const.cs │ ├── Core.Common.csproj │ ├── Dapper │ │ ├── DapperHelper.cs │ │ └── DbContext.cs │ ├── EFCore │ │ ├── EFContext.cs │ │ └── IEFContext.cs │ ├── Helper │ │ ├── ConfigHelper.cs │ │ ├── HttpContextHelper.cs │ │ ├── MD5Helper.cs │ │ ├── MailHelper.cs │ │ └── SerializeHelper.cs │ ├── MemoryCache │ │ ├── IMemoryCache.cs │ │ └── MemoryCache.cs │ └── Redis │ │ ├── IRedisCacheManager.cs │ │ └── RedisCacheManager.cs ├── Core.IRepository │ ├── BASE │ │ └── IBaseRepository.cs │ ├── Core.IRepository.csproj │ ├── IAdvertisementRepository.cs │ ├── IBlogArticleRepository.cs │ ├── IUserRepository.cs │ └── Mis │ │ ├── IHomeRepository.cs │ │ ├── ILoginRepository.cs │ │ └── ISystemUserRepository.cs ├── Core.IServices │ ├── BASE │ │ └── IBaseServices.cs │ ├── Core.IServices.csproj │ ├── IAdvertisementServices.cs │ ├── IBlogArticleServices.cs │ ├── IUserServices.cs │ └── Mis │ │ ├── IHomeServices.cs │ │ ├── ILoginServices.cs │ │ └── ISystemUserServices.cs ├── Core.Model │ ├── Core.Model.csproj │ ├── Enum.cs │ ├── IDependencyMsi.cs │ ├── ITreeData.cs │ ├── MessageModel.cs │ ├── Models │ │ ├── Advertisement.cs │ │ ├── BaseModel.cs │ │ ├── BlogArticle.cs │ │ ├── SystemAction.cs │ │ ├── SystemGroup.cs │ │ ├── SystemMenu.cs │ │ ├── SystemModule.cs │ │ ├── SystemPrivilege.cs │ │ ├── SystemRole.cs │ │ ├── SystemUser.cs │ │ ├── SystemUserGroup.cs │ │ └── SystemUserRole.cs │ ├── PageModel.cs │ ├── ResponseMessage.cs │ ├── SearchModels │ │ ├── SearchBase.cs │ │ └── UserSearch.cs │ ├── TableModel.cs │ ├── Text.cs │ ├── UtilConvert.cs │ └── ViewModels │ │ ├── BlogViewModel.cs │ │ ├── HomeVM.cs │ │ ├── UserInfoVM.cs │ │ └── UserVM.cs ├── Core.Msi │ ├── Common │ │ └── UserHelper.cs │ ├── Controllers │ │ ├── HomeController.cs │ │ ├── LoginController.cs │ │ └── SystemUserController.cs │ ├── Core.Msi.csproj │ ├── Filter │ │ └── ValidateUserFilter.cs │ ├── Models │ │ └── ErrorViewModel.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Startup.cs │ ├── Views │ │ ├── Home │ │ │ ├── About.cshtml │ │ │ ├── Contact.cshtml │ │ │ ├── ECharts.cshtml │ │ │ ├── Header.cshtml │ │ │ ├── Index.cshtml │ │ │ ├── Menu.cshtml │ │ │ └── Privacy.cshtml │ │ ├── Login │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ ├── _404.cshtml │ │ │ ├── _CookieConsentPartial.cshtml │ │ │ ├── _Layout.cshtml │ │ │ └── _ValidationScriptsPartial.cshtml │ │ ├── SystemUser │ │ │ └── Index.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ │ ├── css │ │ ├── 404ErrorPage.css │ │ ├── ErrorInitialization.css │ │ ├── public.css │ │ ├── site.css │ │ └── site.min.css │ │ ├── favicon.ico │ │ ├── images │ │ ├── background_404.jpg │ │ ├── banner1.svg │ │ ├── banner2.svg │ │ ├── banner3.svg │ │ └── cloud.jpg │ │ ├── js │ │ ├── echarts.common.min.js │ │ ├── site.js │ │ └── site.min.js │ │ ├── layui │ │ ├── css │ │ │ ├── layui.css │ │ │ ├── layui.mobile.css │ │ │ └── modules │ │ │ │ ├── code.css │ │ │ │ ├── laydate │ │ │ │ └── default │ │ │ │ │ └── laydate.css │ │ │ │ └── layer │ │ │ │ └── default │ │ │ │ ├── icon-ext.png │ │ │ │ ├── icon.png │ │ │ │ ├── layer.css │ │ │ │ ├── loading-0.gif │ │ │ │ ├── loading-1.gif │ │ │ │ └── loading-2.gif │ │ ├── font │ │ │ ├── iconfont.eot │ │ │ ├── iconfont.svg │ │ │ ├── iconfont.ttf │ │ │ ├── iconfont.woff │ │ │ └── iconfont.woff2 │ │ ├── images │ │ │ └── face │ │ │ │ ├── 0.gif │ │ │ │ ├── 1.gif │ │ │ │ ├── 10.gif │ │ │ │ ├── 11.gif │ │ │ │ ├── 12.gif │ │ │ │ ├── 13.gif │ │ │ │ ├── 14.gif │ │ │ │ ├── 15.gif │ │ │ │ ├── 16.gif │ │ │ │ ├── 17.gif │ │ │ │ ├── 18.gif │ │ │ │ ├── 19.gif │ │ │ │ ├── 2.gif │ │ │ │ ├── 20.gif │ │ │ │ ├── 21.gif │ │ │ │ ├── 22.gif │ │ │ │ ├── 23.gif │ │ │ │ ├── 24.gif │ │ │ │ ├── 25.gif │ │ │ │ ├── 26.gif │ │ │ │ ├── 27.gif │ │ │ │ ├── 28.gif │ │ │ │ ├── 29.gif │ │ │ │ ├── 3.gif │ │ │ │ ├── 30.gif │ │ │ │ ├── 31.gif │ │ │ │ ├── 32.gif │ │ │ │ ├── 33.gif │ │ │ │ ├── 34.gif │ │ │ │ ├── 35.gif │ │ │ │ ├── 36.gif │ │ │ │ ├── 37.gif │ │ │ │ ├── 38.gif │ │ │ │ ├── 39.gif │ │ │ │ ├── 4.gif │ │ │ │ ├── 40.gif │ │ │ │ ├── 41.gif │ │ │ │ ├── 42.gif │ │ │ │ ├── 43.gif │ │ │ │ ├── 44.gif │ │ │ │ ├── 45.gif │ │ │ │ ├── 46.gif │ │ │ │ ├── 47.gif │ │ │ │ ├── 48.gif │ │ │ │ ├── 49.gif │ │ │ │ ├── 5.gif │ │ │ │ ├── 50.gif │ │ │ │ ├── 51.gif │ │ │ │ ├── 52.gif │ │ │ │ ├── 53.gif │ │ │ │ ├── 54.gif │ │ │ │ ├── 55.gif │ │ │ │ ├── 56.gif │ │ │ │ ├── 57.gif │ │ │ │ ├── 58.gif │ │ │ │ ├── 59.gif │ │ │ │ ├── 6.gif │ │ │ │ ├── 60.gif │ │ │ │ ├── 61.gif │ │ │ │ ├── 62.gif │ │ │ │ ├── 63.gif │ │ │ │ ├── 64.gif │ │ │ │ ├── 65.gif │ │ │ │ ├── 66.gif │ │ │ │ ├── 67.gif │ │ │ │ ├── 68.gif │ │ │ │ ├── 69.gif │ │ │ │ ├── 7.gif │ │ │ │ ├── 70.gif │ │ │ │ ├── 71.gif │ │ │ │ ├── 8.gif │ │ │ │ └── 9.gif │ │ ├── lay │ │ │ └── modules │ │ │ │ ├── carousel.js │ │ │ │ ├── code.js │ │ │ │ ├── colorpicker.js │ │ │ │ ├── element.js │ │ │ │ ├── flow.js │ │ │ │ ├── form.js │ │ │ │ ├── jquery.js │ │ │ │ ├── laydate.js │ │ │ │ ├── layedit.js │ │ │ │ ├── layer.js │ │ │ │ ├── laypage.js │ │ │ │ ├── laytpl.js │ │ │ │ ├── mobile.js │ │ │ │ ├── rate.js │ │ │ │ ├── slider.js │ │ │ │ ├── table.js │ │ │ │ ├── transfer.js │ │ │ │ ├── tree.js │ │ │ │ ├── upload.js │ │ │ │ └── util.js │ │ ├── layui.all.js │ │ └── layui.js │ │ └── lib │ │ ├── bootstrap │ │ ├── .bower.json │ │ ├── LICENSE │ │ └── dist │ │ │ ├── css │ │ │ ├── bootstrap-theme.css │ │ │ ├── bootstrap-theme.css.map │ │ │ ├── bootstrap-theme.min.css │ │ │ ├── bootstrap-theme.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── js │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.min.js │ │ │ └── npm.js │ │ ├── jquery-validation-unobtrusive │ │ ├── .bower.json │ │ ├── LICENSE.txt │ │ ├── jquery.validate.unobtrusive.js │ │ └── jquery.validate.unobtrusive.min.js │ │ ├── jquery-validation │ │ ├── .bower.json │ │ ├── LICENSE.md │ │ └── dist │ │ │ ├── additional-methods.js │ │ │ ├── additional-methods.min.js │ │ │ ├── jquery.validate.js │ │ │ └── jquery.validate.min.js │ │ └── jquery │ │ ├── .bower.json │ │ ├── LICENSE.txt │ │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map ├── Core.Repository │ ├── AdvertisementRepository.cs │ ├── BASE │ │ └── BaseRepository.cs │ ├── BlogArticleRepository.cs │ ├── Core.Repository.csproj │ ├── Mis │ │ ├── HomeRepository.cs │ │ ├── LoginRepository.cs │ │ └── SystemUserRepository.cs │ ├── Sugar │ │ ├── BaseDBConfig.cs │ │ └── DbContext.cs │ └── UserRepository.cs ├── Core.Services │ ├── AdvertisementServices.cs │ ├── BASE │ │ └── BaseServices.cs │ ├── BlogArticleServices.cs │ ├── Core.Services.csproj │ ├── Mis │ │ ├── HomeServices.cs │ │ ├── LoginServices.cs │ │ └── SystemUserServices.cs │ └── UserServices.cs ├── CoreDBConsole │ ├── CoreDBConsole.csproj │ └── Program.cs ├── CoreWebApi.sln └── CoreWebApi │ ├── AOP │ ├── CoreCacheAOP.cs │ ├── CoreLogAOP.cs │ ├── ICachingProvider.cs │ └── MemoryCaching.cs │ ├── AuthHelper │ └── OverWrite │ │ ├── JwtHelper.cs │ │ └── JwtTokenAuth.cs │ ├── AutoMapper │ └── CustomProfile.cs │ ├── Controllers │ ├── BlogController.cs │ ├── LoginController.cs │ ├── TodoItemController.cs │ ├── UserController.cs │ └── ValuesController.cs │ ├── CoreWebApi.csproj │ ├── Filter │ └── GlobalExceptionFilter.cs │ ├── Models │ └── TodeItem.cs │ ├── Nlog.config │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── Startup.cs │ ├── SwaggerHelper │ ├── CustomApiVersion.cs │ └── CustomRouteAttribute.cs │ ├── appsettings.Development.json │ ├── appsettings.json │ └── log4net.config ├── DatabaseDesign └── CoreWeb.pdm └── README.md /CoreWebApi/Core.Common/Attributes/CachingAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Common.Attributes 6 | { 7 | /// 8 | /// 使用时验证,添加到要缓存数据的方法中。针对Method有效 9 | /// 10 | [AttributeUsage(AttributeTargets.Method,Inherited =true)] 11 | public class CachingAttribute: Attribute 12 | { 13 | // 缓存绝对过期时间 14 | public int AbsoluteExpiration { get; set; } = 30; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Common/Const.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Common 6 | { 7 | /// 8 | /// key-value config 9 | /// 10 | public class Const 11 | { 12 | /// 13 | /// 用户sessoin key 14 | /// 15 | public const string UserKey = "user"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Common/Core.Common.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Common/Dapper/DapperHelper.cs: -------------------------------------------------------------------------------- 1 | using Core.Common.Helper; 2 | using Microsoft.Extensions.Options; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Data; 6 | using System.Data.SqlClient; 7 | using System.Text; 8 | 9 | namespace Core.Common.Dapper 10 | { 11 | public class DapperHelper 12 | { 13 | /// 数据库连接名 14 | private static string _connection = string.Empty; 15 | 16 | /// 获取连接名 17 | private static string Connection 18 | { 19 | get { return _connection; } 20 | //set { _connection = value; } 21 | } 22 | 23 | /// 返回连接实例 24 | private static IDbConnection dbConnection = null; 25 | 26 | /// 静态变量保存类的实例 27 | //private static DapperHelper uniqueInstance; 28 | 29 | /// 定义一个标识确保线程同步 30 | private static readonly object locker = new object(); 31 | //private IOptions options; 32 | /// 33 | /// 私有构造方法,使外界不能创建该类的实例,以便实现单例模式 34 | /// 35 | private DapperHelper(IOptions options) 36 | { 37 | _connection = options.Value.SqlServer.Value; 38 | // 这里为了方便演示直接写的字符串,实例项目中可以将连接字符串放在配置文件中,再进行读取。 39 | //_connection = @"server=.;uid=sa;pwd=sasa;database=ContosoUniversity1"; 40 | } 41 | 42 | //private DapperHelper() 43 | //{ 44 | //} 45 | 46 | /// 47 | /// 获取实例,这里为单例模式,保证只存在一个实例 48 | /// 49 | /// 50 | //public static DapperHelper GetInstance() 51 | //{ 52 | // uniqueInstance = null; 53 | // 双重锁定实现单例模式,在外层加个判空条件主要是为了减少加锁、释放锁的不必要的损耗 54 | // if (uniqueInstance == null) 55 | // { 56 | // lock (locker) 57 | // { 58 | // if (uniqueInstance == null) 59 | // { 60 | // uniqueInstance = new DapperHelper(); 61 | // } 62 | // } 63 | // } 64 | // return uniqueInstance; 65 | //} 66 | 67 | 68 | /// 69 | /// 创建数据库连接对象并打开链接 70 | /// 71 | /// 72 | public static IDbConnection OpenCurrentDbConnection() 73 | { 74 | if (dbConnection == null) 75 | { 76 | dbConnection = new SqlConnection(Connection); 77 | } 78 | //判断连接状态 79 | if (dbConnection.State == ConnectionState.Closed) 80 | { 81 | dbConnection.Open(); 82 | } 83 | return dbConnection; 84 | } 85 | } 86 | 87 | } -------------------------------------------------------------------------------- /CoreWebApi/Core.Common/EFCore/IEFContext.cs: -------------------------------------------------------------------------------- 1 | using Core.Model; 2 | using Core.Model.Models; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.EntityFrameworkCore.Infrastructure; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Data; 8 | using System.Linq.Expressions; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | 12 | namespace Core.Common.EFCore 13 | { 14 | /// 15 | /// 自定义EF接口 16 | /// 17 | public interface IEFContext 18 | { 19 | /// 20 | /// 添加 21 | /// 22 | /// 23 | /// 实体 24 | void AddEntity(T entity) where T : BaseModel; 25 | 26 | /// 27 | /// 修改 28 | /// 29 | /// 30 | /// 实体 31 | void UpdateEntity(T entity) where T : BaseModel; 32 | 33 | /// 34 | /// 修改属性 35 | /// 36 | /// 37 | /// 实体 38 | /// 属性 39 | void UpdateProperty(T entity, Expression> field) where T : BaseModel; 40 | 41 | /// 42 | /// 修改属性 43 | /// 44 | /// 45 | /// 46 | /// 属性名 47 | void UpdateProperty(T entity, string fieldName) where T : BaseModel; 48 | 49 | /// 50 | /// 删除 51 | /// 52 | /// 53 | /// 54 | void DeleteEntity(T entity) where T : BaseModel; 55 | 56 | 57 | /// 58 | /// 获取指定实体的数据 59 | /// 60 | /// 泛型 61 | /// 62 | DbSet Set() where T : class; 63 | 64 | 65 | /// 66 | /// 级联删除 67 | /// 68 | /// 69 | /// 70 | void CascadeDelete(T entity) where T : BaseModel, ITreeData; 71 | 72 | 73 | /// 74 | /// 保存 75 | /// 76 | /// 77 | int SaveChanges(); 78 | 79 | /// 80 | /// 执行sql语句或存储过程返回datatable 81 | /// 82 | /// sql语句或存储过程名 83 | /// 类型 84 | /// 参数 85 | /// 86 | DataTable GetDataTableBySql(string sql, CommandType commandType, params object[] paras); 87 | 88 | /// 89 | /// 获取数据库信息 90 | /// 91 | DatabaseFacade Database { get; } 92 | 93 | /// 94 | /// 数据库连接字符串Key 95 | /// 96 | string CSName { get; set; } 97 | 98 | /// 99 | /// 初始化数据 100 | /// 101 | /// 所有模块 102 | /// True:数据库初始化完成 False:即数据库初始化失败,数据库已存在 103 | //Task DataInit(object allModules); 104 | 105 | IEFContext CreateNew(); 106 | IEFContext ReCreate(); 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Common/Helper/ConfigHelper.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Options; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Core.Common.Helper 7 | { 8 | /// 9 | /// 配置信息映射实体 10 | /// 11 | public class AppSettings 12 | { 13 | public RedisCaching RedisCaching { get; set; } 14 | public SqlServer SqlServer { get; set; } 15 | public Mysql Mysql { get; set; } 16 | 17 | } 18 | public class RedisCaching 19 | { 20 | public bool Enabled { get; set; } 21 | 22 | public string ConnectionString { get; set; } 23 | } 24 | public class SqlServer 25 | { 26 | public string Value { get; set; } 27 | } 28 | public class Mysql 29 | { 30 | public string Value { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Common/Helper/HttpContextHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Common.Helper 6 | { 7 | public static class HttpContextHelper 8 | { 9 | public static IServiceProvider ServiceProvider; 10 | 11 | public static Microsoft.AspNetCore.Http.HttpContext Current 12 | { 13 | get 14 | { 15 | 16 | //object factory = ServiceProvider.GetService(typeof(Microsoft.AspNetCore.Mvc.Infrastructure.IActionContextAccessor)); 17 | //Microsoft.AspNetCore.Http.HttpContext context = ((Microsoft.AspNetCore.Mvc.Infrastructure.ActionContextAccessor)factory).ActionContext.HttpContext; 18 | 19 | object factory = ServiceProvider.GetService(typeof(Microsoft.AspNetCore.Http.IHttpContextAccessor)); 20 | Microsoft.AspNetCore.Http.HttpContext context = ((Microsoft.AspNetCore.Http.HttpContextAccessor)factory).HttpContext; 21 | 22 | return context; 23 | } 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Common/Helper/MD5Helper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Security.Cryptography; 4 | using System.Text; 5 | 6 | namespace Core.Common.Helper 7 | { 8 | /// 9 | /// Md5 10 | /// 11 | public class MD5Helper 12 | { 13 | /// 14 | /// Md5加密 15 | /// 16 | /// 17 | /// 18 | public static string GetMD5String(string str) 19 | { 20 | byte[] buffer = Encoding.UTF8.GetBytes(str); 21 | MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider(); 22 | byte[] vs = md5.ComputeHash(buffer); 23 | StringBuilder sb = new StringBuilder(); 24 | foreach (var item in vs) 25 | { 26 | sb.Append(item.ToString("x2")); 27 | } 28 | return sb.ToString(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Common/Helper/MailHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Net; 4 | using System.Net.Mail; 5 | using System.Text; 6 | 7 | namespace Core.Common.Helper 8 | { 9 | public class MailHelper 10 | { 11 | 12 | public static void SendMail(string receiver, MailContent mailContent, MailConfig mailConfig) 13 | { 14 | MailMessage mailMsg = new MailMessage();//实例化对象 15 | mailMsg.From = new MailAddress(mailConfig.Sender, mailConfig.SenderName);//源邮件地址和发件人 16 | mailMsg.To.Add(new MailAddress(receiver));//收件人地址 17 | mailMsg.Subject = mailContent.Subject;//发送邮件的标题 18 | mailMsg.Body = mailContent.Body;//发送邮件的内容 19 | //指定smtp服务地址(根据发件人邮箱指定对应SMTP服务器地址) 20 | SmtpClient client = new SmtpClient();//格式:smtp.126.com smtp.164.com 21 | // 服务器名称 22 | client.Host = mailConfig.Host; 23 | //端口 24 | client.Port = 587; 25 | //启用加密 26 | client.EnableSsl = true; 27 | //通过用户名和密码验证发件人身份 // 28 | client.Credentials = new NetworkCredential(mailConfig.Sender, mailConfig.Password); 29 | //发送邮件 30 | client.Send(mailMsg); 31 | } 32 | } 33 | 34 | /// 35 | /// 邮件内容 36 | /// 37 | public class MailContent 38 | { 39 | /// 40 | /// 标题 41 | /// 42 | public string Subject { get; set; } 43 | /// 44 | /// 内容 45 | /// 46 | public string Body { get; set; } 47 | } 48 | 49 | 50 | /// 51 | /// 邮箱配置 52 | /// 53 | public class MailConfig 54 | { 55 | /// 56 | /// 发送人 57 | /// 58 | public string Sender { get; set; } 59 | /// 60 | /// 发送人名称 61 | /// 62 | public string SenderName { get; set; } 63 | /// 64 | /// 邮件服务器 65 | /// 66 | public string Host { get; set; } 67 | /// 68 | /// 授权码/密码 69 | /// 70 | public string Password { get; set; } 71 | 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Common/Helper/SerializeHelper.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Core.Common.Helper 8 | { 9 | /// 10 | /// 序列化帮助类 11 | /// 12 | public class SerializeHelper 13 | { 14 | 15 | private static IsoDateTimeConverter _timeFormat; 16 | /// 17 | /// 序列化为字节数组 18 | /// 19 | /// 20 | /// 21 | public static byte[] Serialize(object obj) 22 | { 23 | var jsonString = JsonConvert.SerializeObject(obj); 24 | return Encoding.UTF8.GetBytes(jsonString); 25 | } 26 | 27 | /// 28 | /// 序列化为字符串 29 | /// 30 | /// 31 | /// 32 | public static string SerializeObject(object obj) 33 | { 34 | if (obj == null) 35 | return null; 36 | return JsonConvert.SerializeObject(obj, TimeFormat); 37 | } 38 | 39 | /// 40 | /// 反序列化 字节数组 41 | /// 42 | /// 43 | /// 字节数组 44 | /// 45 | public static T Deserialize(byte[] value) 46 | { 47 | if (value == null) 48 | { 49 | return default(T); 50 | } 51 | var jsonString = Encoding.UTF8.GetString(value); 52 | return JsonConvert.DeserializeObject(jsonString); 53 | } 54 | 55 | /// 56 | /// 反序列化 字符串 57 | /// 58 | /// 59 | /// 字符串 60 | /// 61 | public static T DeserializeObject(string obj) 62 | { 63 | if (string.IsNullOrEmpty(obj)) 64 | return default(T); 65 | return JsonConvert.DeserializeObject(obj); 66 | } 67 | 68 | /// 69 | /// 序列化时间格式 70 | /// 71 | public static IsoDateTimeConverter TimeFormat 72 | { 73 | get 74 | { 75 | if (_timeFormat == null) 76 | { 77 | _timeFormat = new IsoDateTimeConverter() 78 | { 79 | DateTimeFormat = "yyyy-MM-dd HH:mm:ss" 80 | }; 81 | } 82 | return _timeFormat; 83 | } 84 | set 85 | { 86 | _timeFormat = value; 87 | } 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Common/MemoryCache/IMemoryCache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Common.MemoryCache 6 | { 7 | /// 8 | /// 缓存接口 9 | /// 10 | public interface ICache 11 | { 12 | /// 13 | /// 取数据 14 | /// 15 | /// 16 | /// 17 | object Get(string cacheKey); 18 | /// 19 | /// 存数据 20 | /// 21 | /// 22 | /// 23 | void Set(string cacheLey, object cacheValue); 24 | /// 25 | /// 移除数据 26 | /// 27 | /// 28 | void Remove(string cacheKey); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Common/MemoryCache/MemoryCache.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Caching.Memory; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Core.Common.MemoryCache 7 | { 8 | public class Cache : ICache 9 | { 10 | private IMemoryCache _cache; 11 | 12 | public Cache(IMemoryCache cache) 13 | { 14 | _cache = cache; 15 | } 16 | 17 | /// 18 | /// 根据Key取缓存 19 | /// 20 | /// 21 | /// 22 | public object Get(string cacheKey) 23 | { 24 | return _cache.Get(cacheKey); 25 | } 26 | /// 27 | /// 移除缓存 28 | /// 29 | /// 30 | public void Remove(string cacheKey) 31 | { 32 | _cache.Remove(cacheKey); 33 | } 34 | 35 | /// 36 | /// 写入缓存 37 | /// 38 | /// 39 | /// 40 | public void Set(string cacheLey, object cacheValue) 41 | { 42 | // 设置过期时间 43 | _cache.Set(cacheLey, cacheValue, TimeSpan.FromSeconds(7200)); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /CoreWebApi/Core.IRepository/BASE/IBaseRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq.Expressions; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.IRepository.BASE 8 | { 9 | public interface IBaseRepository where TEntity : class 10 | { 11 | Task QueryByID(object objId); 12 | Task QueryByID(object objId, bool blnUseCache = false); 13 | Task> QueryByIDs(object[] lstIds); 14 | 15 | Task Add(TEntity model); 16 | 17 | Task DeleteById(object id); 18 | 19 | Task Delete(TEntity model); 20 | 21 | Task DeleteByIds(object[] ids); 22 | 23 | Task Update(TEntity model); 24 | Task Update(TEntity entity, string strWhere); 25 | Task Update(TEntity entity, List lstColumns = null, List lstIgnoreColumns = null, string strWhere = ""); 26 | 27 | Task> Query(); 28 | Task> Query(string strWhere); 29 | Task> Query(Expression> whereExpression); 30 | Task> Query(Expression> whereExpression, string strOrderByFileds); 31 | Task> Query(Expression> whereExpression, Expression> orderByExpression, bool isAsc = true); 32 | Task> Query(string strWhere, string strOrderByFileds); 33 | Task> Query(Expression> whereExpression, int intTop, string strOrderByFileds); 34 | Task> Query(string strWhere, int intTop, string strOrderByFileds); 35 | Task> Query( 36 | Expression> whereExpression, int intPageIndex, int intPageSize, string strOrderByFileds); 37 | Task> Query(string strWhere, int intPageIndex, int intPageSize, string strOrderByFileds); 38 | Task> QueryPage(Expression> whereExpression, int intPageIndex = 0, int intPageSize = 20, string strOrderByFileds = null); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /CoreWebApi/Core.IRepository/Core.IRepository.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /CoreWebApi/Core.IRepository/IAdvertisementRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.IRepository.BASE; 2 | using Core.Model.Models; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq.Expressions; 6 | using System.Text; 7 | 8 | namespace Core.IRepository 9 | { 10 | /// 11 | /// 广告业务逻辑接口 12 | /// 13 | public interface IAdvertisementRepository: IBaseRepository 14 | { 15 | /// 16 | /// 求和 17 | /// 18 | /// 19 | /// 20 | /// 21 | int Sum(int i, int j); 22 | ///// 23 | ///// 增 24 | ///// 25 | ///// 26 | ///// 27 | //int Add(Advertisement model); 28 | ///// 29 | ///// 删 30 | ///// 31 | ///// 32 | ///// 33 | //bool Delete(Advertisement model); 34 | ///// 35 | ///// 改 36 | ///// 37 | ///// 38 | ///// 39 | //bool Update(Advertisement model); 40 | ///// 41 | ///// 数据列表k 42 | ///// 43 | ///// 44 | ///// 45 | //List Query(Expression> whereExpression); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /CoreWebApi/Core.IRepository/IBlogArticleRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.IRepository.BASE; 2 | using Core.Model.Models; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Core.IRepository 9 | { 10 | public interface IBlogArticleRepository : IBaseRepository 11 | { 12 | BlogArticle GetBlog(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CoreWebApi/Core.IRepository/IUserRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.Model.ViewModels; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.IRepository 8 | { 9 | /// 10 | /// 用户数据层接口 11 | /// 12 | public interface IUserRepository 13 | { 14 | /// 15 | /// 用户注册 16 | /// 17 | /// 18 | Task UserRegister(LoginVM loginVM); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CoreWebApi/Core.IRepository/Mis/IHomeRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.Model; 2 | using Core.Model.Models; 3 | using Core.Model.ViewModels; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Core.IRepository.Mis 10 | { 11 | public interface IHomeRepository: IDependencyMsi 12 | { 13 | /// 14 | /// 获取菜单列表 15 | /// 16 | Task> GetMenuList(Guid userID); 17 | /// 18 | /// 根据用户与访问菜单获取对应的按钮 19 | /// 20 | /// 21 | /// 22 | /// 23 | Task> GetActionList(Guid userID, Guid menuID); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /CoreWebApi/Core.IRepository/Mis/ILoginRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.Model; 2 | using Core.Model.ViewModels; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Core.IRepository.Mis 8 | { 9 | public interface ILoginRepository: IDependencyMsi 10 | { 11 | /// 12 | /// 获取用户信息 13 | /// 14 | /// 15 | /// 16 | /// 17 | ResponseMessage GetUserInfo(string itCode, string password); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CoreWebApi/Core.IRepository/Mis/ISystemUserRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.Model; 2 | using Core.Model.SearchModels; 3 | using Core.Model.ViewModels; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Core.IRepository.Mis 10 | { 11 | public interface ISystemUserRepository: IDependencyMsi 12 | { 13 | /// 14 | /// 获取用户列表 15 | /// 16 | /// 17 | Task> GetUserList(UserSearch search); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CoreWebApi/Core.IServices/BASE/IBaseServices.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq.Expressions; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.IServices.BASE 8 | { 9 | public interface IBaseServices where TEntity : class 10 | { 11 | Task QueryByID(object objId); 12 | Task QueryByID(object objId, bool blnUseCache = false); 13 | Task> QueryByIDs(object[] lstIds); 14 | 15 | Task Add(TEntity model); 16 | 17 | Task DeleteById(object id); 18 | 19 | Task Delete(TEntity model); 20 | 21 | Task DeleteByIds(object[] ids); 22 | 23 | Task Update(TEntity model); 24 | Task Update(TEntity entity, string strWhere); 25 | 26 | Task Update(TEntity entity, List lstColumns = null, List lstIgnoreColumns = null, string strWhere = ""); 27 | 28 | Task> Query(); 29 | Task> Query(string strWhere); 30 | Task> Query(Expression> whereExpression); 31 | Task> Query(Expression> whereExpression, string strOrderByFileds); 32 | Task> Query(Expression> whereExpression, Expression> orderByExpression, bool isAsc = true); 33 | Task> Query(string strWhere, string strOrderByFileds); 34 | 35 | Task> Query(Expression> whereExpression, int intTop, string strOrderByFileds); 36 | Task> Query(string strWhere, int intTop, string strOrderByFileds); 37 | 38 | Task> Query( 39 | Expression> whereExpression, int intPageIndex, int intPageSize, string strOrderByFileds); 40 | Task> Query(string strWhere, int intPageIndex, int intPageSize, string strOrderByFileds); 41 | 42 | 43 | Task> QueryPage(Expression> whereExpression, int intPageIndex = 0, int intPageSize = 20, string strOrderByFileds = null); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /CoreWebApi/Core.IServices/Core.IServices.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /CoreWebApi/Core.IServices/IAdvertisementServices.cs: -------------------------------------------------------------------------------- 1 | using Core.IServices.BASE; 2 | using Core.Model.Models; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq.Expressions; 6 | using System.Text; 7 | 8 | namespace Core.IServices 9 | { 10 | public interface IAdvertisementServices: IBaseServices 11 | { 12 | /// 13 | /// 求和 14 | /// 15 | /// 16 | /// 17 | /// 18 | int Sum(int i, int j); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CoreWebApi/Core.IServices/IBlogArticleServices.cs: -------------------------------------------------------------------------------- 1 | using Core.IServices.BASE; 2 | using Core.Model.Models; 3 | using Core.Model.ViewModels; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Core.IServices 10 | { 11 | public interface IBlogArticleServices:IBaseServices 12 | { 13 | /// 14 | /// 获取文章列表 15 | /// 16 | /// 17 | Task> GetBlogs(); 18 | /// 19 | /// 获取博客详情 20 | /// 21 | /// 22 | /// 23 | Task getBlogDetails(int id); 24 | 25 | /// 26 | /// Dapper测试 27 | /// 28 | /// 29 | BlogArticle GetBlog(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /CoreWebApi/Core.IServices/IUserServices.cs: -------------------------------------------------------------------------------- 1 | using Core.Model.ViewModels; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.IServices 8 | { 9 | /// 10 | /// 用户业务层接口 11 | /// 12 | public interface IUserServices 13 | { 14 | /// 15 | /// 用户注册 16 | /// 17 | /// 18 | Task UserRegister(LoginVM loginVM); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CoreWebApi/Core.IServices/Mis/IHomeServices.cs: -------------------------------------------------------------------------------- 1 | using Core.Model; 2 | using Core.Model.Models; 3 | using Core.Model.ViewModels; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Core.IServices.Mis 10 | { 11 | public interface IHomeServices : IDependencyMsi 12 | { 13 | /// 14 | /// 获取当前用户所用的菜单列表 15 | /// 16 | /// 17 | /// 18 | Task> GetMenuList(Guid userID); 19 | /// 20 | /// 根据用户与访问菜单获取对应的按钮 21 | /// 22 | /// 23 | /// 24 | /// 25 | Task> GetActionList(Guid userID,Guid menuID); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /CoreWebApi/Core.IServices/Mis/ILoginServices.cs: -------------------------------------------------------------------------------- 1 | using Core.Model; 2 | using Core.Model.ViewModels; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Core.IServices.Mis 8 | { 9 | public interface ILoginServices: IDependencyMsi 10 | { 11 | /// 12 | /// 获取用户信息 13 | /// 14 | /// 15 | /// 16 | /// 17 | ResponseMessage GetUserInfo(string itCode,string password); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CoreWebApi/Core.IServices/Mis/ISystemUserServices.cs: -------------------------------------------------------------------------------- 1 | using Core.Model; 2 | using Core.Model.Models; 3 | using Core.Model.SearchModels; 4 | using Core.Model.ViewModels; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Core.IServices.Mis 11 | { 12 | public interface ISystemUserServices : IDependencyMsi 13 | { 14 | /// 15 | /// 获取用户列表 16 | /// 17 | /// 18 | Task> GetUserList(UserSearch search); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/Core.Model.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/Enum.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Model 6 | { 7 | /// 8 | /// 性别 9 | /// 10 | public enum SexEnum 11 | { 12 | 秘密, 13 | 男, 14 | 女 15 | } 16 | /// 17 | /// 用户类型 18 | /// 19 | public enum UserTypeEnum 20 | { 21 | 管理员, 22 | 用户 23 | } 24 | /// 25 | /// 数据库类型 26 | /// 27 | public enum DBTypeEnum 28 | { 29 | Mysql, 30 | SqlServer, 31 | } 32 | public enum PrivilegeTypeEnum 33 | { 34 | 菜单=1, 35 | 按钮=2 36 | } 37 | /// 38 | /// 按钮位置 39 | /// 40 | public enum ActionTypeEnum 41 | { 42 | 行外=1, 43 | 行内=2 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/IDependencyMsi.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Model 6 | { 7 | /// 8 | /// Msi项目的需要依赖注入的类需要继承此接口 9 | /// 10 | public interface IDependencyMsi 11 | { 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/ITreeData.cs: -------------------------------------------------------------------------------- 1 | using Core.Model.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Core.Model 7 | { 8 | /// 9 | /// 树形数据接口 10 | /// 11 | public interface ITreeData 12 | { 13 | /// 14 | /// 父节点ID 15 | /// 16 | Guid? ParentID { get; set; } 17 | } 18 | /// 19 | /// 树形数据泛型接口 20 | /// 21 | /// 22 | public interface ITreeData : ITreeData where T : BaseModel 23 | { 24 | /// 25 | /// 实现这个方法获得所有的子节点数据 26 | /// 27 | /// 所有子节点数据 28 | List GetChildrenList { get; } 29 | 30 | /// 31 | /// 获取父节点 32 | /// 33 | T Parent { get; } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/MessageModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Model 6 | { 7 | /// 8 | /// 通用返回信息类(API) 9 | /// 10 | /// 11 | public class MessageModel 12 | { 13 | /// 14 | /// 操作是否成功 15 | /// 16 | public bool Success { get; set; } 17 | 18 | /// 19 | /// 返回信息 20 | /// 21 | public string Msg { get; set; } 22 | /// 23 | /// 返回数据集合 24 | /// 25 | public List Data { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/Models/Advertisement.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Model.Models 6 | { 7 | /// 8 | /// 广告 9 | /// 10 | public class Advertisement 11 | { 12 | /// 13 | /// 分类ID 14 | /// 15 | public int Id { get; set; } 16 | /// 17 | /// 创建时间 18 | /// 19 | public DateTime CreateDate { get; set; } 20 | 21 | /// 22 | /// 广告图片 23 | /// 24 | public string ImgUrl { get; set; } 25 | 26 | /// 27 | /// 广告标题 28 | /// 29 | public string Title { get; set; } 30 | 31 | /// 32 | /// 广告链接 33 | /// 34 | public string Url { get; set; } 35 | 36 | /// 37 | /// 备注 38 | /// 39 | public string Remark { get; set; } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/Models/BaseModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Text; 5 | 6 | namespace Core.Model.Models 7 | { 8 | /// 9 | /// Model层的基类,所有需要映射成表的Model都可以继承这个类。 10 | /// 包括了一个为Guid的主键,以及创建时间等属性。 11 | /// 有特殊需求的可不继承此类,创建合适的自定义类即可。 12 | /// 13 | public class BaseModel 14 | { 15 | private Guid _guid; 16 | /// 17 | /// 主键ID 18 | /// 19 | [Display(Name ="ID")] 20 | [Key] 21 | public Guid ID 22 | { 23 | get 24 | { 25 | if (_guid == Guid.Empty) 26 | { 27 | _guid = Guid.NewGuid(); 28 | } 29 | return _guid; 30 | } 31 | set 32 | { 33 | _guid = value; 34 | } 35 | 36 | } 37 | 38 | [Display(Name ="创建时间")] 39 | public DateTime? CreateTime { get; set; } 40 | [Display(Name ="创建人")] 41 | [StringLength(50)] 42 | public string Creator { get; set; } 43 | [Display(Name ="修改时间")] 44 | public DateTime? UpdateTime { get; set; } 45 | [Display(Name ="修改人")] 46 | [StringLength(50)] 47 | public DateTime? Updater { get; set; } 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/Models/BlogArticle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Model.Models 6 | { 7 | /// 8 | /// 博客文章 9 | /// 10 | public class BlogArticle 11 | { 12 | /// 13 | /// 主键ID 14 | /// 15 | public int bID { get; set; } 16 | /// 17 | /// 创建人 18 | /// 19 | public string bsubmitter { get; set; } 20 | /// 21 | /// 博客标题 22 | /// 23 | public string btitle { get; set; } 24 | /// 25 | /// 类别 26 | /// 27 | public string bcategory { get; set; } 28 | /// 29 | /// 内容 30 | /// 31 | public string bcontent { get; set; } 32 | /// 33 | /// 访问量 34 | /// 35 | public int btraffic { get; set; } 36 | /// 37 | /// 评论量 38 | /// 39 | public int bcommentNum { get; set; } 40 | /// 41 | /// 创建时间 42 | /// 43 | public DateTime bUpdateTime { get; set; } 44 | /// 45 | /// 备注 46 | /// 47 | public DateTime bCreateTime { get; set; } 48 | /// 49 | /// 备注 50 | /// 51 | public string bRemark { get; set; } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/Models/SystemAction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | using System.Text; 6 | 7 | namespace Core.Model.Models 8 | { 9 | /// 10 | /// 动作 11 | /// 12 | public class SystemAction : BaseModel 13 | { 14 | 15 | [Display(Name = "动作名称")] 16 | [StringLength(50, ErrorMessage = "{0}最多输入{1}个字符")] 17 | [Required(ErrorMessage = "{0}是必填项")] 18 | public string ActionName { get; set; } 19 | 20 | [Required(ErrorMessage = "{0}是必填项")] 21 | [StringLength(50, ErrorMessage = "{0}最多输入{1}个字符")] 22 | [Display(Name = "方法")] 23 | public string MethodName { get; set; } 24 | 25 | [Display(Name = "菜单")] 26 | public Guid? MeunID { get; set; } 27 | public SystemMenu Meun { get; set; } 28 | [Display(Name = "参数")] 29 | [StringLength(200, ErrorMessage = "{0}最多输入{1}个字符")] 30 | public string Parameter { get; set; } 31 | [Display(Name = "URL")] 32 | [StringLength(200, ErrorMessage = "{0}最多输入{1}个字符")] 33 | public string Url { get; set; } 34 | [Display(Name = "样式")] 35 | [StringLength(200, ErrorMessage = "{0}最多输入{1}个字符")] 36 | public string Style { get; set; } 37 | [Display(Name = "脚本")] 38 | [StringLength(200, ErrorMessage = "{0}最多输入{1}个字符")] 39 | public string Script { get; set; } 40 | [Display(Name ="位置")] 41 | public ActionTypeEnum ActionType { get; set; } 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/Models/SystemGroup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Text; 5 | 6 | namespace Core.Model.Models 7 | { 8 | /// 9 | /// 用户组 10 | /// 11 | public class SystemGroup:BaseModel 12 | { 13 | [Display(Name ="用户组编号")] 14 | [StringLength(100, ErrorMessage = "{0}最大100位")] 15 | [Required(ErrorMessage = "{0}是必填项")] 16 | [RegularExpression("^[0-9]*$", ErrorMessage = "{0}必须是数字")] 17 | public string GroupCode { get; set; } 18 | [Display(Name = "用户组名称")] 19 | [StringLength(100, ErrorMessage = "{0}最多输入{1}个字符")] 20 | [Required(ErrorMessage = "{0}是必填项")] 21 | public string GroupName { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/Models/SystemMenu.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Core.Model.Models 7 | { 8 | /// 9 | /// 菜单(页面) 10 | /// 11 | public class SystemMenu:BaseModel 12 | { 13 | [Display(Name = "菜单名称")] 14 | [StringLength(50, ErrorMessage = "{0}最多输入{1}个字符")] 15 | [Required(ErrorMessage = "{0}是必填项")] 16 | public string MenuName { get; set; } 17 | // 是否父节点 18 | [Display(Name ="目录")] 19 | [Required(ErrorMessage = "{0}是必填项")] 20 | public bool FolderOnly { get; set; } 21 | [Display(Name ="类名")] 22 | public string ClassName { get; set; } 23 | // 域 public Guid? DomainID { get; set; } 24 | [Display(Name = "菜单显示")] 25 | [Required(ErrorMessage = "{0}是必填项")] 26 | public bool ShowOnMenu { get; set; } 27 | 28 | [Display(Name = "公开")] 29 | [Required(ErrorMessage = "{0}是必填项")] 30 | public bool IsPublic { get; set; } 31 | [Display(Name ="显示顺序")] 32 | [Required(ErrorMessage = "{0}是必填项")] 33 | public int? DisplayOrder { get; set; } 34 | 35 | [Display(Name = "内部地址")] 36 | [Required(ErrorMessage = "{0}是必填项")] 37 | public bool? IsInside { get; set; } 38 | 39 | [Display(Name ="地址")] 40 | public string Url { get; set; } 41 | 42 | // 图标关联文件表 public Guid? IConID { get; set; } 43 | [Display(Name ="父目录")] 44 | public Guid? ParentID { get; set; } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/Models/SystemModule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | using System.Text; 6 | 7 | namespace Core.Model.Models 8 | { 9 | /// 10 | /// 模块 11 | /// 12 | public class SystemModule:BaseModel 13 | { 14 | [Display(Name = "模块名称")] 15 | [StringLength(50, ErrorMessage = "{0}最多输入{1}个字符")] 16 | [Required(ErrorMessage = "{0}是必填项")] 17 | public string ModuleName { get; set; } 18 | 19 | [Required(ErrorMessage = "{0}是必填项")] 20 | [StringLength(50, ErrorMessage = "{0}最多输入{1}个字符")] 21 | [Display(Name = "类名")] 22 | public string ClassName { get; set; } 23 | 24 | [Display(Name = "动作")] 25 | public List Actions { get; set; } 26 | //[Display(Name = "区域")] 27 | //public Guid? AreaId { get; set; } 28 | [Display(Name ="命名空间")] 29 | [StringLength(50, ErrorMessage = "{0}最多输入{1}个字符")] 30 | public string NameSpace { get; set; } 31 | [NotMapped] 32 | public bool IsApi { get; set; } 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/Models/SystemPrivilege.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Text; 5 | 6 | namespace Core.Model.Models 7 | { 8 | public class SystemPrivilege : BaseModel 9 | { 10 | [Display(Name = "角色")] 11 | public Guid? RoleID { get; set; } 12 | [Display(Name = "用户")] 13 | public Guid? UserID { get; set; } 14 | [Display(Name = "菜单")] 15 | public Guid? PrivilegeID { get; set; } 16 | [Display(Name = "是否允许")] 17 | public bool? Allowed { get; set; } 18 | public PrivilegeTypeEnum PrivilegeType {get;set;} 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/Models/SystemRole.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Text; 5 | 6 | namespace Core.Model.Models 7 | { 8 | /// 9 | /// 角色 10 | /// 11 | public class SystemRole:BaseModel 12 | { 13 | [Display(Name ="角色编号")] 14 | [StringLength(100,ErrorMessage ="{0}最大100位")] 15 | [Required(ErrorMessage = "{0}是必填项")] 16 | [RegularExpression("^[0-9]*$", ErrorMessage = "{0}必须是数字")] 17 | public string RoleCode { get; set; } 18 | 19 | [Display(Name = "角色名称")] 20 | [StringLength(50, ErrorMessage = "{0}最多输入{1}个字符")] 21 | [Required(ErrorMessage = "{0}是必填项")] 22 | public string RoleName { get; set; } 23 | [Display(Name = "备注")] 24 | public string RoleRemark { get; set; } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/Models/SystemUser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Text; 5 | 6 | namespace Core.Model.Models 7 | { 8 | /// 9 | /// 系统用户表 10 | /// 11 | public class SystemUser:BaseModel 12 | { 13 | [Display(Name = "账号")] 14 | [StringLength(50,ErrorMessage ="{0}最多输入{1}个字符")] 15 | [Required(ErrorMessage ="{0}是必填项")] 16 | public string ITCode { get; set; } 17 | 18 | [Display(Name = "密码")] 19 | [StringLength(32)] 20 | [DataType(DataType.Password)] 21 | [Required(ErrorMessage = "{0}是必填项",AllowEmptyStrings =false)] 22 | public string Password { get; set; } 23 | 24 | [Display(Name="邮箱")] 25 | [StringLength(50, ErrorMessage = "{0}最多输入{1}个字符")] 26 | [DataType(DataType.EmailAddress)] 27 | [Required(ErrorMessage = "{0}是必填项")] 28 | public string Email { get; set; } 29 | 30 | [Display(Name="用户名")] 31 | [StringLength(50, ErrorMessage = "{0}最多输入{1}个字符")] 32 | [Required(ErrorMessage = "{0}是必填项")] 33 | public string Name { get; set; } 34 | 35 | [Display(Name="性别")] 36 | public SexEnum? Sex { get; set; } 37 | 38 | [Display(Name="手机")] 39 | [DataType(DataType.PhoneNumber)] 40 | //[RegularExpression("^[1][3,4,5,7,8][0-9]{9}$", ErrorMessage = "{0}格式错误")] 41 | [StringLength(50)] 42 | public string CellPhone { get; set; } 43 | 44 | [Display(Name = "住址")] 45 | [StringLength(200, ErrorMessage = "{0}最多输入{1}个字符")] 46 | public string Address { get; set; } 47 | 48 | [Display(Name = "邮编")] 49 | //[RegularExpression("^[0-9]{6,6}$", ErrorMessage = "{0}必须是6位数字")] 50 | [DataType(DataType.PostalCode)] 51 | [StringLength(50, ErrorMessage = "{0}最多输入{1}个字符")] 52 | public string ZipCode { get; set; } 53 | /// 54 | /// 目前还不能使用 55 | /// 56 | [Display(Name="头像")] 57 | public Guid? PhotoId { get; set; } 58 | 59 | [Display(Name="是否有效")] 60 | public bool IsValid { get; set; } 61 | 62 | [Display(Name="用户类型")] 63 | public UserTypeEnum UserType { get; set; } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/Models/SystemUserGroup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Text; 5 | 6 | namespace Core.Model.Models 7 | { 8 | /// 9 | /// 用户组(ID) 10 | /// 11 | public class SystemUserGroup:BaseModel 12 | { 13 | public SystemUser User { get; set; } 14 | [Display(Name ="用户")] 15 | public Guid UserID { get; set; } 16 | 17 | public SystemGroup Group { get; set; } 18 | [Display(Name ="用户组")] 19 | public Guid GroupID { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/Models/SystemUserRole.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Text; 5 | 6 | namespace Core.Model.Models 7 | { 8 | /// 9 | /// 用户角色中间表 10 | /// 11 | public class SystemUserRole:BaseModel 12 | { 13 | [Display(Name ="用户")] 14 | public Guid UserID { get; set; } 15 | public SystemUser User { get; set; } 16 | [Display(Name ="角色")] 17 | public Guid RoleID { get; set; } 18 | public SystemRole Role { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/PageModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Model 6 | { 7 | /// 8 | /// 分页通用类 9 | /// 10 | /// 11 | public class PageModel where T : class 12 | { 13 | /// 14 | /// 页面索引 15 | /// 16 | public int PageIndex { get; set; } 17 | /// 18 | /// 页面条数 19 | /// 20 | public int PageSize { get; set; } 21 | /// 22 | /// 总条数 23 | /// 24 | public int Count { get; set; } 25 | /// 26 | /// 状态码 27 | /// 28 | public int Code { get; set; } 29 | /// 30 | /// 总页数 31 | /// 32 | public int TotalPage 33 | { 34 | get 35 | { 36 | if (PageSize > 0) 37 | return Count % PageSize == 0 ? Count / PageSize : (Count / PageSize) + 1; 38 | else 39 | return Count; 40 | } 41 | 42 | } 43 | /// 44 | /// 数据集合 45 | /// 46 | public List Data { get; set; } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/ResponseMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Model 6 | { 7 | /// 8 | /// 返回消息体 9 | /// 10 | /// 11 | public class ResponseMessage where T : class 12 | { 13 | public bool IsSuccess { get; set; } 14 | public string Message { get; set; } 15 | public T Data { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/SearchModels/SearchBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Model.SearchModels 6 | { 7 | public class SearchBase 8 | { 9 | /// 10 | /// 页码 11 | /// 12 | public int Page 13 | { 14 | get; set; 15 | } 16 | /// 17 | /// 条数 18 | /// 19 | public int Limit { get; set; } 20 | /// 21 | /// 开始时间 22 | /// 23 | public DateTime? StartTime { get; set; } 24 | /// 25 | /// 结束时间 26 | /// 27 | public DateTime? EndTime { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/SearchModels/UserSearch.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Model.SearchModels 6 | { 7 | public class UserSearch : SearchBase 8 | { 9 | /// 10 | /// 账号 11 | /// 12 | public string ITCode { get; set; } 13 | /// 14 | /// 昵称 15 | /// 16 | public string Name { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/TableModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Model 6 | { 7 | /// 8 | /// 表格数据,支持分页 9 | /// 10 | /// 11 | public class TableModel 12 | { 13 | /// 14 | /// 返回编码 15 | /// 16 | public int Code { get; set; } 17 | /// 18 | /// 返回信息 19 | /// 20 | public string Msg { get; set; } 21 | /// 22 | /// 记录总数 23 | /// 24 | public int Count { get; set; } 25 | /// 26 | /// 返回数据集 27 | /// 28 | public List Data { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/Text.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Model 6 | { 7 | /// 8 | /// 测试类 9 | /// 10 | public class Text 11 | { 12 | /// 13 | /// 用户标识 14 | /// 15 | public int ID { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/ViewModels/BlogViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Model.ViewModels 6 | { 7 | /// 8 | /// Blog Dto 9 | /// 10 | public class BlogViewModel 11 | { 12 | /// 13 | /// 14 | /// 15 | public int bID { get; set; } 16 | /// 17 | /// 创建人 18 | /// 19 | public string bsubmitter { get; set; } 20 | 21 | /// 22 | /// 博客标题 23 | /// 24 | public string btitle { get; set; } 25 | 26 | /// 27 | /// 摘要 28 | /// 29 | public string digest { get; set; } 30 | 31 | /// 32 | /// 上一篇 33 | /// 34 | public string previous { get; set; } 35 | 36 | /// 37 | /// 上一篇id 38 | /// 39 | public int previousID { get; set; } 40 | 41 | /// 42 | /// 下一篇 43 | /// 44 | public string next { get; set; } 45 | 46 | /// 47 | /// 下一篇id 48 | /// 49 | public int nextID { get; set; } 50 | 51 | /// 类别 52 | /// 53 | /// 54 | public string bcategory { get; set; } 55 | 56 | /// 内容 57 | /// 58 | /// 59 | public string bcontent { get; set; } 60 | 61 | /// 62 | /// 访问量 63 | /// 64 | public int btraffic { get; set; } 65 | 66 | /// 67 | /// 评论数量 68 | /// 69 | public int bcommentNum { get; set; } 70 | 71 | /// 修改时间 72 | /// 73 | /// 74 | public DateTime bUpdateTime { get; set; } 75 | 76 | /// 77 | /// 创建时间 78 | /// 79 | public DateTime bCreateTime { get; set; } 80 | /// 备注 81 | /// 82 | /// 83 | public string bRemark { get; set; } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/ViewModels/HomeVM.cs: -------------------------------------------------------------------------------- 1 | using Core.Model.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Core.Model.ViewModels 7 | { 8 | public class HomeVM 9 | { 10 | /// 11 | /// 用户 12 | /// 13 | public UserInfoVM UserInfoVM { get; set; } 14 | /// 15 | /// 当前用户所拥有的菜单 16 | /// 17 | public List Menus { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/ViewModels/UserInfoVM.cs: -------------------------------------------------------------------------------- 1 | using Core.Model.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Core.Model.ViewModels 7 | { 8 | public class UserInfoVM: SystemUser 9 | { 10 | /// 11 | /// 角色名 12 | /// 13 | public List RoleName { get; set; } 14 | /// 15 | /// 菜单列表 16 | /// 17 | public List MenuList { get; set; } 18 | } 19 | 20 | /// 21 | /// 菜单数据,根据当前登录角色获取对应的菜单 22 | /// 23 | public class MenuInfo 24 | { 25 | public string ModuleName { get; set; } 26 | public List SystemMenus { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Model/ViewModels/UserVM.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Text; 5 | 6 | namespace Core.Model.ViewModels 7 | { 8 | /// 9 | /// 用户注册 10 | /// 11 | public class LoginVM 12 | { 13 | /// 14 | /// 账号 15 | /// 16 | public string ITCode { get; set; } 17 | /// 18 | /// 密码 19 | /// 20 | public string Password { get; set; } 21 | /// 22 | /// 邮箱 23 | /// 24 | public string Email { get; set; } 25 | /// 26 | /// 显示昵称 27 | /// 28 | public string Name { get; set; } 29 | ///// 30 | ///// 性别 31 | ///// 32 | //public SexEnum Sex { get; set; } 33 | /// 34 | /// 密码 加密 35 | /// 36 | public string PasswordMD5 { get; set; } 37 | 38 | } 39 | 40 | /// 41 | /// 用户注册(返回结果) 42 | /// 43 | public class LoginResult 44 | { 45 | /// 46 | /// True:成功 False: 失败 47 | /// 48 | public bool Result { get; set; } 49 | /// 50 | /// 失败原因 51 | /// 52 | public string Reason { get; set; } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Common/UserHelper.cs: -------------------------------------------------------------------------------- 1 | using Core.Common.Helper; 2 | using Core.Model.ViewModels; 3 | using Microsoft.AspNetCore.Authentication; 4 | using Microsoft.AspNetCore.Authentication.Cookies; 5 | using Microsoft.AspNetCore.Http; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Linq; 9 | using System.Security.Claims; 10 | using System.Threading.Tasks; 11 | 12 | namespace Core.Msi.Common 13 | { 14 | public class UserHelper 15 | { 16 | /// 17 | /// 写入登录缓存 18 | /// 19 | /// 用户信息 20 | public async static void SetUserInfo(UserInfoVM userInfoVM) 21 | { 22 | var user = new ClaimsPrincipal( 23 | new ClaimsIdentity(new[] 24 | { 25 | new Claim(ClaimTypes.Name,userInfoVM.ID.ToString()), 26 | new Claim("UserName",userInfoVM.Name) 27 | }, 28 | CookieAuthenticationDefaults.AuthenticationScheme)); 29 | 30 | await HttpContextHelper.Current.SignInAsync( 31 | CookieAuthenticationDefaults.AuthenticationScheme, user, new AuthenticationProperties 32 | { 33 | IsPersistent = true, 34 | ExpiresUtc = DateTime.UtcNow.AddMinutes(30)//Add(TimeSpan.FromHours(2)) // Cookie 有效时间 35 | } 36 | ); 37 | } 38 | 39 | /// 40 | /// 清除用户信息 41 | /// 42 | public static void ClearUserInfo() 43 | { 44 | HttpContextHelper.Current.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); 45 | } 46 | 47 | /// 48 | /// 获取用户信息 49 | /// 50 | /// 51 | public static UserInfoVM GetUserInfo() 52 | { 53 | // LogHelper.Info("2获取登录信息:" ); 54 | if (!HttpContextHelper.Current.User.Identity.IsAuthenticated) 55 | { 56 | //LogHelper.Info("2.1获取登录信息:IsAuthenticated::"+ HttpContext.Current.User.Identity.Name); 57 | return null; 58 | } 59 | UserInfoVM user = new UserInfoVM(); 60 | user.ID = new Guid(HttpContextHelper.Current.User.Identity.Name); 61 | user.Name = HttpContextHelper.Current.User.Claims.FirstOrDefault(c => c.Type == "UserName")?.Value; 62 | return user; 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Core.Msi.Models; 8 | using Core.Common.EFCore; 9 | using Core.Model.Models; 10 | using Core.Msi.Common; 11 | using Core.Msi.Filter; 12 | using Core.IServices.Mis; 13 | 14 | namespace Core.Msi.Controllers 15 | { 16 | [ValidateUserFilter] 17 | public class HomeController : Controller 18 | { 19 | 20 | private readonly IHomeServices _homeServices; 21 | public HomeController(IHomeServices homeServices) 22 | { 23 | _homeServices = homeServices; 24 | } 25 | public async Task Index() 26 | { 27 | var user = UserHelper.GetUserInfo(); 28 | user.MenuList=await _homeServices.GetMenuList(user.ID); 29 | return View(user); 30 | } 31 | 32 | /// 33 | /// 主页面头部 34 | /// 35 | /// 36 | public IActionResult Header() 37 | { 38 | return View(); 39 | } 40 | /// 41 | /// 左侧菜单 42 | /// 43 | /// 44 | public IActionResult Menu() 45 | { 46 | return View(); 47 | } 48 | 49 | /// 50 | /// 首页图表展示 51 | /// 52 | /// 53 | public IActionResult ECharts() 54 | { 55 | return View(); 56 | } 57 | public IActionResult About() 58 | { 59 | ViewData["Message"] = "Your application description page."; 60 | 61 | return View(); 62 | } 63 | 64 | public IActionResult Contact() 65 | { 66 | ViewData["Message"] = "Your contact page."; 67 | 68 | return View(); 69 | } 70 | 71 | public IActionResult Privacy() 72 | { 73 | return View(); 74 | } 75 | 76 | [Route("/Home/Error/{statusCode}")] 77 | public IActionResult Error(int statusCode) 78 | { 79 | if (statusCode==404) 80 | { 81 | return View("_404"); 82 | } 83 | return View(); 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Controllers/LoginController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Core.Common; 6 | using Core.Common.Helper; 7 | using Core.IServices.Mis; 8 | using Core.Msi.Common; 9 | using Microsoft.AspNetCore.Mvc; 10 | 11 | namespace Core.Msi.Controllers 12 | { 13 | public class LoginController : Controller 14 | { 15 | private readonly ILoginServices _loginServices; 16 | public LoginController(ILoginServices loginServices) 17 | { 18 | _loginServices = loginServices; 19 | } 20 | /// 21 | /// 登录页面 22 | /// 23 | /// 24 | public IActionResult Index() 25 | { 26 | return View(); 27 | } 28 | 29 | /// 30 | /// 登录方法 31 | /// 32 | /// 账号 33 | /// 密码 34 | /// 35 | [HttpPost] 36 | public IActionResult Login(string itCode, string password) 37 | { 38 | var result = _loginServices.GetUserInfo(itCode, password); 39 | if (result.IsSuccess) 40 | { 41 | // 写入登录缓存 42 | UserHelper.SetUserInfo(result.Data); 43 | } 44 | return Json(result); 45 | } 46 | 47 | /// 48 | /// 登出 49 | /// 50 | /// 51 | public IActionResult Logout(Guid id) 52 | { 53 | if (id==null) 54 | { 55 | return BadRequest(); 56 | } 57 | UserHelper.ClearUserInfo(); 58 | return RedirectToAction("Index", "Login"); 59 | 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Controllers/SystemUserController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Core.IServices.Mis; 6 | using Core.Model.SearchModels; 7 | using Microsoft.AspNetCore.Mvc; 8 | 9 | namespace Core.Msi.Controllers 10 | { 11 | public class SystemUserController : Controller 12 | { 13 | private readonly ISystemUserServices _userServices; 14 | public SystemUserController(ISystemUserServices userServices) 15 | { 16 | _userServices = userServices; 17 | } 18 | public IActionResult Index() 19 | { 20 | return PartialView(); 21 | } 22 | [HttpGet] 23 | public async Task GetUserList(UserSearch search) 24 | { 25 | var data = await _userServices.GetUserList(search); 26 | return Json(data); 27 | } 28 | 29 | } 30 | } -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Core.Msi.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Filter/ValidateUserFilter.cs: -------------------------------------------------------------------------------- 1 | using Core.Msi.Common; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.AspNetCore.Mvc.Filters; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Threading.Tasks; 8 | using System.Web; 9 | 10 | namespace Core.Msi.Filter 11 | { 12 | public class ValidateUserFilter : ActionFilterAttribute 13 | { 14 | 15 | public override void OnActionExecuting(ActionExecutingContext context) 16 | { 17 | ValidateUserStatus(context); 18 | base.OnActionExecuting(context); 19 | } 20 | 21 | 22 | /// 23 | /// 验证是否处于登录状态 24 | /// 25 | /// 26 | private void ValidateUserStatus(ActionExecutingContext filterContext) 27 | { 28 | var request = filterContext.HttpContext.Request; 29 | // 获取正在访问的url 30 | var url = string.Concat(request.Path, request.QueryString); 31 | string backUrl= HttpUtility.UrlEncode(url); 32 | 33 | var user = UserHelper.GetUserInfo(); 34 | if (user == null) 35 | { 36 | filterContext.Result = new RedirectResult("/Login/Index"); 37 | } 38 | 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Core.Msi.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Core.Common.EFCore; 7 | using Core.Model.Models; 8 | using Microsoft.AspNetCore; 9 | using Microsoft.AspNetCore.Hosting; 10 | using Microsoft.Extensions.Configuration; 11 | using Microsoft.Extensions.DependencyInjection; 12 | using Microsoft.Extensions.Logging; 13 | 14 | namespace Core.Msi 15 | { 16 | public class Program 17 | { 18 | public static void Main(string[] args) 19 | { 20 | var host = CreateWebHostBuilder(args).Build(); 21 | using (var scope = host.Services.CreateScope()) 22 | { 23 | var services = scope.ServiceProvider; 24 | try 25 | { 26 | var serviceContext = services.GetRequiredService(); 27 | var connectionString = serviceContext.GetValue("ConnectionString"); 28 | var context = new EFContext(connectionString, Model.DBTypeEnum.Mysql); 29 | List list = new List() { new SystemModule {ModuleName="用户管理",ClassName= "SystemUser"}, new SystemModule { ModuleName = "角色管理", ClassName = "SystemRole" }, new SystemModule { ModuleName = "用户组管理", ClassName = "SystemGroup" }, new SystemModule { ModuleName = "菜单管理", ClassName = "SystemMenu" } }; 30 | // 初始化数据 31 | context.DataInit(list); 32 | } 33 | catch (Exception ex) 34 | { 35 | var logger = services.GetRequiredService>(); 36 | logger.LogError(ex, "An error occurred seeding the DB."); 37 | } 38 | } 39 | host.Run(); 40 | } 41 | 42 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 43 | WebHost.CreateDefaultBuilder(args) 44 | .UseStartup(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:6524", 7 | "sslPort": 44381 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Core.Msi": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "About"; 3 | } 4 |

@ViewData["Title"]

5 |

@ViewData["Message"]

6 | 7 |

Use this area to provide additional information.

8 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Contact"; 3 | } 4 |

@ViewData["Title"]

5 |

@ViewData["Message"]

6 | 7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P: 11 | 425.555.0100 12 |
13 | 14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com 17 |
18 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Views/Home/ECharts.cshtml: -------------------------------------------------------------------------------- 1 | 
2 | 3 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Views/Home/Header.cshtml: -------------------------------------------------------------------------------- 1 | @model Core.Model.ViewModels.UserInfoVM 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model Core.Model.ViewModels.UserInfoVM 2 | @{ 3 | Layout = "_Layout"; 4 | } 5 |
6 |
7 | @await Html.PartialAsync("Header",Model) 8 |
9 | 10 |
11 | @await Html.PartialAsync("Menu") 12 |
13 | 14 |
15 | 16 |
17 | 18 | 21 |
22 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Views/Home/Menu.cshtml: -------------------------------------------------------------------------------- 1 | 
2 |
3 | 4 | 25 |
26 |
-------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 22 |

23 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Views/Shared/_404.cshtml: -------------------------------------------------------------------------------- 1 |  2 | @{ 3 | Layout = null; 4 | } 5 | 6 | 7 | 8 | 9 | 10 | 404 11 | 12 | 13 | 14 | 15 |
16 |
17 | 首页 18 | 返回 19 |
20 |
21 | 22 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Views/Shared/_CookieConsentPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Http.Features 2 | 3 | @{ 4 | var consentFeature = Context.Features.Get(); 5 | var showBanner = !consentFeature?.CanTrack ?? false; 6 | var cookieString = consentFeature?.CreateConsentCookie(); 7 | } 8 | 9 | @if (showBanner) 10 | { 11 | 33 | 41 | } -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewData["Title"] - Core.Msi 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 27 | 28 | 29 | 30 | @RenderBody() 31 | 32 | 33 | 34 | 35 | @* 41 | 47 | *@ 48 | 49 | 50 | @RenderSection("Scripts", required: false) 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Core.Msi 2 | @using Core.Msi.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/appsettings.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/appsettings.json -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/css/404ErrorPage.css: -------------------------------------------------------------------------------- 1 | /* 公共类 开始 */ 2 | a { 3 | text-decoration: none; 4 | } 5 | body { 6 | background-color: #fff; 7 | } 8 | /* 公共类 结束 */ 9 | section .Subject-Background-Picture { 10 | /*background: url(../images/404-Error-Page/Subject-Background-Picture.jpg) no-repeat;*/ 11 | background: url('../images/background_404.jpg') no-repeat; 12 | width: 700px; 13 | height: 700px; 14 | margin: 0 auto; 15 | position: relative; 16 | } 17 | section .Subject-Background-Picture a { 18 | position: absolute; 19 | font-size: 28px; 20 | font-weight: 700; 21 | color: #000; 22 | } 23 | section .Subject-Background-Picture a:first-child { 24 | top: 281px; 25 | left: 50px; 26 | } 27 | section .Subject-Background-Picture a:last-child { 28 | top: 317px; 29 | right: 47px; 30 | } 31 | section .Subject-Background-Picture a:hover { 32 | color: rgb(230, 84, 47); 33 | } -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/css/ErrorInitialization.css: -------------------------------------------------------------------------------- 1 | /*CSS初始化 开始*/ 2 | /*清除内外边距 开始*/ 3 | * { 4 | padding: 0; 5 | margin: 0; 6 | } 7 | /*清除内外边距 结束*/ 8 | /*取消列表的项目符号 开始*/ 9 | ul, 10 | ol {/*并集选择器*/ 11 | list-style: none;/*取消列表的项目符号*/ 12 | } 13 | /*取消列表的项目符号 结束*/ 14 | /*双伪元素清除浮动 开始*/ 15 | .clearfix:before, 16 | .clearfix:after {/*为了避免低版本浏览器出现BUG,所以把两个英文冒号【::】改为一个英文冒号【:】*/ 17 | content: ""; 18 | display: table;/*触发【BFC】防止外边距合并*/ 19 | } 20 | .clearfix:after {/*为了避免低版本浏览器出现BUG,所以把两个英文冒号【::】改为一个英文冒号【:】*/ 21 | clear: both; 22 | } 23 | .clearfix { 24 | *zoom: 1;/*【*】是代表IE6、IE7能识别的特殊符号,只有IE6、IE7能执行带【*】的属性,【zoom】是IE6、IE7清除浮动影响的方法*/ 25 | } 26 | /*双伪元素清除浮动 结束*/ 27 | /*CSS初始化 结束*/ -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\ 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | body { 4 | padding-top: 50px; 5 | padding-bottom: 20px; 6 | } 7 | 8 | /* Wrapping element */ 9 | /* Set some basic padding to keep content from hitting the edges */ 10 | .body-content { 11 | padding-left: 15px; 12 | padding-right: 15px; 13 | } 14 | 15 | /* Carousel */ 16 | .carousel-caption p { 17 | font-size: 20px; 18 | line-height: 1.4; 19 | } 20 | 21 | /* Make .svg files in the carousel display properly in older browsers */ 22 | .carousel-inner .item img[src$=".svg"] { 23 | width: 100%; 24 | } 25 | 26 | /* QR code generator */ 27 | #qrCode { 28 | margin: 15px; 29 | } 30 | 31 | /* Hide/rearrange for smaller screens */ 32 | @media screen and (max-width: 767px) { 33 | /* Hide captions */ 34 | .carousel-caption { 35 | display: none; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/favicon.ico -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/images/background_404.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/images/background_404.jpg -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/images/cloud.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/images/cloud.jpg -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/css/modules/code.css: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none} -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/css/modules/layer/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/css/modules/layer/default/icon-ext.png -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/css/modules/layer/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/css/modules/layer/default/icon.png -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/css/modules/layer/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/css/modules/layer/default/loading-0.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/css/modules/layer/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/css/modules/layer/default/loading-1.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/css/modules/layer/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/css/modules/layer/default/loading-2.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/font/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/font/iconfont.eot -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/font/iconfont.ttf -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/font/iconfont.woff -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/font/iconfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/font/iconfont.woff2 -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/0.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/1.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/10.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/11.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/12.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/13.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/14.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/15.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/16.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/17.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/17.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/18.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/18.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/19.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/19.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/2.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/20.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/20.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/21.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/21.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/22.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/22.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/23.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/23.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/24.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/25.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/25.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/26.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/26.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/27.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/27.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/28.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/28.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/29.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/29.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/3.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/30.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/30.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/31.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/31.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/32.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/32.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/33.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/33.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/34.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/34.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/35.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/35.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/36.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/36.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/37.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/37.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/38.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/38.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/39.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/39.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/4.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/40.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/40.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/41.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/41.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/42.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/42.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/43.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/43.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/44.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/44.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/45.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/45.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/46.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/46.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/47.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/47.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/48.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/48.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/49.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/49.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/5.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/50.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/51.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/51.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/52.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/52.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/53.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/53.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/54.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/54.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/55.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/55.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/56.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/56.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/57.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/57.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/58.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/58.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/59.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/59.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/6.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/60.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/60.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/61.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/61.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/62.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/62.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/63.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/63.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/64.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/65.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/65.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/66.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/66.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/67.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/67.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/68.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/68.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/69.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/69.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/7.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/70.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/70.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/71.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/71.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/8.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/images/face/9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/layui/images/face/9.gif -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/lay/modules/carousel.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(clearInterval(e.timer),e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['",'"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['
    ',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("")}),i.join("")}(),"
"].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a/g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('
  1. '+o.replace(/[\r\t\n]+/g,"
  2. ")+"
"),c.find(">.layui-code-h3")[0]||c.prepend('

'+(c.attr("lay-title")||e.title||"code")+(e.about?'layui.code':"")+"

");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss"); -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/lay/modules/flow.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="加载更多",h=l('");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),i||(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;su)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)}); -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/lay/modules/laypage.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?''+a.prev+"":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push(''+(a.first||1)+"");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r2&&e.push('');r<=u;r++)r===a.curr?e.push('"+r+""):e.push(''+r+"");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),refresh:['','',""].join(""),skip:function(){return['到第','','页',""].join("")}()};return['
',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
"].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)}); -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/lay/modules/laytpl.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)}); -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/lay/modules/rate.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var a=layui.jquery,i={config:{},index:layui.rate?layui.rate.index+1e4:0,set:function(e){var i=this;return i.config=a.extend({},i.config,e),i},on:function(e,a){return layui.onevent.call(this,n,e,a)}},l=function(){var e=this,a=e.config;return{setvalue:function(a){e.setvalue.call(e,a)},config:a}},n="rate",t="layui-rate",o="layui-icon-rate",s="layui-icon-rate-solid",u="layui-icon-rate-half",r="layui-icon-rate-solid layui-icon-rate-half",c="layui-icon-rate-solid layui-icon-rate",f="layui-icon-rate layui-icon-rate-half",v=function(e){var l=this;l.index=++i.index,l.config=a.extend({},l.config,i.config,e),l.render()};v.prototype.config={length:5,text:!1,readonly:!1,half:!1,value:0,theme:""},v.prototype.render=function(){var e=this,i=e.config,l=i.theme?'style="color: '+i.theme+';"':"";i.elem=a(i.elem),parseInt(i.value)!==i.value&&(i.half||(i.value=Math.ceil(i.value)-i.value<.5?Math.ceil(i.value):Math.floor(i.value)));for(var n='
    ",u=1;u<=i.length;u++){var r='
  • ";i.half&&parseInt(i.value)!==i.value&&u==Math.ceil(i.value)?n=n+'
  • ":n+=r}n+="
"+(i.text?''+i.value+"星":"")+"";var c=i.elem,f=c.next("."+t);f[0]&&f.remove(),e.elemTemp=a(n),i.span=e.elemTemp.next("span"),i.setText&&i.setText(i.value),c.html(e.elemTemp),c.addClass("layui-inline"),i.readonly||e.action()},v.prototype.setvalue=function(e){var a=this,i=a.config;i.value=e,a.render()},v.prototype.action=function(){var e=this,i=e.config,l=e.elemTemp,n=l.find("i").width();l.children("li").each(function(e){var t=e+1,v=a(this);v.on("click",function(e){if(i.value=t,i.half){var o=e.pageX-a(this).offset().left;o<=n/2&&(i.value=i.value-.5)}i.text&&l.next("span").text(i.value+"星"),i.choose&&i.choose(i.value),i.setText&&i.setText(i.value)}),v.on("mousemove",function(e){if(l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+t+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half){var c=e.pageX-a(this).offset().left;c<=n/2&&v.children("i").addClass(u).removeClass(s)}}),v.on("mouseleave",function(){l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+Math.floor(i.value)+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half&&parseInt(i.value)!==i.value&&l.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(u).removeClass(c)})})},v.prototype.events=function(){var e=this;e.config},i.render=function(e){var a=new v(e);return l.call(a)},e(n,i)}); -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/layui/lay/modules/util.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.5.4 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(t){"use strict";var e=layui.$,i={fixbar:function(t){var i,n,a="layui-fixbar",o="layui-fixbar-top",r=e(document),l=e("body");t=e.extend({showHeight:200},t),t.bar1=t.bar1===!0?"":t.bar1,t.bar2=t.bar2===!0?"":t.bar2,t.bgcolor=t.bgcolor?"background-color:"+t.bgcolor:"";var c=[t.bar1,t.bar2,""],g=e(['
    ',t.bar1?'
  • '+c[0]+"
  • ":"",t.bar2?'
  • '+c[1]+"
  • ":"",'
  • '+c[2]+"
  • ","
"].join("")),s=g.find("."+o),u=function(){var e=r.scrollTop();e>=t.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};e("."+a)[0]||("object"==typeof t.css&&g.css(t.css),l.append(g),u(),g.find("li").on("click",function(){var i=e(this),n=i.attr("lay-type");"top"===n&&e("html,body").animate({scrollTop:0},200),t.click&&t.click.call(this,n)}),r.on("scroll",function(){clearTimeout(n),n=setTimeout(function(){u()},100)}))},countdown:function(t,e,i){var n=this,a="function"==typeof e,o=new Date(t).getTime(),r=new Date(!e||a?(new Date).getTime():e).getTime(),l=o-r,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=e);var g=setTimeout(function(){n.countdown(t,r+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],e,g),l<=0&&clearTimeout(g),g},timeAgo:function(t,e){var i=this,n=[[],[]],a=(new Date).getTime()-new Date(t).getTime();return a>6912e5?(a=new Date(t),n[0][0]=i.digit(a.getFullYear(),4),n[0][1]=i.digit(a.getMonth()+1),n[0][2]=i.digit(a.getDate()),e||(n[1][0]=i.digit(a.getHours()),n[1][1]=i.digit(a.getMinutes()),n[1][2]=i.digit(a.getSeconds())),n[0].join("-")+" "+n[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=12e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(t,e){var i="";t=String(t),e=e||2;for(var n=t.length;n/g,">").replace(/'/g,"'").replace(/"/g,""")},event:function(t,n,a){n=i.event[t]=e.extend(!0,i.event[t],n)||{},e("body").on(a||"click","*["+t+"]",function(){var i=e(this),a=i.attr(t);n[a]&&n[a].call(this,i)})}};!function(t,e,i){"$:nomunge";function n(){a=e[l](function(){o.each(function(){var e=t(this),i=e.width(),n=e.height(),a=t.data(this,g);(i!==a.w||n!==a.h)&&e.trigger(c,[a.w=i,a.h=n])}),n()},r[s])}var a,o=t([]),r=t.resize=t.extend(t.resize,{}),l="setTimeout",c="resize",g=c+"-special-event",s="delay",u="throttleWindow";r[s]=250,r[u]=!0,t.event.special[c]={setup:function(){if(!r[u]&&this[l])return!1;var e=t(this);o=o.add(e),t.data(this,g,{w:e.width(),h:e.height()}),1===o.length&&n()},teardown:function(){if(!r[u]&&this[l])return!1;var e=t(this);o=o.not(e),e.removeData(g),o.length||clearTimeout(a)},add:function(e){function n(e,n,o){var r=t(this),l=t.data(this,g)||{};l.w=n!==i?n:r.width(),l.h=o!==i?o:r.height(),a.apply(this,arguments)}if(!r[u]&&this[l])return!1;var a;return t.isFunction(e)?(a=e,n):(a=e.handler,void(e.handler=n))}}}(e,window),t("util",i)}); -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/lib/bootstrap/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 4 | "keywords": [ 5 | "css", 6 | "js", 7 | "less", 8 | "mobile-first", 9 | "responsive", 10 | "front-end", 11 | "framework", 12 | "web" 13 | ], 14 | "homepage": "http://getbootstrap.com", 15 | "license": "MIT", 16 | "moduleType": "globals", 17 | "main": [ 18 | "less/bootstrap.less", 19 | "dist/js/bootstrap.js" 20 | ], 21 | "ignore": [ 22 | "/.*", 23 | "_config.yml", 24 | "CNAME", 25 | "composer.json", 26 | "CONTRIBUTING.md", 27 | "docs", 28 | "js/tests", 29 | "test-infra" 30 | ], 31 | "dependencies": { 32 | "jquery": "1.9.1 - 3" 33 | }, 34 | "version": "3.3.7", 35 | "_release": "3.3.7", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.7", 39 | "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" 40 | }, 41 | "_source": "https://github.com/twbs/bootstrap.git", 42 | "_target": "v3.3.7", 43 | "_originalSource": "bootstrap", 44 | "_direct": true 45 | } -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2016 Twitter, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/Core.Msi/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 4 | "version": "3.2.9", 5 | "_release": "3.2.9", 6 | "_resolution": { 7 | "type": "version", 8 | "tag": "v3.2.9", 9 | "commit": "a91f5401898e125f10771c5f5f0909d8c4c82396" 10 | }, 11 | "_source": "https://github.com/aspnet/jquery-validation-unobtrusive.git", 12 | "_target": "^3.2.9", 13 | "_originalSource": "jquery-validation-unobtrusive", 14 | "_direct": true 15 | } -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "https://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jquery-validation/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn Zaefferer " 10 | ], 11 | "description": "Form validation made easy", 12 | "main": "dist/jquery.validate.js", 13 | "keywords": [ 14 | "forms", 15 | "validation", 16 | "validate" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "demo", 25 | "lib" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 1.7.2" 29 | }, 30 | "version": "1.17.0", 31 | "_release": "1.17.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.17.0", 35 | "commit": "fc9b12d3bfaa2d0c04605855b896edb2934c0772" 36 | }, 37 | "_source": "https://github.com/jzaefferer/jquery-validation.git", 38 | "_target": "^1.17.0", 39 | "_originalSource": "jquery-validation", 40 | "_direct": true 41 | } -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "3.3.1", 16 | "_release": "3.3.1", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "3.3.1", 20 | "commit": "9e8ec3d10fad04748176144f108d7355662ae75e" 21 | }, 22 | "_source": "https://github.com/jquery/jquery-dist.git", 23 | "_target": "^3.3.1", 24 | "_originalSource": "jquery", 25 | "_direct": true 26 | } -------------------------------------------------------------------------------- /CoreWebApi/Core.Msi/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Repository/AdvertisementRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.IRepository; 2 | using Core.IRepository.BASE; 3 | using Core.Model.Models; 4 | using Core.Repository.BASE; 5 | using Core.Repository.Sugar; 6 | using SqlSugar; 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq.Expressions; 10 | using System.Text; 11 | 12 | namespace Core.Repository 13 | { 14 | public class AdvertisementRepository : BaseRepository, IAdvertisementRepository 15 | { 16 | //private DbContext context; 17 | //private SqlSugarClient db; 18 | //private SimpleClient entityDB; 19 | 20 | //internal SqlSugarClient Db 21 | //{ 22 | // get { return db; } 23 | // private set { db = value; } 24 | //} 25 | //public DbContext Context 26 | //{ 27 | // get { return context; } 28 | // set { context = value; } 29 | //} 30 | 31 | ///// 32 | ///// 构造函数获取Sqlsugar实例 33 | ///// 34 | //public AdvertisementRepository() 35 | //{ 36 | // DbContext.Init(BaseDBConfig.ConnectionString); 37 | // context = DbContext.GetDbContext(); 38 | // db = context.Db; 39 | // entityDB = context.GetEntityDB(db); 40 | //} 41 | 42 | //public int Add(Advertisement model) 43 | //{ 44 | // var i= db.Insertable(model).ExecuteReturnIdentity(); 45 | // return i; 46 | //} 47 | 48 | //public bool Delete(Advertisement model) 49 | //{ 50 | // var i= db.Deleteable(model).ExecuteCommand(); 51 | // return i > 0; 52 | //} 53 | 54 | //public List Query(Expression> whereExpression) 55 | //{ 56 | // return entityDB.GetList(whereExpression); 57 | //} 58 | 59 | /// 60 | /// 求和方法实现 61 | /// 62 | /// 63 | /// 64 | /// 65 | public int Sum(int i, int j) 66 | { 67 | return i + j; 68 | } 69 | 70 | //public bool Update(Advertisement model) 71 | //{ 72 | // //以主键为条件 73 | // var i= db.Updateable(model).ExecuteCommand(); 74 | // return i > 0; 75 | //} 76 | 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Repository/BlogArticleRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.Common.Dapper; 2 | using Core.IRepository; 3 | using Core.Model.Models; 4 | using Core.Repository.BASE; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace Core.Repository 12 | { 13 | public class BlogArticleRepository : BaseRepository, IBlogArticleRepository 14 | { 15 | private readonly DbContext db; 16 | public BlogArticleRepository(DbContext _db) 17 | { 18 | db = _db; 19 | } 20 | public BlogArticle GetBlog() 21 | { 22 | string sql = "SELECT * FROM systemuser"; 23 | var list = DbContext.QueryFirstOrDefault(sql); 24 | 25 | return list; //new BlogArticle() { btitle="1" };// 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Repository/Core.Repository.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | ..\Core.Msi\bin\Debug\ 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Repository/Mis/HomeRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.Common.EFCore; 2 | using Core.IRepository.Mis; 3 | using Core.Model.Models; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Linq; 9 | using Core.Model.ViewModels; 10 | 11 | namespace Core.Repository.Mis 12 | { 13 | public class HomeRepository : IHomeRepository 14 | { 15 | private readonly IEFContext _context; 16 | public HomeRepository(IEFContext context) 17 | { 18 | _context = context; 19 | } 20 | 21 | public Task> GetActionList(Guid userID, Guid menuID) 22 | { 23 | throw new NotImplementedException(); 24 | } 25 | 26 | /// 27 | /// 根据用户ID获取对应的菜单列表 28 | /// 29 | /// userID 30 | /// 31 | public async Task> GetMenuList(Guid userID) 32 | { 33 | if (userID == null) 34 | { 35 | return null; 36 | } 37 | var query = from a in _context.Set() 38 | join b in _context.Set() 39 | on a.RoleID equals b.RoleID 40 | join c in _context.Set() 41 | on b.PrivilegeID equals c.ID 42 | where a.UserID == userID && b.PrivilegeType == Model.PrivilegeTypeEnum.菜单 && c.ShowOnMenu == true 43 | select new SystemMenu 44 | { 45 | ID = c.ID, 46 | MenuName = c.MenuName, 47 | Url = c.Url, 48 | ParentID = c.ParentID, 49 | DisplayOrder = c.DisplayOrder 50 | }; 51 | var folder = _context.Set().Where(x => x.FolderOnly == true && x.ShowOnMenu == true); 52 | List menuList = new List(); 53 | if (folder.Count() > 0) 54 | { 55 | await Task.Run(() => 56 | { 57 | foreach (var item in folder) 58 | { 59 | var childList = query.Where(x => x.ParentID == item.ID); 60 | if (childList.Count() > 0) 61 | { 62 | MenuInfo menu = new MenuInfo(); 63 | menu.ModuleName = item.MenuName; 64 | menu.SystemMenus = childList.OrderBy(x => x.DisplayOrder).ToList(); 65 | menuList.Add(menu); 66 | } 67 | } 68 | }); 69 | } 70 | 71 | return menuList; 72 | 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Repository/Mis/LoginRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.Common.EFCore; 2 | using Core.IRepository.Mis; 3 | using Core.Model.Models; 4 | using Core.Model.ViewModels; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | using System.Linq; 9 | using Core.Model; 10 | using Core.Common; 11 | using Core.Common.Helper; 12 | 13 | namespace Core.Repository.Mis 14 | { 15 | /// 16 | /// 登录数据层实现 17 | /// 18 | public class LoginRepository : ILoginRepository 19 | { 20 | private readonly IEFContext _context; 21 | public LoginRepository(IEFContext context) 22 | { 23 | _context = context; 24 | } 25 | ///// 26 | ///// 获取用户信息 27 | ///// 28 | ///// 29 | ///// 30 | ///// 31 | public ResponseMessage GetUserInfo(string itCode, string password) 32 | { 33 | var response = new ResponseMessage(); 34 | if (string.IsNullOrWhiteSpace(itCode)) 35 | { 36 | response.Message = "请输入用户名"; 37 | response.IsSuccess = false; 38 | return response; 39 | } 40 | if (string.IsNullOrWhiteSpace(password)) 41 | { 42 | response.Message = "请输入密码"; 43 | response.IsSuccess = false; 44 | return response; 45 | } 46 | 47 | password = MD5Helper.GetMD5String(password); 48 | var code = (from a in _context.Set() 49 | where a.ITCode == itCode 50 | select new 51 | { 52 | ID = a.ID 53 | }).FirstOrDefault(); 54 | if (code == null) 55 | { 56 | response.Message = "用户名不存在"; 57 | response.IsSuccess = false; 58 | return response; 59 | } 60 | var pwd = (from a in _context.Set() 61 | where a.ITCode == itCode && a.Password == password 62 | select new 63 | { 64 | ID = a.ID 65 | }).FirstOrDefault(); 66 | if (pwd == null) 67 | { 68 | response.Message = "密码错误,请重新输入"; 69 | response.IsSuccess = false; 70 | return response; 71 | } 72 | 73 | var data = (from a in _context.Set() 74 | join b in _context.Set() 75 | on a.ID equals b.UserID 76 | where a.ID == pwd.ID 77 | select new 78 | { 79 | ID = a.ID, 80 | UserName = a.Name, 81 | RoleID = b.RoleID 82 | }).FirstOrDefault(); 83 | if (data != null) 84 | { 85 | response.Message = "登录成功,欢迎来到CloudBlog管理平台"; 86 | response.IsSuccess = true; 87 | 88 | response.Data = new UserInfoVM(); 89 | response.Data.ID = data.ID; 90 | response.Data.Name = data.UserName; 91 | // 写入session 92 | return response; 93 | } 94 | else 95 | { 96 | response.Message = "当前用户未分配角色,请联系管理员"; 97 | response.IsSuccess = false; 98 | return response; 99 | } 100 | 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Repository/Mis/SystemUserRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.Common.EFCore; 2 | using Core.IRepository.Mis; 3 | using Core.Model.Models; 4 | using Core.Model.ViewModels; 5 | using Microsoft.EntityFrameworkCore; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Linq; 11 | using Core.Model; 12 | using Core.Model.SearchModels; 13 | 14 | namespace Core.Repository.Mis 15 | { 16 | public class SystemUserRepository : ISystemUserRepository 17 | { 18 | private readonly IEFContext _context; 19 | public SystemUserRepository(IEFContext context) 20 | { 21 | _context = context; 22 | } 23 | /// 24 | /// 用户列表 25 | /// 26 | /// 搜索字段 27 | /// 28 | public async Task> GetUserList(UserSearch search) 29 | { 30 | 31 | var query = from a in _context.Set() 32 | select new UserInfoVM 33 | { 34 | ID = a.ID, 35 | ITCode = a.ITCode, 36 | Name = a.Name, 37 | Email = a.Email, 38 | Sex = a.Sex, 39 | IsValid = a.IsValid, 40 | CreateTime = a.CreateTime 41 | }; 42 | var userRole = from a in _context.Set() 43 | join b in _context.Set() 44 | on a.RoleID equals b.ID 45 | select new 46 | { 47 | ID = a.UserID, 48 | RoleName = b.RoleName 49 | }; 50 | 51 | if (!string.IsNullOrEmpty(search.ITCode)) 52 | { 53 | query = query.Where(x => x.ITCode.Contains(search.ITCode));// search.ITCode.Contains(x.ITCode)); 54 | } 55 | if (!string.IsNullOrEmpty(search.Name)) 56 | { 57 | query = query.Where(x => x.ITCode.Contains(search.ITCode)); 58 | } 59 | await query.ForEachAsync(x => 60 | { 61 | if (userRole.Where(a => a.ID == x.ID).FirstOrDefault() != null) 62 | { 63 | x.RoleName = userRole.Where(a => a.ID == x.ID).Select(a => a.RoleName).ToList(); 64 | } 65 | }); 66 | var list = await query.Skip((search.Page-1) * search. 67 | Limit).Take(search.Limit).ToListAsync(); 68 | TableModel data = new TableModel() 69 | { 70 | Data = list, 71 | Count = query.Count(), 72 | Code=0 73 | }; 74 | return data; 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Repository/Sugar/BaseDBConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Repository.Sugar 6 | { 7 | public class BaseDBConfig 8 | { 9 | /// 10 | /// 连接字符串 11 | /// 12 | // public static string ConnectionString { get; set; } 13 | public static string ConnectionString = "server=.;uid=sa;pwd=sasa;database=CoreWebApiDb"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Repository/UserRepository.cs: -------------------------------------------------------------------------------- 1 | using Core.Common.Dapper; 2 | using Core.Common.Helper; 3 | using Core.IRepository; 4 | using Core.Model.ViewModels; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Core.Repository 11 | { 12 | /// 13 | /// 用户数据层实现 14 | /// 15 | public class UserRepository : IUserRepository 16 | { 17 | private readonly DbContext _db; 18 | public UserRepository(DbContext db) 19 | { 20 | _db = db; 21 | } 22 | public async Task UserRegister(LoginVM loginVM) 23 | { 24 | LoginResult loginResult = new LoginResult(); 25 | loginVM.PasswordMD5 = MD5Helper.GetMD5String(loginVM.Password); 26 | string sql = @"INSERT INTO systemuser ( ID, CreateTime, Creator, ITCode, PASSWORD, Email, NAME, Sex,IsValid ) 27 | VALUES (UUID(), NOW(), 'sys', @ITCode, @PasswordMD5, @Email, @Name, 0, 1)"; 28 | //DbContext.ExecuteScalarAsync() 29 | await DbContext.ExecuteAsync(sql, loginVM); 30 | loginResult.Reason = "成功"; 31 | return loginResult; 32 | 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Services/AdvertisementServices.cs: -------------------------------------------------------------------------------- 1 | using Core.IRepository; 2 | using Core.IServices; 3 | using Core.Model.Models; 4 | using Core.Services.BASE; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq.Expressions; 8 | using System.Text; 9 | 10 | namespace Core.Services 11 | { 12 | public class AdvertisementServices : BaseServices, IAdvertisementServices 13 | { 14 | IAdvertisementRepository dal; 15 | // 构造函数注入 16 | public AdvertisementServices(IAdvertisementRepository dal) 17 | { 18 | this.dal = dal; 19 | base.baseDal = dal; 20 | } 21 | public int Sum(int i, int j) 22 | { 23 | return dal.Sum(i, j); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Services/BlogArticleServices.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Core.IRepository; 3 | using Core.IServices; 4 | using Core.Model.Models; 5 | using Core.Model.ViewModels; 6 | using Core.Services.BASE; 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Threading.Tasks; 12 | 13 | namespace Core.Services 14 | { 15 | public class BlogArticleServices : BaseServices, IBlogArticleServices 16 | { 17 | private readonly IBlogArticleRepository dal; 18 | 19 | private readonly IMapper _mapper; 20 | 21 | public BlogArticleServices(IBlogArticleRepository dal,IMapper mapper) 22 | { 23 | this.dal = dal; 24 | base.baseDal = dal; 25 | _mapper = mapper; 26 | } 27 | 28 | /// 29 | /// 获取详情 30 | /// 31 | /// 32 | /// 33 | public async Task getBlogDetails(int id) 34 | { 35 | var bloglist = await dal.Query(a => a.bID > 0, a => a.bID); 36 | var idmin = bloglist.FirstOrDefault() != null ? bloglist.FirstOrDefault().bID : 0; 37 | var idmax = bloglist.LastOrDefault() != null ? bloglist.LastOrDefault().bID : 1; 38 | var idminshow = id; 39 | var idmaxshow = id; 40 | 41 | BlogArticle blogArticle = new BlogArticle(); 42 | 43 | blogArticle = (await dal.Query(a => a.bID == idminshow)).FirstOrDefault(); 44 | 45 | BlogArticle prevblog = new BlogArticle(); 46 | 47 | 48 | while (idminshow > idmin) 49 | { 50 | idminshow--; 51 | prevblog = (await dal.Query(a => a.bID == idminshow)).FirstOrDefault(); 52 | if (prevblog != null) 53 | { 54 | break; 55 | } 56 | } 57 | 58 | BlogArticle nextblog = new BlogArticle(); 59 | while (idmaxshow < idmax) 60 | { 61 | idmaxshow++; 62 | nextblog = (await dal.Query(a => a.bID == idmaxshow)).FirstOrDefault(); 63 | if (nextblog != null) 64 | { 65 | break; 66 | } 67 | } 68 | 69 | 70 | blogArticle.btraffic += 1; 71 | await dal.Update(blogArticle, new List { "btraffic" }); 72 | 73 | BlogViewModel models = _mapper.Map(blogArticle); 74 | //BlogViewModel models = new BlogViewModel() 75 | //{ 76 | // bsubmitter = blogArticle.bsubmitter, 77 | // btitle = blogArticle.btitle, 78 | // bcategory = blogArticle.bcategory, 79 | // bcontent = blogArticle.bcontent, 80 | // btraffic = blogArticle.btraffic, 81 | // bcommentNum = blogArticle.bcommentNum, 82 | // bUpdateTime = blogArticle.bUpdateTime, 83 | // bCreateTime = blogArticle.bCreateTime, 84 | // bRemark = blogArticle.bRemark, 85 | //}; 86 | 87 | if (nextblog != null) 88 | { 89 | models.next = nextblog.btitle; 90 | models.nextID = nextblog.bID; 91 | } 92 | 93 | if (prevblog != null) 94 | { 95 | models.previous = prevblog.btitle; 96 | models.previousID = prevblog.bID; 97 | } 98 | return models; 99 | } 100 | 101 | [Common.Attributes.Caching(AbsoluteExpiration = 10)] //添加缓存特性 102 | public async Task> GetBlogs() 103 | { 104 | var blogList = await dal.Query(a=>a.bID>0,a=>a.bID); 105 | return blogList; 106 | } 107 | 108 | public BlogArticle GetBlog() 109 | { 110 | return dal.GetBlog(); 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Services/Core.Services.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | ..\Core.Msi\bin\Debug\ 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Services/Mis/HomeServices.cs: -------------------------------------------------------------------------------- 1 | using Core.IRepository.Mis; 2 | using Core.IServices.Mis; 3 | using Core.Model.Models; 4 | using Core.Model.ViewModels; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Core.Services.Mis 11 | { 12 | public class HomeServices : IHomeServices 13 | { 14 | private readonly IHomeRepository _homeRepository; 15 | public HomeServices(IHomeRepository homeRepository) 16 | { 17 | _homeRepository = homeRepository; 18 | } 19 | 20 | public Task> GetActionList(Guid userID, Guid menuID) 21 | { 22 | throw new NotImplementedException(); 23 | } 24 | 25 | public async Task> GetMenuList(Guid userID) 26 | { 27 | return await _homeRepository.GetMenuList(userID); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Services/Mis/LoginServices.cs: -------------------------------------------------------------------------------- 1 | using Core.IRepository.Mis; 2 | using Core.IServices.Mis; 3 | using Core.Model; 4 | using Core.Model.ViewModels; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | 9 | namespace Core.Services.Mis 10 | { 11 | public class LoginServices : ILoginServices 12 | { 13 | private readonly ILoginRepository _loginRepository; 14 | public LoginServices(ILoginRepository loginRepository) 15 | { 16 | _loginRepository = loginRepository; 17 | } 18 | public ResponseMessage GetUserInfo(string itCode, string password) 19 | { 20 | return _loginRepository.GetUserInfo(itCode, password); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /CoreWebApi/Core.Services/Mis/SystemUserServices.cs: -------------------------------------------------------------------------------- 1 | using Core.IRepository.Mis; 2 | using Core.IServices.Mis; 3 | using Core.Model; 4 | using Core.Model.Models; 5 | using Core.Model.SearchModels; 6 | using Core.Model.ViewModels; 7 | using System; 8 | using System.Collections.Generic; 9 | using System.IO; 10 | using System.Linq; 11 | using System.Text; 12 | using System.Threading.Tasks; 13 | 14 | namespace Core.Services.Mis 15 | { 16 | public class SystemUserServices : ISystemUserServices 17 | { 18 | 19 | private readonly ISystemUserRepository _userRepository; 20 | public SystemUserServices(ISystemUserRepository userRepository) 21 | { 22 | _userRepository = userRepository; 23 | } 24 | public async Task> GetUserList(UserSearch search) 25 | { 26 | return await _userRepository.GetUserList(search); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /CoreWebApi/Core.Services/UserServices.cs: -------------------------------------------------------------------------------- 1 | using Core.IRepository; 2 | using Core.IServices; 3 | using Core.Model.ViewModels; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Core.Services 10 | { 11 | /// 12 | /// 用户业务层实现 13 | /// 14 | public class UserServices : IUserServices 15 | { 16 | private readonly IUserRepository userRepository; 17 | public UserServices(IUserRepository _userRepository) 18 | { 19 | userRepository = _userRepository; 20 | } 21 | /// 22 | /// 用户注册 23 | /// 24 | /// 25 | /// 26 | public async Task UserRegister(LoginVM loginVM) 27 | { 28 | return await userRepository.UserRegister(loginVM); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /CoreWebApi/CoreDBConsole/CoreDBConsole.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /CoreWebApi/CoreDBConsole/Program.cs: -------------------------------------------------------------------------------- 1 | using Core.Common.EFCore; 2 | using Core.Common.Helper; 3 | using Core.Model; 4 | using Microsoft.Extensions.Options; 5 | using System; 6 | using System.Net; 7 | using System.Net.Mail; 8 | using System.Text; 9 | 10 | namespace CoreDBConsole 11 | { 12 | class Program 13 | { 14 | 15 | static void Main(string[] args) 16 | { 17 | 18 | MailMessage mailMsg = new MailMessage();//实例化对象 19 | mailMsg.From = new MailAddress("923974733@qq.com", "季某人");//源邮件地址和发件人 20 | mailMsg.To.Add(new MailAddress("xiaomaprincess@gmail.com"));//收件人地址 21 | mailMsg.Subject = "邮件发送测试";//发送邮件的标题 22 | StringBuilder sb = new StringBuilder(); 23 | sb.Append("测试测试测试测试"); 24 | sb.Append("嘿嘿"); 25 | mailMsg.Body = sb.ToString();//发送邮件的内容 26 | //指定smtp服务地址(根据发件人邮箱指定对应SMTP服务器地址) 27 | SmtpClient client = new SmtpClient();//格式:smtp.126.com smtp.164.com 28 | // 服务器名称 29 | client.Host = "smtp.qq.com"; 30 | //端口 31 | client.Port = 587; 32 | //启用加密 33 | client.EnableSsl = true; 34 | //通过用户名和密码验证发件人身份 35 | client.Credentials = new NetworkCredential("923974733@qq.com", "xxxxxxxxxx"); 36 | //发送邮件 37 | try 38 | { 39 | client.Send(mailMsg); 40 | } 41 | catch (SmtpException ex) 42 | { 43 | 44 | } 45 | Console.WriteLine("邮件已发送,请注意查收!"); 46 | Console.ReadKey(); 47 | 48 | //string connectionString = @"Server=localhost;Database=coreweb;User=root;Password=Princess;"; 49 | //EFContext context = new EFContext(connectionString, DBTypeEnum.Mysql); 50 | //context.Database.EnsureCreated(); 51 | //Console.WriteLine("数据库已初始化完毕,请查看!"); 52 | 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27703.2047 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreWebApi", "CoreWebApi\CoreWebApi.csproj", "{C1AD1388-B576-4FA7-84CA-D39F9BEE6866}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.Model", "Core.Model\Core.Model.csproj", "{E1E8C3EE-3769-4844-8163-E4B0A8B6B427}" 9 | EndProject 10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.IRepository", "Core.IRepository\Core.IRepository.csproj", "{E8E44F38-BE8E-4F2D-ADD4-DFBA8CF74546}" 11 | EndProject 12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.Repository", "Core.Repository\Core.Repository.csproj", "{3B8B3ACE-E41F-4A07-AA9C-EE04F2857016}" 13 | EndProject 14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.IServices", "Core.IServices\Core.IServices.csproj", "{D41A2D10-ECFE-4615-851D-AD2A3CF5209B}" 15 | EndProject 16 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.Services", "Core.Services\Core.Services.csproj", "{6D968205-C23E-4042-9DF5-A2EAD4462029}" 17 | EndProject 18 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.Common", "Core.Common\Core.Common.csproj", "{97E07083-E52E-4DF0-835E-88604A2D33AE}" 19 | EndProject 20 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreDBConsole", "CoreDBConsole\CoreDBConsole.csproj", "{62736B64-C99D-4CA6-921E-F0E1A5049CA7}" 21 | EndProject 22 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.Msi", "Core.Msi\Core.Msi.csproj", "{66A989B2-3FDC-4F2D-B644-89B7D43907F6}" 23 | EndProject 24 | Global 25 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 26 | Debug|Any CPU = Debug|Any CPU 27 | Release|Any CPU = Release|Any CPU 28 | EndGlobalSection 29 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 30 | {C1AD1388-B576-4FA7-84CA-D39F9BEE6866}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {C1AD1388-B576-4FA7-84CA-D39F9BEE6866}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {C1AD1388-B576-4FA7-84CA-D39F9BEE6866}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {C1AD1388-B576-4FA7-84CA-D39F9BEE6866}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {E1E8C3EE-3769-4844-8163-E4B0A8B6B427}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {E1E8C3EE-3769-4844-8163-E4B0A8B6B427}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {E1E8C3EE-3769-4844-8163-E4B0A8B6B427}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {E1E8C3EE-3769-4844-8163-E4B0A8B6B427}.Release|Any CPU.Build.0 = Release|Any CPU 38 | {E8E44F38-BE8E-4F2D-ADD4-DFBA8CF74546}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {E8E44F38-BE8E-4F2D-ADD4-DFBA8CF74546}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {E8E44F38-BE8E-4F2D-ADD4-DFBA8CF74546}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {E8E44F38-BE8E-4F2D-ADD4-DFBA8CF74546}.Release|Any CPU.Build.0 = Release|Any CPU 42 | {3B8B3ACE-E41F-4A07-AA9C-EE04F2857016}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 43 | {3B8B3ACE-E41F-4A07-AA9C-EE04F2857016}.Debug|Any CPU.Build.0 = Debug|Any CPU 44 | {3B8B3ACE-E41F-4A07-AA9C-EE04F2857016}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {3B8B3ACE-E41F-4A07-AA9C-EE04F2857016}.Release|Any CPU.Build.0 = Release|Any CPU 46 | {D41A2D10-ECFE-4615-851D-AD2A3CF5209B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 47 | {D41A2D10-ECFE-4615-851D-AD2A3CF5209B}.Debug|Any CPU.Build.0 = Debug|Any CPU 48 | {D41A2D10-ECFE-4615-851D-AD2A3CF5209B}.Release|Any CPU.ActiveCfg = Release|Any CPU 49 | {D41A2D10-ECFE-4615-851D-AD2A3CF5209B}.Release|Any CPU.Build.0 = Release|Any CPU 50 | {6D968205-C23E-4042-9DF5-A2EAD4462029}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 51 | {6D968205-C23E-4042-9DF5-A2EAD4462029}.Debug|Any CPU.Build.0 = Debug|Any CPU 52 | {6D968205-C23E-4042-9DF5-A2EAD4462029}.Release|Any CPU.ActiveCfg = Release|Any CPU 53 | {6D968205-C23E-4042-9DF5-A2EAD4462029}.Release|Any CPU.Build.0 = Release|Any CPU 54 | {97E07083-E52E-4DF0-835E-88604A2D33AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 55 | {97E07083-E52E-4DF0-835E-88604A2D33AE}.Debug|Any CPU.Build.0 = Debug|Any CPU 56 | {97E07083-E52E-4DF0-835E-88604A2D33AE}.Release|Any CPU.ActiveCfg = Release|Any CPU 57 | {97E07083-E52E-4DF0-835E-88604A2D33AE}.Release|Any CPU.Build.0 = Release|Any CPU 58 | {62736B64-C99D-4CA6-921E-F0E1A5049CA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 59 | {62736B64-C99D-4CA6-921E-F0E1A5049CA7}.Debug|Any CPU.Build.0 = Debug|Any CPU 60 | {62736B64-C99D-4CA6-921E-F0E1A5049CA7}.Release|Any CPU.ActiveCfg = Release|Any CPU 61 | {62736B64-C99D-4CA6-921E-F0E1A5049CA7}.Release|Any CPU.Build.0 = Release|Any CPU 62 | {66A989B2-3FDC-4F2D-B644-89B7D43907F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 63 | {66A989B2-3FDC-4F2D-B644-89B7D43907F6}.Debug|Any CPU.Build.0 = Debug|Any CPU 64 | {66A989B2-3FDC-4F2D-B644-89B7D43907F6}.Release|Any CPU.ActiveCfg = Release|Any CPU 65 | {66A989B2-3FDC-4F2D-B644-89B7D43907F6}.Release|Any CPU.Build.0 = Release|Any CPU 66 | EndGlobalSection 67 | GlobalSection(SolutionProperties) = preSolution 68 | HideSolutionNode = FALSE 69 | EndGlobalSection 70 | GlobalSection(ExtensibilityGlobals) = postSolution 71 | SolutionGuid = {5E261F9A-6E6A-48D9-BC4D-DA56DC8007B9} 72 | EndGlobalSection 73 | EndGlobal 74 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/AOP/CoreCacheAOP.cs: -------------------------------------------------------------------------------- 1 | using Castle.DynamicProxy; 2 | using Core.Common.Attributes; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace CoreWebApi.AOP 9 | { 10 | /// 11 | /// AOP 缓存 12 | /// 13 | public class CoreCacheAOP : IInterceptor 14 | { 15 | private ICaching _cache; 16 | public CoreCacheAOP(ICaching cache) 17 | { 18 | _cache = cache; 19 | } 20 | /// 21 | /// 拦截方法 22 | /// 23 | /// 24 | public void Intercept(IInvocation invocation) 25 | { 26 | 27 | var method = invocation.MethodInvocationTarget ?? invocation.Method; 28 | // 对当前方法的特性验证 29 | if (method.GetCustomAttributes(true).FirstOrDefault(x => x.GetType() == typeof(CachingAttribute)) is CachingAttribute qCachingAttribute) 30 | { 31 | // 获取自定缓存键 32 | var cacheKey = CustomCacheKey(invocation); 33 | 34 | var cacheValue = _cache.Get(cacheKey); 35 | if (cacheValue != null) 36 | { 37 | // 获取当前的缓存值,并作为返回值返回 38 | invocation.ReturnValue = cacheValue; 39 | return; 40 | } 41 | // 继续执行当前请求 42 | invocation.Proceed(); 43 | 44 | // 存入缓存 45 | if (string.IsNullOrWhiteSpace(cacheKey)) 46 | { 47 | _cache.Set(cacheKey, invocation.ReturnValue); 48 | } 49 | } 50 | else 51 | { 52 | invocation.Proceed(); 53 | } 54 | 55 | 56 | } 57 | 58 | /// 59 | /// 自定义缓存键 60 | /// 61 | /// 62 | /// 63 | private string CustomCacheKey(IInvocation invocation) 64 | { 65 | var typeName = invocation.TargetType.Name; 66 | var methodName = invocation.Method.Name; 67 | var methodArguments = invocation.Arguments.Select(GetArgumentValue).Take(3).ToList(); 68 | string key = $"{typeName}:{methodName}:"; 69 | foreach (var item in methodArguments) 70 | { 71 | key += $"{ item}"; 72 | } 73 | 74 | return key.TrimEnd(':'); 75 | } 76 | 77 | /// 78 | /// object 转 stirng 79 | /// 80 | /// 81 | /// 82 | private string GetArgumentValue(object arg) 83 | { 84 | if (arg is int || arg is long || arg is string) 85 | { 86 | return arg.ToString(); 87 | } 88 | if (arg is DateTime) 89 | { 90 | return ((DateTime)arg).ToString("yyyy-MM-DD HH:mm:ss"); 91 | } 92 | return ""; 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/AOP/CoreLogAOP.cs: -------------------------------------------------------------------------------- 1 | using Castle.DynamicProxy; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace CoreWebApi.AOP 9 | { 10 | /// 11 | /// 拦截器 12 | /// 13 | public class CoreLogAOP : IInterceptor 14 | { 15 | /// 16 | /// 实现IInterceptor方法 17 | /// 18 | /// 包含被拦截方法的信息 19 | public void Intercept(IInvocation invocation) 20 | { 21 | var dataIntercept=$"{DateTime.Now.ToString("yyyyMMDDHHmmss")}"+$"当前执行方法:{invocation.Method.Name}"+$"参数是:{string.Join(",",invocation.Arguments.Select(a=>(a??"")).ToString().ToArray())} \r\n"; 22 | 23 | // 执行后,继续执行当前方法 24 | invocation.Proceed(); 25 | dataIntercept += ($"方法执行完毕,返回结果:{invocation.ReturnValue}"); 26 | 27 | #region 输出到当前项目日志 28 | var path = Directory.GetCurrentDirectory() + @"\Log"; 29 | if (!Directory.Exists(path)) 30 | { 31 | Directory.CreateDirectory(path); 32 | } 33 | string fileName = path + $@"\InterceptLog-{DateTime.Now.ToString("yyyy-MM-dd HHmmss")}.log"; 34 | StreamWriter sw = File.AppendText(fileName); 35 | sw.WriteLine(dataIntercept); 36 | sw.Close(); 37 | #endregion 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/AOP/ICachingProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace CoreWebApi.AOP 7 | { 8 | /// 9 | /// 缓存接口 10 | /// 11 | public interface ICaching 12 | { 13 | /// 14 | /// 取数据 15 | /// 16 | /// 17 | /// 18 | object Get(string cacheKey); 19 | /// 20 | /// 存数据 21 | /// 22 | /// 23 | /// 24 | void Set(string cacheLey, object cacheValue); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/AOP/MemoryCaching.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Caching.Memory; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace CoreWebApi.AOP 8 | { 9 | /// 10 | /// 实例化缓存接口 11 | /// 12 | public class MemoryCaching : ICaching 13 | { 14 | 15 | private IMemoryCache _cache; 16 | 17 | public MemoryCaching(IMemoryCache cache) 18 | { 19 | _cache = cache; 20 | } 21 | 22 | public object Get(string cacheKey) 23 | { 24 | return _cache.Get(cacheKey); 25 | } 26 | 27 | public void Set(string cacheLey, object cacheValue) 28 | { 29 | // 设置过期时间 30 | _cache.Set(cacheLey, cacheValue, TimeSpan.FromSeconds(7200)); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/AuthHelper/OverWrite/JwtHelper.cs: -------------------------------------------------------------------------------- 1 | using Core.Model; 2 | using Microsoft.IdentityModel.Tokens; 3 | using System; 4 | using System.IdentityModel.Tokens.Jwt; 5 | using System.Security.Claims; 6 | using System.Text; 7 | 8 | namespace CoreWebApi.AuthHelper.OverWrite 9 | { 10 | public class JwtHelper 11 | { 12 | public static string secretKey { get; set; } = "sdfsdfsrty45634kkhllghtdgdfss345t678fs"; 13 | 14 | /// 15 | /// 颁发JWT字符串 16 | /// 17 | /// 18 | /// 19 | public static string IssueJWT(TokenModelJWT tokenModel) 20 | { 21 | var dateTime = DateTime.UtcNow; 22 | //var claims = new Claim[] 23 | //{ 24 | // new Claim(JwtRegisteredClaimNames.Jti,tokenModel.Uid.ToString()),//Id 25 | // new Claim("Role", tokenModel.Role),//角色 26 | // new Claim(JwtRegisteredClaimNames.Iat,dateTime.ToString(),ClaimValueTypes.Integer64) 27 | //}; 28 | 29 | var claims = new Claim[] 30 | { 31 | // Claim的默认配置 32 | new Claim(JwtRegisteredClaimNames.Jti,Guid.NewGuid().ToString()), 33 | new Claim(JwtRegisteredClaimNames.Iat, $"{new DateTimeOffset(DateTime.Now).ToUnixTimeSeconds()}"), 34 | new Claim(JwtRegisteredClaimNames.Nbf,$"{new DateTimeOffset(DateTime.Now).ToUnixTimeSeconds()}") , 35 | // 设置JWT过期时间 100秒 36 | new Claim(JwtRegisteredClaimNames.Exp,$"{new DateTimeOffset(DateTime.Now.AddSeconds(100)).ToUnixTimeSeconds()}"), 37 | new Claim(JwtRegisteredClaimNames.Iss,"Blog.Core"), 38 | new Claim(JwtRegisteredClaimNames.Aud,"wr"), 39 | // 使用官方UseAuthentication授权要验证的Role 40 | new Claim(ClaimTypes.Role,tokenModel.Role) 41 | }; 42 | //秘钥 43 | var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(secretKey)); 44 | var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256); 45 | 46 | var jwt = new JwtSecurityToken( 47 | issuer: "Blog.Core", 48 | claims: claims, //声明集合 49 | expires: dateTime.AddHours(2), 50 | signingCredentials: creds); 51 | 52 | var jwtHandler = new JwtSecurityTokenHandler(); 53 | var encodedJwt = jwtHandler.WriteToken(jwt); 54 | 55 | return encodedJwt; 56 | } 57 | 58 | 59 | /// 60 | /// 解析 61 | /// 62 | /// 63 | /// 64 | public static TokenModelJWT SerializeJWT(string jwtStr) 65 | { 66 | var jwtHandler = new JwtSecurityTokenHandler(); 67 | JwtSecurityToken jwtToken = jwtHandler.ReadJwtToken(jwtStr); 68 | object role = new object(); ; 69 | try 70 | { 71 | jwtToken.Payload.TryGetValue("Role", out role); 72 | } 73 | catch (Exception e) 74 | { 75 | Console.WriteLine(e); 76 | throw; 77 | } 78 | var tm = new TokenModelJWT 79 | { 80 | Uid = (jwtToken.Id).ObjToInt(), 81 | Role = role != null ? role.ObjToString() : "", 82 | }; 83 | return tm; 84 | } 85 | } 86 | 87 | public class TokenModelJWT 88 | { 89 | /// 90 | /// Id 91 | /// 92 | public long Uid { get; set; } 93 | /// 94 | /// 角色 95 | /// 96 | public string Role { get; set; } 97 | /// 98 | /// 职能 99 | /// 100 | public string Work { get; set; } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/AuthHelper/OverWrite/JwtTokenAuth.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using Microsoft.AspNetCore.Http; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Security.Claims; 7 | using System.Threading.Tasks; 8 | 9 | namespace CoreWebApi.AuthHelper.OverWrite 10 | { 11 | public class JwtTokenAuth 12 | { 13 | 14 | private readonly RequestDelegate _next; 15 | 16 | public JwtTokenAuth(RequestDelegate next) 17 | { 18 | _next = next; 19 | } 20 | /// 21 | /// 处理http请求 22 | /// 23 | /// http请求上下文 24 | /// 25 | public Task Invoke(HttpContext httpContext) 26 | { 27 | // 检测是否包含'Authorization'请求头 28 | if (!httpContext.Request.Headers.ContainsKey("Authorization")) 29 | { 30 | return _next(httpContext); 31 | } 32 | 33 | // 获取token 并去除Bearer 34 | var tokenHeader = httpContext.Request.Headers["Authorization"].ToString().Replace("Bearer ",""); 35 | 36 | TokenModelJWT tm = JwtHelper.SerializeJWT(tokenHeader); // 序列化token,获取授权 37 | 38 | // 授权 可以是多个角色 39 | var claimList = new List(); 40 | var claim = new Claim(ClaimTypes.Role, tm.Role); 41 | claimList.Add(claim); 42 | var identity = new ClaimsIdentity(claimList); 43 | var principal = new ClaimsPrincipal(identity); 44 | httpContext.User = principal; 45 | 46 | return _next(httpContext); 47 | } 48 | } 49 | 50 | //public static class RequestCultureMiddlewareExtensions 51 | //{ 52 | // public static IApplicationBuilder UseRequestCulture( 53 | // this IApplicationBuilder builder) 54 | // { 55 | // return builder.UseMiddleware(); 56 | // } 57 | //} 58 | } 59 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/AutoMapper/CustomProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Core.Model.Models; 3 | using Core.Model.ViewModels; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Threading.Tasks; 8 | 9 | namespace CoreWebApi.AutoMapper 10 | { 11 | /// 12 | /// 自动映射 13 | /// 14 | public class CustomProfile: Profile 15 | { 16 | public CustomProfile() 17 | { 18 | CreateMap(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/Controllers/LoginController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using CoreWebApi.AuthHelper.OverWrite; 6 | using Microsoft.AspNetCore.Authorization; 7 | using Microsoft.AspNetCore.Cors; 8 | using Microsoft.AspNetCore.Mvc; 9 | 10 | namespace CoreWebApi.Controllers 11 | { 12 | [Route("api/[controller]/[action]")] 13 | [ApiController] 14 | [Produces("application/json")] 15 | [EnableCors("LimitRequests")] 16 | public class LoginController : Controller 17 | { 18 | /// 19 | /// 获取token 20 | /// 21 | /// 用户id 22 | /// 角色 23 | /// 24 | [HttpGet] 25 | public JsonResult GetJWTStr(long id , string sub) 26 | { 27 | //这里就是用户登陆以后,通过数据库去调取数据,分配权限的操作 28 | TokenModelJWT tokenModel = new TokenModelJWT(); 29 | tokenModel.Uid = id; 30 | tokenModel.Role = sub; 31 | 32 | // 获取token 33 | string jwtStr = JwtHelper.IssueJWT(tokenModel); 34 | return Json(jwtStr); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/Controllers/TodoItemController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using CoreWebApi.Models; 6 | using Microsoft.AspNetCore.Authorization; 7 | using Microsoft.AspNetCore.Http; 8 | using Microsoft.AspNetCore.Mvc; 9 | 10 | namespace CoreWebApi.Controllers 11 | { 12 | /// 13 | /// Todo控制器 14 | /// 15 | [Produces("application/json")] 16 | [Route("api/[controller]/[action]")] 17 | [ApiController] 18 | [Authorize(Roles ="Admin,Client")] 19 | [Authorize(Policy ="SystemOrAdmin")] 20 | public class TodoItemController : ControllerBase 21 | { 22 | /// 23 | /// 获取待办事项列表 24 | /// 25 | /// 26 | [HttpGet] 27 | [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] 28 | public List GetAll() 29 | { 30 | var ss = new List(); 31 | return ss; 32 | } 33 | /// 34 | /// 根据ID获取特定数据 35 | /// 36 | /// 主键ID 37 | /// 38 | [HttpGet("{id}", Name = "GetTodo")] 39 | [ProducesResponseType(200)] 40 | public a GetById(long id) 41 | { 42 | var result = new a(); 43 | return result; 44 | } 45 | /// 46 | /// FromBody 特性从情报体中获取参数,2.1版本之后不用添加 47 | /// 48 | /// 49 | /// 50 | [HttpPost] 51 | [ProducesResponseType(typeof(TodoItem), 201)]// 数据注释,告诉客户端返回类型 52 | public IActionResult Create([FromBody]TodoItem item) 53 | { 54 | if (item == null) 55 | { 56 | return BadRequest(); 57 | } 58 | // 添加成功后跳转到名为GetById的route 59 | return CreatedAtRoute("GetTodo", new { id = item.Id }, item); 60 | } 61 | /// 62 | /// Put请求:更新数据 63 | /// 64 | /// 65 | /// 66 | /// 67 | [HttpPut("{id}")] 68 | public IActionResult Update(long id, [FromBody] TodoItem item) 69 | { 70 | if (item == null || item.Id != id) 71 | { 72 | return BadRequest(); 73 | } 74 | return NoContent(); 75 | } 76 | /// 77 | /// Delete 78 | /// 79 | /// 80 | /// 81 | [HttpDelete("{id}")] 82 | public IActionResult Delete(long id) 83 | { 84 | return NoContent(); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/Controllers/UserController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Core.IServices; 6 | using Core.Model.ViewModels; 7 | using Microsoft.AspNetCore.Http; 8 | using Microsoft.AspNetCore.Mvc; 9 | 10 | namespace CoreWebApi.Controllers 11 | { 12 | [Produces("application/json")] 13 | [Route("api/v1/[controller]/[action]")] 14 | [ApiController] 15 | public class UserController : ControllerBase 16 | { 17 | private readonly IUserServices userServices; 18 | public UserController(IUserServices _userServices) 19 | { 20 | userServices = _userServices; 21 | } 22 | 23 | /// 24 | /// 用户注册 25 | /// 26 | /// 27 | /// 28 | [HttpPost] 29 | public async Task UserRegister(LoginVM loginVM) 30 | { 31 | return await userServices.UserRegister(loginVM); 32 | //return await new Task(new LoginResult{Reason="1"}); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/Controllers/ValuesController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using CoreWebApi.Models; 7 | using Microsoft.AspNetCore.Http; 8 | using Microsoft.AspNetCore.Authorization; 9 | 10 | namespace CoreWebApi.Controllers 11 | { 12 | /// 13 | /// value控制器 14 | /// 15 | [Route("api/[controller]/[action]")] 16 | [ApiController] 17 | [Produces("application/json")] 18 | [Authorize] 19 | public class ValuesController : ControllerBase 20 | { 21 | // GET api/values 22 | [HttpGet] 23 | [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] 24 | public ActionResult> Get() 25 | { 26 | return new string[] { "value1", "value2" }; 27 | } 28 | 29 | /// 30 | /// Get请求 31 | /// 32 | /// 33 | /// 34 | // GET api/values/5 35 | [HttpGet("{id}")] 36 | [ProducesResponseType(201)] 37 | public ActionResult Get(int id) 38 | { 39 | return "value"; 40 | } 41 | 42 | // POST api/values 43 | [HttpPost] 44 | [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] 45 | public void Post([FromBody] string value) 46 | { 47 | } 48 | 49 | // PUT api/values/5 50 | [HttpPut("{id}")] 51 | [ProducesResponseType(201)] 52 | public void Put(int id, [FromBody] string value) 53 | { 54 | } 55 | 56 | // DELETE api/values/5 57 | [HttpDelete("{id}")] 58 | [ProducesResponseType(201)] 59 | public void Delete(int id) 60 | { 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/CoreWebApi.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | true 6 | 1701;1702;1705;1591;1703 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Always 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/Filter/GlobalExceptionFilter.cs: -------------------------------------------------------------------------------- 1 | using CoreWebApi.Log; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.AspNetCore.Http; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.AspNetCore.Mvc.Filters; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Linq; 9 | using System.Threading.Tasks; 10 | 11 | namespace CoreWebApi.Filter 12 | { 13 | /// 14 | /// 全局异常错误日志 15 | /// 16 | public class GlobalExceptionFilter : IExceptionFilter 17 | { 18 | private readonly IHostingEnvironment _env; 19 | private readonly ILoggerHelper _loggerHelper; 20 | public GlobalExceptionFilter(IHostingEnvironment env, ILoggerHelper loggerHelper) 21 | { 22 | _env = env; 23 | _loggerHelper = loggerHelper; 24 | } 25 | public void OnException(ExceptionContext context) 26 | { 27 | var json = new JsonErrorResponse(); 28 | // 错误信息 29 | json.Message = context.Exception.Message; 30 | if (_env.IsDevelopment()) 31 | { 32 | // 开发环境,记录堆栈信息 33 | json.DevelopmentMessage = context.Exception.StackTrace; 34 | } 35 | // 使用log4net记录错误日志 36 | context.Result = new InternalServerErrorObjectResult(json); 37 | _loggerHelper.Error(json.Message, WriteLog(json.Message, context.Exception)); 38 | } 39 | 40 | /// 41 | /// 自定义返回格式 42 | /// 43 | /// 44 | /// 45 | /// 46 | private string WriteLog(string throwMsg,Exception ex) 47 | { 48 | return string.Format("【自定义错误】:{0} \r\n【异常类型】:{1} \r\n【异常信息】:{2} \r\n【堆栈调用】:{3}", new object[] { throwMsg, 49 | ex.GetType().Name, ex.Message, ex.StackTrace }); 50 | } 51 | } 52 | 53 | public class InternalServerErrorObjectResult : ObjectResult 54 | { 55 | public InternalServerErrorObjectResult(object value) : base(value) 56 | { 57 | StatusCode = StatusCodes.Status500InternalServerError; 58 | } 59 | } 60 | 61 | /// 62 | /// 返回错误信息 63 | /// 64 | public class JsonErrorResponse 65 | { 66 | /// 67 | /// 生产环境消息 68 | /// 69 | public string Message { get; set; } 70 | 71 | /// 72 | /// 开发环境消息 73 | /// 74 | public string DevelopmentMessage { get; set; } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/Models/TodeItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace CoreWebApi.Models 7 | { 8 | public class TodoItem 9 | { 10 | /// 11 | /// 主键 12 | /// 13 | public long Id { get; set; } 14 | /// 15 | /// 待办事项描述 16 | /// 17 | public string Name { get; set; } 18 | /// 19 | /// 是否完成 20 | /// 21 | public bool IsComplete { get; set; } 22 | } 23 | public struct a 24 | { 25 | /// 26 | /// awawaw 27 | /// 28 | public string wwwwwww { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/Nlog.config: -------------------------------------------------------------------------------- 1 |  2 | 7 | 8 | 9 | 10 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | using NLog.Web; 11 | 12 | namespace CoreWebApi 13 | { 14 | public class Program 15 | { 16 | public static void Main(string[] args) 17 | { 18 | CreateWebHostBuilder(args).Build().Run(); 19 | } 20 | 21 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 22 | WebHost.CreateDefaultBuilder(args) 23 | .UseNLog() 24 | .UseStartup(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:64402", 8 | "sslPort": 44391 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "swagger", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "CoreWebApi": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "launchUrl": "swagger", 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/SwaggerHelper/CustomApiVersion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace CoreWebApi.SwaggerHelper 7 | { 8 | /// 9 | /// 自定义接口版本 10 | /// 11 | public class CustomApiVersion 12 | { 13 | public enum ApiVersions 14 | { 15 | /// 16 | /// v1版本 17 | /// 18 | v1=1, 19 | /// 20 | /// v2版本 21 | /// 22 | v2=2, 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/SwaggerHelper/CustomRouteAttribute.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.ApiExplorer; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using static CoreWebApi.SwaggerHelper.CustomApiVersion; 8 | 9 | namespace CoreWebApi.SwaggerHelper 10 | { 11 | /// 12 | /// 自定义路由 /api/{version}/[controler]/[action] 13 | /// 14 | public class CustomRouteAttribute : RouteAttribute, IApiDescriptionGroupNameProvider 15 | { 16 | /// 17 | /// 分组名称,用来实现实现IApiDescriptionGroupNameProvider 18 | /// 19 | public string GroupName { get; set; } 20 | 21 | /// 22 | /// 自定义路由构造函数,继承基类路由 23 | /// 24 | /// 25 | public CustomRouteAttribute(string actionName = "[action]"):base("/api/{version}/[controller]/"+actionName) 26 | { 27 | 28 | } 29 | 30 | /// 31 | /// 自定义路由构造函数,继承基类路由 32 | /// 33 | /// 方法名 34 | /// 版本 35 | public CustomRouteAttribute(ApiVersions version, string actionName = "[action]") : base($"/api/{version.ToString()}/[controller]/{actionName}") 36 | { 37 | GroupName = version.ToString(); 38 | } 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/appsettings.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoMaPrincess/.NetCoreWebApi/266dcd560162e1db7a5d7d7b1e4379ba83625a6d/CoreWebApi/CoreWebApi/appsettings.json -------------------------------------------------------------------------------- /CoreWebApi/CoreWebApi/log4net.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # .NetCoreWebApi 2 | **一个基于.NETCore的后端接口项目。目前的设想是做个人博客网站使用。前端打算用Vue全家桶(目前还未开始)。** 3 | 4 | 此外还有一个单层项目: 5 | 6 | https://github.com/xiaoMaPrincess/Asp.NetCore-WebApi 7 | 8 | ------ 9 | 10 | ### 计划引入的功能: 11 | 12 | **Swagger:** 13 | 14 | ​ SwaggerUI **√** 15 | 16 | ​ 身份认证与授权 **√** 17 | 18 | ​ Api多版本控制 **√** 19 | 20 | **ORM:** 21 | 22 | ​ Dapper **√** 23 | 24 | ​ EFCore **√** 25 | 26 | **关系型数据库:** 27 | 28 | ​ Mysql **√** 29 | 30 | ​ SqlServer **√** 31 | 32 | **Nosql数据库:** 33 | 34 | ​ Redis **√** 35 | 36 | ​ MonogoDB **√** 37 | 38 | **依赖注入:** 39 | 40 | ​ AutoFac **√** 41 | 42 | ​ .NetCore自带容器 **√** 43 | 44 | **作业调度:** 45 | 46 | ​ Quartz.NET 47 | 48 | **日志记录:** 49 | 50 | ​ Nlog **√** 51 | 52 | **对象自动映射:** 53 | 54 | ​ AutoMapper **√** 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | --------------------------------------------------------------------------------