diff --git a/QYMessageCenter.Client/APIServices/BaseApiService.cs b/QYMessageCenter.Client/APIServices/BaseApiService.cs new file mode 100644 index 0000000..3b0031c --- /dev/null +++ b/QYMessageCenter.Client/APIServices/BaseApiService.cs @@ -0,0 +1,55 @@ +using Newtonsoft.Json; +using QYMessageCenter.Common.Http; +using QYMessageCenter.Common.Models; +using System.Net.Http; +namespace QYMessageCenter.Client.APIServices +{ + public class BaseApiService + { + private RestApiService restApiService; + + protected GlobalContext globalContext; + + public BaseApiService(RestApiService restApiService, GlobalContext globalContext) + { + this.restApiService = restApiService; + this.globalContext = globalContext; + } + + protected ApiResponse SendRequest(string apiHost, + string apiPath, + object param, + IDictionary headers, + HttpMethod httpMethod, + string contentType = RestApiService.ContentType_Json, + ParamPosition paramPosition = ParamPosition.Body, + bool enableRandomTimeStamp = false) + { + try + { + if (headers == null) + headers = new Dictionary(); + //if (!headers.ContainsKey("ClientCode")) + // headers.Add("ClientCode", "BBWYB"); + //if (!headers.ContainsKey("ClientVersion")) + // headers.Add("ClientVersion", globalContext.BBWYBApiVersion); + if (!headers.ContainsKey("Authorization") && !string.IsNullOrEmpty(globalContext.UserToken)) + headers.Add("Authorization", $"Bearer {globalContext.UserToken}"); + if (!headers.ContainsKey("qy")) + headers.Add("qy", "qy"); + + var result = restApiService.SendRequest(apiHost, apiPath, param, headers, httpMethod, contentType, paramPosition, enableRandomTimeStamp); + if (result.StatusCode != System.Net.HttpStatusCode.OK && + result.Content.Contains("\"Success\"") && + result.Content.Contains("\"Msg\"") && + result.Content.Contains("\"Data\"")) + throw new BusinessException($"{result.StatusCode} {result.Content}") { Code = (int)result.StatusCode }; + return JsonConvert.DeserializeObject>(result.Content); + } + catch (Exception ex) + { + return ApiResponse.Error((ex is BusinessException) ? (ex as BusinessException).Code : 0, ex.Message); + } + } + } +} diff --git a/QYMessageCenter.Client/APIServices/MdsApiService.cs b/QYMessageCenter.Client/APIServices/MdsApiService.cs new file mode 100644 index 0000000..53a0e37 --- /dev/null +++ b/QYMessageCenter.Client/APIServices/MdsApiService.cs @@ -0,0 +1,106 @@ +using Newtonsoft.Json.Linq; +using QYMessageCenter.Client.Models; +using QYMessageCenter.Common.Http; +using QYMessageCenter.Common.Models; +using System.Net.Http; + +namespace QYMessageCenter.Client.APIServices +{ + public class MdsApiService : BaseApiService, IDenpendency + { + private string mdsApi = "http://mdsapi.qiyue666.com"; + + public MdsApiService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext) + { + + } + + public ApiResponse GetUserInfo(string userToken) + { + return SendRequest(mdsApi, + "/TaskList/User/GetUserInfo", + null, + new Dictionary() + { + { "Authorization", $"Bearer {userToken}" } + }, HttpMethod.Get); + } + + + public ApiResponse> GetShopDetailList() + { + var response = new ApiResponse>(); + var response2 = SendRequest(mdsApi, "TaskList/UserDepartment/GetShopDetailList", null, null, HttpMethod.Get); + if (!response.Success) + { + response.Code = response2.Code; + response.Msg = response2.Msg; + return response; + } + + response.Data = new List(); + foreach (var jDepartment in response2.Data) + { + var jayShops = jDepartment.Value("ShopList"); + if (jayShops == null || !jayShops.HasValues) + continue; //排除空店部门 + var d = new Department() + { + Id = jDepartment.Value("Id"), + Name = jDepartment.Value("DepartmentName") + }; + response.Data.Add(d); + foreach (var jShop in jayShops) + { + var shopId = jShop.Value("ShopId"); + if (shopId == null || string.IsNullOrEmpty(jShop.Value("AppToken"))) + continue; //排除未授权 + try + { + var jayAccounts = jShop.Value("AccountList"); + if ((jayAccounts == null || !jayAccounts.HasValues) && d.ShopList.Count(s => s.ShopId == shopId) > 0) + { + continue; + } + var shop = new Shop() + { + ShopId = shopId.Value, + AppKey = jShop.Value("AppKey"), + AppSecret = jShop.Value("AppSecret"), + AppToken = jShop.Value("AppToken"), + ManagePwd = jShop.Value("ManagePwd"), + Platform = (Platform)jShop.Value("PlatformId"), + PlatformCommissionRatio = jShop.Value("PlatformCommissionRatio") ?? 0.05M, + ShopName = jShop.Value("ShopName"), + VenderType = jShop.Value("ShopType"), + TeamId = jShop.Value("TeamId") + }; + d.ShopList.Add(shop); + + shop.PurchaseAccountList = new List(); + foreach (var jPurchaseAccount in jayAccounts) + { + shop.PurchaseAccountList.Add(new PurchaseAccount() + { + Id = jPurchaseAccount.Value("Id"), + AccountName = jPurchaseAccount.Value("AccountName"), + AppKey = jPurchaseAccount.Value("AppKey"), + AppSecret = jPurchaseAccount.Value("AppSecret"), + AppToken = jPurchaseAccount.Value("AppToken"), + ShopId = shop.ShopId, + PurchasePlatformId = (Platform)jPurchaseAccount.Value("AppPlatformId") + }); + } + } + catch (Exception ex) + { + Console.WriteLine(jShop.ToString()); + throw; + } + } + } + + return response; + } + } +} diff --git a/QYMessageCenter.Client/APIServices/ShopService.cs b/QYMessageCenter.Client/APIServices/ShopService.cs new file mode 100644 index 0000000..ef0d677 --- /dev/null +++ b/QYMessageCenter.Client/APIServices/ShopService.cs @@ -0,0 +1,28 @@ +using QYMessageCenter.Client.Models; +using QYMessageCenter.Common.Http; +using QYMessageCenter.Common.Models; +using System.Net.Http; + +namespace QYMessageCenter.Client.APIServices +{ + public class ShopService : BaseApiService + { + private string bbwyhost = "http://bbwytest.qiyue666.com"; + + public ShopService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext) { } + + + /// + /// 获取部门及下属店铺 + /// + /// + public ApiResponse> GetDepartmentList() + { + return SendRequest>(bbwyhost, "api/vender/GetDeparmentList", null, + new Dictionary() + { + { "bbwyTempKey", "21jfhayu27q" } + }, HttpMethod.Get); + } + } +} diff --git a/QYMessageCenter.Client/App.xaml b/QYMessageCenter.Client/App.xaml new file mode 100644 index 0000000..4f02c61 --- /dev/null +++ b/QYMessageCenter.Client/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/QYMessageCenter.Client/App.xaml.cs b/QYMessageCenter.Client/App.xaml.cs new file mode 100644 index 0000000..fca2011 --- /dev/null +++ b/QYMessageCenter.Client/App.xaml.cs @@ -0,0 +1,70 @@ +using Microsoft.Extensions.DependencyInjection; +using QYMessageCenter.Client.APIServices; +using QYMessageCenter.Client.Helpers; +using QYMessageCenter.Client.Models; +using QYMessageCenter.Common.Extensions; +using QYMessageCenter.Common.Http; +using System.Configuration; +using System.Data; +using System.Windows; + +namespace QYMessageCenter.Client +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + public IServiceProvider ServiceProvider { get; private set; } + + protected override void OnStartup(StartupEventArgs e) + { + string userToken = string.Empty; + +#if DEBUG + //齐越山鸡 + userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNTM1MzMwMzI4ODkyMTQ5NzYwIiwidGVhbUlkIjoiMTUxNjk3NDI1MDU0MjUwMTg4OCIsInNvblRlYW1JZHMiOiIxNDM2Mjg4NTAwMjM1MjQzNTIwIiwiZXhwIjoxNzI2MzAwNjY0fQ.hPSbgJEuTt0MLy_7YkSJX4rRG3drJAfso-5IS8ZlOkY"; +#else + + var tokenResult = ReadMMF(); + if (tokenResult.isOk) + userToken = tokenResult.content; + else + { + MessageBox.Show($"读取内存数据失败\r\n{tokenResult.content}", "提示"); + Environment.Exit(0); + } +#endif + + var gl = new GlobalContext(); + gl.UserToken = userToken; + IServiceCollection serviceCollection = new ServiceCollection(); + serviceCollection.AddHttpClient(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(gl); + serviceCollection.AddMapper(new MappingProfile()); + ServiceProvider = serviceCollection.BuildServiceProvider(); + base.OnStartup(e); + } + + public (bool isOk, string content) ReadMMF() + { + + try + { + var token = MemoryHelper.GetMemoryToken(); + if (string.IsNullOrEmpty(token)) + return (false, "token为空"); + else + return (true, token); + } + catch (Exception ex) + { + return (false, ex.Message); + } + } + } + +} diff --git a/QYMessageCenter.Client/AssemblyInfo.cs b/QYMessageCenter.Client/AssemblyInfo.cs new file mode 100644 index 0000000..b0ec827 --- /dev/null +++ b/QYMessageCenter.Client/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/QYMessageCenter.Client/GlobalContext.cs b/QYMessageCenter.Client/GlobalContext.cs new file mode 100644 index 0000000..ec732b3 --- /dev/null +++ b/QYMessageCenter.Client/GlobalContext.cs @@ -0,0 +1,20 @@ +using Newtonsoft.Json; +using QYMessageCenter.Client.Models; +using System.Runtime.InteropServices; + +namespace QYMessageCenter.Client +{ + [ClassInterface(ClassInterfaceType.AutoDual)] + [ComVisible(true)] + public class GlobalContext + { + public User User { get; set; } + + public string UserToken { get; set; } + + public string GetUserString() + { + return JsonConvert.SerializeObject(User); + } + } +} diff --git a/QYMessageCenter.Client/Helpers/MemoryHelper.cs b/QYMessageCenter.Client/Helpers/MemoryHelper.cs new file mode 100644 index 0000000..f65cfdb --- /dev/null +++ b/QYMessageCenter.Client/Helpers/MemoryHelper.cs @@ -0,0 +1,49 @@ +using System; +using System.IO; +using System.IO.Pipes; + +namespace QYMessageCenter.Client.Helpers +{ + public class MemoryHelper + { + /// + /// 获取token + /// + /// + public static string GetMemoryToken() + { + try + { + string pipeId = Environment.GetCommandLineArgs()[1]; + //创建输入类型匿名管道 + using (PipeStream pipeClient = new AnonymousPipeClientStream(PipeDirection.In, pipeId)) + { + using (StreamReader sr = new StreamReader(pipeClient)) + { + string temp; + + do + { + temp = sr.ReadLine(); + } + while (!temp.StartsWith("SYNC")); + + + while ((temp = sr.ReadLine()) != null) + { + return temp; + } + } + } + + return string.Empty; + } + catch (Exception ex) + { + return string.Empty; + } + + } + + } +} diff --git a/QYMessageCenter.Client/MainWindow.xaml b/QYMessageCenter.Client/MainWindow.xaml new file mode 100644 index 0000000..495cb2e --- /dev/null +++ b/QYMessageCenter.Client/MainWindow.xaml @@ -0,0 +1,13 @@ + + + + + diff --git a/QYMessageCenter.Client/MainWindow.xaml.cs b/QYMessageCenter.Client/MainWindow.xaml.cs new file mode 100644 index 0000000..49c8b25 --- /dev/null +++ b/QYMessageCenter.Client/MainWindow.xaml.cs @@ -0,0 +1,96 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Web.WebView2.Core; +using Microsoft.Web.WebView2.Wpf; +using QYMessageCenter.Client.APIServices; +using QYMessageCenter.Client.Models; +using QYMessageCenter.Common.Extensions; +using System.IO; +using System.Reflection; +using System.Text; +using System.Windows; +using io = System.IO; +namespace QYMessageCenter.Client +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + private WebView2 wb2; + private MdsApiService mdsApiService; + private ShopService shopService; + private GlobalContext globalContext; + + public MainWindow() + { + InitializeComponent(); + + var sp = (App.Current as App).ServiceProvider; + + using (var s = sp.CreateScope()) + { + this.mdsApiService = s.ServiceProvider.GetRequiredService(); + this.shopService = s.ServiceProvider.GetRequiredService(); + this.globalContext = s.ServiceProvider.GetRequiredService(); + } + + + this.Loaded += MainWindow_Loaded; + } + + private async void MainWindow_Loaded(object sender, RoutedEventArgs e) + { + wb2 = new WebView2(); + grid.Children.Add(wb2); + var wb2Setting = CoreWebView2Environment.CreateAsync(userDataFolder: io.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "QYMessageCenter.Client")).Result; + wb2.CoreWebView2InitializationCompleted += Wb2_CoreWebView2InitializationCompleted; + await wb2.EnsureCoreWebView2Async(wb2Setting); + //wb2.CoreWebView2.NavigateToString(html); + } + + private void Wb2_CoreWebView2InitializationCompleted(object? sender, CoreWebView2InitializationCompletedEventArgs e) + { + Login(); + wb2.CoreWebView2.AddHostObjectToScript("qymsgcenter", this.globalContext); + + var html = File.ReadAllText(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "static", "index.html"), Encoding.UTF8); + wb2.CoreWebView2.NavigateToString(html); + this.Visibility = Visibility.Collapsed; + } + + private void Login() + { + try + { + var mdsUserResponse = mdsApiService.GetUserInfo(globalContext.UserToken); + if (!mdsUserResponse.Success) + throw new Exception($"获取磨刀石用户信息失败 {mdsUserResponse.Msg}"); + + globalContext.User = mdsUserResponse.Data.Map(); + globalContext.User.Token = globalContext.UserToken; + globalContext.User.SonDepartmentNames = string.Empty; + //if (mdsUserResponse.Data.SonDepartmentList != null && mdsUserResponse.Data.SonDepartmentList.Count > 0) + // globalContext.User.SonDepartmentNames = string.Join(',', mdsUserResponse.Data.SonDepartmentList.Select(sd => sd.DepartmentName)); + + var response = mdsApiService.GetShopDetailList(); + if (!response.Success) + throw new Exception(response.Msg); + var departmentList = response.Data; + if (departmentList.Count == 0) + throw new Exception("缺少有效的部门数据"); + + globalContext.User.DepartmentList = departmentList; + } + catch (Exception ex) + { + + App.Current.Dispatcher.Invoke(() => + { + MessageBox.Show(ex.Message, "登录失败"); + }); + Environment.Exit(Environment.ExitCode); + } + + } + } +} \ No newline at end of file diff --git a/QYMessageCenter.Client/Models/Enums.cs b/QYMessageCenter.Client/Models/Enums.cs new file mode 100644 index 0000000..4334aa2 --- /dev/null +++ b/QYMessageCenter.Client/Models/Enums.cs @@ -0,0 +1,15 @@ +namespace QYMessageCenter.Client.Models +{ + /// + /// 电商平台 + /// + public enum Platform + { + 淘宝 = 0, + 京东 = 1, + 阿里巴巴 = 2, + 拼多多 = 3, + 微信 = 4, + 拳探 = 10 + } +} diff --git a/QYMessageCenter.Client/Models/MappingProfile.cs b/QYMessageCenter.Client/Models/MappingProfile.cs new file mode 100644 index 0000000..d1e1f8e --- /dev/null +++ b/QYMessageCenter.Client/Models/MappingProfile.cs @@ -0,0 +1,22 @@ +using AutoMapper; + +namespace QYMessageCenter.Client.Models +{ + public class MappingProfile : Profile + { + public MappingProfile() + { + + CreateMap().ForMember(t => t.TeamId, opt => opt.MapFrom(f => f.DepartmentId)) + .ForMember(t => t.TeamName, opt => opt.MapFrom(f => f.DepartmentName)) + .ForMember(t => t.Name, opt => opt.MapFrom(f => f.UserName)); + + CreateMap().ForMember(t => t.VenderType, opt => opt.MapFrom(f => f.ShopType)) + .ForMember(t => t.Platform, opt => opt.MapFrom(f => f.PlatformId)) + .ForMember(t => t.PurchaseAccountList, opt => opt.MapFrom(f => f.PurchaseList)); + + CreateMap(); + CreateMap(); + } + } +} diff --git a/QYMessageCenter.Client/Models/Shop/Department.cs b/QYMessageCenter.Client/Models/Shop/Department.cs new file mode 100644 index 0000000..db95911 --- /dev/null +++ b/QYMessageCenter.Client/Models/Shop/Department.cs @@ -0,0 +1,33 @@ +namespace QYMessageCenter.Client.Models +{ + public class Department + { + + public string Id { get; set; } + + public string Name { get; set; } + + public IList ShopList { get; set; } + + public Department() + { + ShopList = new List(); + } + + public override string ToString() + { + return this.Name; + } + } + + + + public class DepartmentResponse + { + public string Id { get; set; } + + public string Name { get; set; } + + public IList ShopList { get; set; } + } +} diff --git a/QYMessageCenter.Client/Models/Shop/PurchaseAccount.cs b/QYMessageCenter.Client/Models/Shop/PurchaseAccount.cs new file mode 100644 index 0000000..0f00f04 --- /dev/null +++ b/QYMessageCenter.Client/Models/Shop/PurchaseAccount.cs @@ -0,0 +1,20 @@ +namespace QYMessageCenter.Client.Models +{ + public class PurchaseAccount :ICloneable + { + + public long Id { get; set; } + + public long ShopId { get; set; } + public string AccountName { get; set; } + public Platform PurchasePlatformId { get; set; } + public string AppKey { get; set; } + public string AppSecret { get; set; } + public string AppToken { get; set; } + + public object Clone() + { + return this.MemberwiseClone(); + } + } +} diff --git a/QYMessageCenter.Client/Models/Shop/PurchaseAccountResponse.cs b/QYMessageCenter.Client/Models/Shop/PurchaseAccountResponse.cs new file mode 100644 index 0000000..02e9e3e --- /dev/null +++ b/QYMessageCenter.Client/Models/Shop/PurchaseAccountResponse.cs @@ -0,0 +1,21 @@ +using QYMessageCenter.Client.Models; + +namespace QYMessageCenter.Client.Models +{ + public class PurchaseAccountResponse + { + public long Id { get; set; } + + public string AccountName { get; set; } + + public long ShopId { get; set; } + + public Platform PurchasePlatformId { get; set; } + + public string AppKey { get; set; } + + public string AppSecret { get; set; } + + public string AppToken { get; set; } + } +} diff --git a/QYMessageCenter.Client/Models/Shop/Shop.cs b/QYMessageCenter.Client/Models/Shop/Shop.cs new file mode 100644 index 0000000..0aa9787 --- /dev/null +++ b/QYMessageCenter.Client/Models/Shop/Shop.cs @@ -0,0 +1,129 @@ +namespace QYMessageCenter.Client.Models +{ + public class Shop + { + private string shopName; + /// + /// 店铺Id + /// + public long ShopId { get; set; } + + /// + /// 商家类型 + /// + public string VenderType { get; set; } + + /// + /// 店铺平台 + /// + public Platform Platform { get; set; } + + public string AppKey { get; set; } + + public string AppSecret { get; set; } + + public string AppToken { get; set; } + + public string AppKey2 { get; set; } + + public string AppSecret2 { get; set; } + + public string AppToken2 { get; set; } + + public string ShopName { get; set; } + + public IList PurchaseAccountList { get; set; } + + public string ManagePwd { get; set; } + /// + /// 店铺扣点 + /// + public decimal? PlatformCommissionRatio { get; set; } + + public string TeamId { get; set; } + + public string TeamName { get; set; } + + public string DingDingWebHook { get; set; } + + public string DingDingKey { get; set; } + + public int SkuSafeTurnoverDays { get; set; } + + /// + /// 司南策略等级 + /// + public int SiNanPolicyLevel { get; set; } + + /// + /// 司南钉钉WebHook地址 + /// + public string SiNanDingDingWebHook { get; set; } + + /// + /// 司南钉钉密钥 + /// + public string SiNanDingDingKey { get; set; } + + public override string ToString() + { + return ShopName; + } + } + + public class ShopResponse + { + public string Id { get; set; } + + public Platform PlatformId { get; set; } + + public long? ShopId { get; set; } + + public string ShopName { get; set; } + + public string ShopType { get; set; } + + public string AppKey { get; set; } + + public string AppSecret { get; set; } + + public string AppToken { get; set; } + + public string AppKey2 { get; set; } + + public string AppSecret2 { get; set; } + + public string AppToken2 { get; set; } + + public IList PurchaseList { get; set; } + + public string ManagePwd { get; set; } + + public decimal? PlatformCommissionRatio { get; set; } + + public string TeamId { get; set; } + + public string TeamName { get; set; } + + public string DingDingWebHook { get; set; } + + public string DingDingKey { get; set; } + + public int SkuSafeTurnoverDays { get; set; } + + /// + /// 司南策略等级 + /// + public int SiNanPolicyLevel { get; set; } + + /// + /// 司南钉钉WebHook地址 + /// + public string SiNanDingDingWebHook { get; set; } + + /// + /// 司南钉钉密钥 + /// + public string SiNanDingDingKey { get; set; } + } +} diff --git a/QYMessageCenter.Client/Models/User/MDSUserResponse.cs b/QYMessageCenter.Client/Models/User/MDSUserResponse.cs new file mode 100644 index 0000000..80af946 --- /dev/null +++ b/QYMessageCenter.Client/Models/User/MDSUserResponse.cs @@ -0,0 +1,22 @@ +namespace QYMessageCenter.Client.Models +{ + public class MDSUserResponse + { + public long Id { get; set; } + public string DepartmentName { get; set; } + public string DepartmentId { get; set; } + + public string UserName { get; set; } + + public string UserNick { get; set; } + + public IList SonDepartmentList { get; set; } + } + + public class DepartmentResponse2 + { + public string DepartmentId { get; set; } + + public string DepartmentName { get; set; } + } +} diff --git a/QYMessageCenter.Client/Models/User/User.cs b/QYMessageCenter.Client/Models/User/User.cs new file mode 100644 index 0000000..ef82aad --- /dev/null +++ b/QYMessageCenter.Client/Models/User/User.cs @@ -0,0 +1,31 @@ +namespace QYMessageCenter.Client.Models +{ + public class User + { + //private string name; + + private Shop shop; + + public long Id { get; set; } + + public string Name { get; set; } + + public string TeamId { get; set; } + + public string TeamName { get; set; } + + public string SonDepartmentNames { get; set; } + + public Shop Shop { get; set; } + + public IList DepartmentList { get; set; } + + /// + /// 店铺列表 + /// + public IList ShopList { get; set; } + + public string Token { get; set; } + + } +} diff --git a/QYMessageCenter.Client/QYMessageCenter.Client.csproj b/QYMessageCenter.Client/QYMessageCenter.Client.csproj new file mode 100644 index 0000000..8f44ee7 --- /dev/null +++ b/QYMessageCenter.Client/QYMessageCenter.Client.csproj @@ -0,0 +1,29 @@ + + + + WinExe + net6.0-windows + enable + enable + true + + + + + + + + + PreserveNewest + + + + + + + + + + + + diff --git a/QYMessageCenter.Client/static/index.html b/QYMessageCenter.Client/static/index.html new file mode 100644 index 0000000..ae56869 --- /dev/null +++ b/QYMessageCenter.Client/static/index.html @@ -0,0 +1,53 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/QYMessageCenter.Model/DB/QYNotification.cs b/QYMessageCenter.Model/DB/QYNotification.cs index a1ba6f1..88c488b 100644 --- a/QYMessageCenter.Model/DB/QYNotification.cs +++ b/QYMessageCenter.Model/DB/QYNotification.cs @@ -37,7 +37,7 @@ namespace QYMessageCenter.Model.DB /// /// 消息内容 /// - [Column(StringLength = 500)] + [Column(StringLength = 2800)] public string Content { get; set; } [Column(DbType = "datetime")] diff --git a/QYMessageCenter.sln b/QYMessageCenter.sln index 82b4c27..ef4ae38 100644 --- a/QYMessageCenter.sln +++ b/QYMessageCenter.sln @@ -5,11 +5,17 @@ VisualStudioVersion = 17.8.34330.188 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QYMessageCenter", "QYMessageCenter\QYMessageCenter.csproj", "{2EA5C5B7-A4AD-4841-9CBD-3D1039ED1355}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QYMessageCenter.Business", "QYMessageCenter.Business\QYMessageCenter.Business.csproj", "{17CB9C4E-4008-4E5A-98B2-40B666922CE1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QYMessageCenter.Business", "QYMessageCenter.Business\QYMessageCenter.Business.csproj", "{17CB9C4E-4008-4E5A-98B2-40B666922CE1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QYMessageCenter.Model", "QYMessageCenter.Model\QYMessageCenter.Model.csproj", "{91F9B6F7-EB22-42AE-80A9-0FF427B055A6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QYMessageCenter.Model", "QYMessageCenter.Model\QYMessageCenter.Model.csproj", "{91F9B6F7-EB22-42AE-80A9-0FF427B055A6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QYMessageCenter.Common", "QYMessageCenter.Common\QYMessageCenter.Common.csproj", "{3414DE6F-7D25-4A09-892E-3A359101EB44}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QYMessageCenter.Common", "QYMessageCenter.Common\QYMessageCenter.Common.csproj", "{3414DE6F-7D25-4A09-892E-3A359101EB44}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Server", "Server", "{F23D8876-9ED2-4EC1-9856-0E6AC3E58072}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Client", "Client", "{DFE55D4D-6A43-4158-AB78-7B36D0DB351B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QYMessageCenter.Client", "QYMessageCenter.Client\QYMessageCenter.Client.csproj", "{D5998DAB-6517-42EB-A604-BF88C189F1B4}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -33,10 +39,20 @@ Global {3414DE6F-7D25-4A09-892E-3A359101EB44}.Debug|Any CPU.Build.0 = Debug|Any CPU {3414DE6F-7D25-4A09-892E-3A359101EB44}.Release|Any CPU.ActiveCfg = Release|Any CPU {3414DE6F-7D25-4A09-892E-3A359101EB44}.Release|Any CPU.Build.0 = Release|Any CPU + {D5998DAB-6517-42EB-A604-BF88C189F1B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D5998DAB-6517-42EB-A604-BF88C189F1B4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D5998DAB-6517-42EB-A604-BF88C189F1B4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D5998DAB-6517-42EB-A604-BF88C189F1B4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {2EA5C5B7-A4AD-4841-9CBD-3D1039ED1355} = {F23D8876-9ED2-4EC1-9856-0E6AC3E58072} + {17CB9C4E-4008-4E5A-98B2-40B666922CE1} = {F23D8876-9ED2-4EC1-9856-0E6AC3E58072} + {91F9B6F7-EB22-42AE-80A9-0FF427B055A6} = {F23D8876-9ED2-4EC1-9856-0E6AC3E58072} + {D5998DAB-6517-42EB-A604-BF88C189F1B4} = {DFE55D4D-6A43-4158-AB78-7B36D0DB351B} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {F8628884-5171-4D3A-9A40-9C788CBA7EEB} EndGlobalSection diff --git a/QYMessageCenter/QYMessageCenter.API.csproj b/QYMessageCenter/QYMessageCenter.API.csproj new file mode 100644 index 0000000..543baff --- /dev/null +++ b/QYMessageCenter/QYMessageCenter.API.csproj @@ -0,0 +1,36 @@ + + + + net6.0 + enable + enable + True + + + + + + + + + PreserveNewest + + + + + + + + + + + + + + + + + + + +