From 862ff52b0155b76abbd27c2c17a055a29d999f43 Mon Sep 17 00:00:00 2001 From: Abbh1 <86962549+Abbh1@users.noreply.github.com> Date: Tue, 14 Nov 2023 16:17:23 +0800 Subject: [PATCH] init --- .../EmoticonDatas/EmoticonDataApiDto.cs | 36 ++++++++ .../EmoticonDatas/EmoticonDataApiVo.cs | 86 +++++++++++++++++++ .../EmotionCategoryListApiVo.cs | 5 +- .../EmotionHotCategoryListVoApi.cs | 42 +++++++++ .../EmoticonDatas/EmoticonDataServiceApi.cs | 76 ++++++++++++++++ .../EmotionCategoryServiceApi.cs | 17 ++-- .../EmoticonDatas/IEmoticonDataServiceApi.cs | 30 +++++++ .../IEmotionCategoryServiceApi.cs | 4 +- .../EmoticonDataApiController.cs | 56 ++++++++++++ .../EmotionCategoryApiController.cs | 2 +- ARW.WebApi/Program.cs | 6 +- ARW.WebApi/appsettings.json | 16 ++-- 12 files changed, 352 insertions(+), 24 deletions(-) create mode 100644 ARW.Model/Dto/Api/EmotionManage/EmoticonDatas/EmoticonDataApiDto.cs create mode 100644 ARW.Model/Vo/Api/EmotionManage/EmoticonDatas/EmoticonDataApiVo.cs create mode 100644 ARW.Model/Vo/Api/EmotionManage/EmotionCategorys/EmotionHotCategoryListVoApi.cs create mode 100644 ARW.Service/Api/BusinessService/EmotionManage/EmoticonDatas/EmoticonDataServiceApi.cs create mode 100644 ARW.Service/Api/IBusinessService/EmotionManage/EmoticonDatas/IEmoticonDataServiceApi.cs create mode 100644 ARW.WebApi/Controllers/Api/EmotionManage/EmoticonDatas/EmoticonDataApiController.cs diff --git a/ARW.Model/Dto/Api/EmotionManage/EmoticonDatas/EmoticonDataApiDto.cs b/ARW.Model/Dto/Api/EmotionManage/EmoticonDatas/EmoticonDataApiDto.cs new file mode 100644 index 0000000..4126b1a --- /dev/null +++ b/ARW.Model/Dto/Api/EmotionManage/EmoticonDatas/EmoticonDataApiDto.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using ARW.Model.Models.Business.EmotionManage.EmoticonDatas; + +namespace ARW.Model.Dto.Api.EmotionManage.EmoticonDatas +{ + + /// + /// 表情包查询对象Api + /// + /// @author lwh + /// @date 2023-10-29 + /// + public class EmoticonDataQueryDtoApi : PagerInfo + { + public long EmoticonCategoryGuid { get; set; } + public string EmoticonDataName { get; set; } + + public bool IsLastUpdate { get; set; } = false; + } + + + /// + /// 表情包详情输入对象Api + /// + /// @author lwh + /// @date 2023-10-29 + /// + public class EmoticonDataDtoApi + { + [Required(ErrorMessage = "EmoticonDataGuid不能为空")] + public long EmoticonDataGuid { get; set; } + } + +} diff --git a/ARW.Model/Vo/Api/EmotionManage/EmoticonDatas/EmoticonDataApiVo.cs b/ARW.Model/Vo/Api/EmotionManage/EmoticonDatas/EmoticonDataApiVo.cs new file mode 100644 index 0000000..0392b9d --- /dev/null +++ b/ARW.Model/Vo/Api/EmotionManage/EmoticonDatas/EmoticonDataApiVo.cs @@ -0,0 +1,86 @@ +using Newtonsoft.Json; +using OfficeOpenXml.Attributes; +using SqlSugar; +using System; + +namespace ARW.Model.Vo.Api.EmotionManage.EmoticonDatas +{ + /// + /// 表情包展示对象Api + /// + /// @author lwh + /// @date 2023-10-29 + /// + public class EmoticonDataVoApi + { + + + /// + /// 描述 : + /// + [EpplusIgnore] + public int EmoticonDataId { get; set; } + + + /// + /// 描述 : + /// + [JsonConverter(typeof(ValueToStringConverter))] + [EpplusIgnore] + public long EmoticonDataGuid { get; set; } + + + /// + /// 描述 :分类guid + /// + [JsonConverter(typeof(ValueToStringConverter))] + [EpplusTableColumn(Header = "分类guid")] + public long EmoticonCategoryGuid { get; set; } + + + /// + /// 描述 :名称 + /// + [EpplusIgnore] + public string EmoticonDataName { get; set; } + + + /// + /// 描述 :图片 + /// + [EpplusTableColumn(Header = "图片")] + public string EmoticonDataImg { get; set; } + + + /// + /// 描述 :排序 + /// + [EpplusTableColumn(Header = "排序")] + public int EmoticonDataSort { get; set; } + + } + + + /// + /// 表情包详情展示对象Api + /// + public class EmoticonDataApiDetailsVo + { + [EpplusIgnore] + public int EmoticonDataId { get; set; } + [JsonConverter(typeof(ValueToStringConverter))] + [EpplusIgnore] + public long EmoticonDataGuid { get; set; } + [JsonConverter(typeof(ValueToStringConverter))] + [EpplusTableColumn(Header = "分类guid")] + public long EmoticonCategoryGuid { get; set; } + [EpplusIgnore] + public string EmoticonDataName { get; set; } + [EpplusTableColumn(Header = "图片")] + public string EmoticonDataImg { get; set; } + [EpplusTableColumn(Header = "排序")] + public int EmoticonDataSort { get; set; } + + } + +} diff --git a/ARW.Model/Vo/Api/EmotionManage/EmotionCategorys/EmotionCategoryListApiVo.cs b/ARW.Model/Vo/Api/EmotionManage/EmotionCategorys/EmotionCategoryListApiVo.cs index 47f17a0..a3d066e 100644 --- a/ARW.Model/Vo/Api/EmotionManage/EmotionCategorys/EmotionCategoryListApiVo.cs +++ b/ARW.Model/Vo/Api/EmotionManage/EmotionCategorys/EmotionCategoryListApiVo.cs @@ -13,7 +13,7 @@ namespace ARW.Model.Vo.Api.EmotionManage.EmotionCategorys /// @author lwh /// @date 2023-10-29 /// - public class EmotionCategoryListVoApi + public class EmotionCategoryListApiVo { /// @@ -24,7 +24,8 @@ namespace ARW.Model.Vo.Api.EmotionManage.EmotionCategorys /// /// 描述 : /// - public int Key { get; set; } + [JsonConverter(typeof(ValueToStringConverter))] + public long Key { get; set; } } diff --git a/ARW.Model/Vo/Api/EmotionManage/EmotionCategorys/EmotionHotCategoryListVoApi.cs b/ARW.Model/Vo/Api/EmotionManage/EmotionCategorys/EmotionHotCategoryListVoApi.cs new file mode 100644 index 0000000..a4951ce --- /dev/null +++ b/ARW.Model/Vo/Api/EmotionManage/EmotionCategorys/EmotionHotCategoryListVoApi.cs @@ -0,0 +1,42 @@ +using Newtonsoft.Json; +using OfficeOpenXml.Attributes; +using SqlSugar; +using System; +using ARW.Model.Models.Business.EmotionManage.EmotionCategorys; +using System.Collections.Generic; + +namespace ARW.Model.Vo.Api.EmotionManage.EmotionCategorys +{ + /// + /// 热门表情包分类展示对象Api + /// + /// @author lwh + /// @date 2023-10-29 + /// + public class EmotionHotCategoryListVoApi + { + + /// + /// 描述 : + /// + [EpplusIgnore] + public int EmotionCategoryId { get; set; } + + + /// + /// 描述 :名称 + /// + [EpplusTableColumn(Header = "名称")] + public string EmotionCategoryName { get; set; } + + + /// + /// 描述 :图片 + /// + [EpplusIgnore] + public string EmotionCategoryImg { get; set; } + + + } + +} diff --git a/ARW.Service/Api/BusinessService/EmotionManage/EmoticonDatas/EmoticonDataServiceApi.cs b/ARW.Service/Api/BusinessService/EmotionManage/EmoticonDatas/EmoticonDataServiceApi.cs new file mode 100644 index 0000000..8280273 --- /dev/null +++ b/ARW.Service/Api/BusinessService/EmotionManage/EmoticonDatas/EmoticonDataServiceApi.cs @@ -0,0 +1,76 @@ +using Infrastructure.Attribute; +using Microsoft.AspNetCore.Http; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ARW.Model; +using ARW.Repository; +using ARW.Repository.Business.EmotionManage.EmoticonDatas; +using ARW.Service.Api.IBusinessService.EmotionManage.EmoticonDatas; +using ARW.Model.Dto.Api.EmotionManage.EmoticonDatas; +using ARW.Model.Models.Business.EmotionManage.EmoticonDatas; +using ARW.Model.Vo.Api.EmotionManage.EmoticonDatas; +using ARW.Model.Models.Business.EmotionManage.EmotionCategorys; + +namespace ARW.Service.Api.BusinessService.EmotionManage.EmoticonDatas +{ + /// + /// 表情包接口实现类Api + /// + /// @author lwh + /// @date 2023-10-29 + /// + [AppService(ServiceType = typeof(IEmoticonDataServiceApi), ServiceLifetime = LifeTime.Transient)] + public class EmoticonDataServiceImplApi : BaseService, IEmoticonDataServiceApi + { + private readonly EmoticonDataRepository _EmoticonDataRepository; + + public EmoticonDataServiceImplApi(EmoticonDataRepository EmoticonDataRepository) + { + this._EmoticonDataRepository = EmoticonDataRepository; + } + + #region Api接口代码 + + + /// + /// 查询表情包列表(Api) + /// + /// + /// + public async Task> GetEmoticonDataListApi(EmoticonDataQueryDtoApi parm) + { + //开始拼装查询条件d + var predicate = Expressionable.Create(); + + predicate = predicate.AndIF(parm.EmoticonCategoryGuid != 0, s => s.EmoticonCategoryGuid == parm.EmoticonCategoryGuid); + var query = _EmoticonDataRepository + .Queryable() + .LeftJoin((s,c) => s.EmoticonCategoryGuid == c.EmotionCategoryGuid) + .WhereIF(!string.IsNullOrEmpty(parm.EmoticonDataName), (s,c) => s.EmoticonDataName.Contains(parm.EmoticonDataName) || c.EmotionCategoryName.Contains(parm.EmoticonDataName)) + .Where(predicate.ToExpression()) + .OrderByIF(parm.IsLastUpdate == false, s => s.EmoticonDataSort, OrderByType.Asc) + .OrderByIF(parm.IsLastUpdate == true, s => s.Create_time, OrderByType.Desc) + .Select(s => new EmoticonDataVoApi + { + EmoticonDataId = s.EmoticonDataId, + EmoticonDataGuid = s.EmoticonDataGuid, + EmoticonCategoryGuid = s.EmoticonCategoryGuid, + EmoticonDataName = s.EmoticonDataName, + EmoticonDataImg = s.EmoticonDataImg, + EmoticonDataSort = s.EmoticonDataSort, + }); + + + return await query.ToPageAsync(parm); + } + + + + #endregion + + } +} diff --git a/ARW.Service/Api/BusinessService/EmotionManage/EmotionCategorys/EmotionCategoryServiceApi.cs b/ARW.Service/Api/BusinessService/EmotionManage/EmotionCategorys/EmotionCategoryServiceApi.cs index 6706327..b8d1bcc 100644 --- a/ARW.Service/Api/BusinessService/EmotionManage/EmotionCategorys/EmotionCategoryServiceApi.cs +++ b/ARW.Service/Api/BusinessService/EmotionManage/EmotionCategorys/EmotionCategoryServiceApi.cs @@ -41,7 +41,7 @@ namespace ARW.Service.Api.BusinessService.EmotionManage.EmotionCategorys /// /// /// - public async Task> GetHotEmotionCategoryListApi(EmotionCategoryQueryDtoApi parm) + public async Task> GetHotEmotionCategoryListApi(EmotionCategoryQueryDtoApi parm) { //开始拼装查询条件d var predicate = Expressionable.Create(); @@ -52,11 +52,12 @@ namespace ARW.Service.Api.BusinessService.EmotionManage.EmotionCategorys .Where(predicate.ToExpression()) .Where(s => s.IsPopular == 1) .OrderBy(s => s.EmotionCategorySort, OrderByType.Asc) - .Select(s => new EmotionCategoryListVoApi + .Select(s => new EmotionHotCategoryListVoApi { - Key = s.EmotionCategoryId, - Text = s.EmotionCategoryName, - }); + EmotionCategoryId = s.EmotionCategoryId, + EmotionCategoryName = s.EmotionCategoryName, + EmotionCategoryImg = s.EmotionCategoryImg, + }).Take(8); return await query.ToListAsync(); } @@ -68,7 +69,7 @@ namespace ARW.Service.Api.BusinessService.EmotionManage.EmotionCategorys /// /// /// - public async Task> GetEmotionCategoryListApi(EmotionCategoryQueryDtoApi parm) + public async Task> GetEmotionCategoryListApi(EmotionCategoryQueryDtoApi parm) { //开始拼装查询条件d var predicate = Expressionable.Create(); @@ -78,9 +79,9 @@ namespace ARW.Service.Api.BusinessService.EmotionManage.EmotionCategorys .Queryable() .Where(predicate.ToExpression()) .OrderBy(s => s.EmotionCategorySort, OrderByType.Asc) - .Select(s => new EmotionCategoryListVoApi + .Select(s => new EmotionCategoryListApiVo { - Key = s.EmotionCategoryId, + Key = s.EmotionCategoryGuid, Text = s.EmotionCategoryName, }); diff --git a/ARW.Service/Api/IBusinessService/EmotionManage/EmoticonDatas/IEmoticonDataServiceApi.cs b/ARW.Service/Api/IBusinessService/EmotionManage/EmoticonDatas/IEmoticonDataServiceApi.cs new file mode 100644 index 0000000..3334de7 --- /dev/null +++ b/ARW.Service/Api/IBusinessService/EmotionManage/EmoticonDatas/IEmoticonDataServiceApi.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ARW.Model; +using ARW.Model.Dto.Api.EmotionManage.EmoticonDatas; +using ARW.Model.Models.Business.EmotionManage.EmoticonDatas; +using ARW.Model.Vo.Api.EmotionManage.EmoticonDatas; + +namespace ARW.Service.Api.IBusinessService.EmotionManage.EmoticonDatas +{ + /// + /// 表情包接口类Api + /// + /// @author lwh + /// @date 2023-10-29 + /// + public interface IEmoticonDataServiceApi : IBaseService + { + /// + /// 获取表情包分页列表(Api) + /// + /// + /// + Task> GetEmoticonDataListApi(EmoticonDataQueryDtoApi parm); + + + } +} diff --git a/ARW.Service/Api/IBusinessService/EmotionManage/EmotionCategorys/IEmotionCategoryServiceApi.cs b/ARW.Service/Api/IBusinessService/EmotionManage/EmotionCategorys/IEmotionCategoryServiceApi.cs index bed7c65..a185528 100644 --- a/ARW.Service/Api/IBusinessService/EmotionManage/EmotionCategorys/IEmotionCategoryServiceApi.cs +++ b/ARW.Service/Api/IBusinessService/EmotionManage/EmotionCategorys/IEmotionCategoryServiceApi.cs @@ -24,14 +24,14 @@ namespace ARW.Service.Api.IBusinessService.EmotionManage.EmotionCategorys /// /// /// - Task> GetHotEmotionCategoryListApi(EmotionCategoryQueryDtoApi parm); + Task> GetHotEmotionCategoryListApi(EmotionCategoryQueryDtoApi parm); /// /// 获取表情包分类列表(Api) /// /// /// - Task> GetEmotionCategoryListApi(EmotionCategoryQueryDtoApi parm); + Task> GetEmotionCategoryListApi(EmotionCategoryQueryDtoApi parm); /// /// 获取表情包分类树形列表(Api) diff --git a/ARW.WebApi/Controllers/Api/EmotionManage/EmoticonDatas/EmoticonDataApiController.cs b/ARW.WebApi/Controllers/Api/EmotionManage/EmoticonDatas/EmoticonDataApiController.cs new file mode 100644 index 0000000..b03b7b4 --- /dev/null +++ b/ARW.WebApi/Controllers/Api/EmotionManage/EmoticonDatas/EmoticonDataApiController.cs @@ -0,0 +1,56 @@ +using Infrastructure; +using Infrastructure.Attribute; +using Infrastructure.Enums; +using Infrastructure.Model; +using Mapster; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using ARW.Admin.WebApi.Extensions; +using ARW.Admin.WebApi.Filters; +using ARW.Common; +using ARW.Admin.WebApi.Controllers; +using ARW.Model.Dto.Api.EmotionManage.EmoticonDatas; +using ARW.Service.Api.IBusinessService.EmotionManage.EmoticonDatas; +using ARW.Model.Models.Business.EmotionManage.EmoticonDatas; +using ARW.Model.Vo.Api.EmotionManage.EmoticonDatas; +using Microsoft.AspNetCore.Authorization; +using Geocoding; + +namespace ARW.WebApi.Controllers.Api.EmotionManage.EmoticonDatas +{ + /// + /// 表情包控制器Api + /// + /// @author lwh + /// @date 2023-10-29 + /// + //[Verify] + [Route("api/[controller]")] + public class EmoticonDataApiController : BaseController + { + private readonly IEmoticonDataServiceApi _EmoticonDataServiceApi; + + /// + /// 依赖注入 + /// + /// 表情包表情包Api服务 + public EmoticonDataApiController(IEmoticonDataServiceApi EmoticonDataServiceApi) + { + _EmoticonDataServiceApi = EmoticonDataServiceApi; + } + + + /// + /// 获取表情包列表(Api) + /// + /// 查询参数 + /// + [HttpGet("getEmoticonDataList")] + public async Task GetEmoticonDataListApi([FromQuery] EmoticonDataQueryDtoApi parm) + { + var res = await _EmoticonDataServiceApi.GetEmoticonDataListApi(parm); + return SUCCESS(res); + } + + } +} diff --git a/ARW.WebApi/Controllers/Api/EmotionManage/EmotionCategorys/EmotionCategoryApiController.cs b/ARW.WebApi/Controllers/Api/EmotionManage/EmotionCategorys/EmotionCategoryApiController.cs index 3068cbb..38e1c17 100644 --- a/ARW.WebApi/Controllers/Api/EmotionManage/EmotionCategorys/EmotionCategoryApiController.cs +++ b/ARW.WebApi/Controllers/Api/EmotionManage/EmotionCategorys/EmotionCategoryApiController.cs @@ -24,7 +24,7 @@ namespace ARW.WebApi.Controllers.Api.EmotionManage.EmotionCategorys /// @author lwh /// @date 2023-10-29 /// - [Verify] + //[Verify] [Route("api/[controller]")] public class EmotionCategoryApiController : BaseController { diff --git a/ARW.WebApi/Program.cs b/ARW.WebApi/Program.cs index 795f096..ae076f4 100644 --- a/ARW.WebApi/Program.cs +++ b/ARW.WebApi/Program.cs @@ -48,12 +48,12 @@ var senparcWeixinSetting = builder.Services.BuildServiceProvider().GetRequiredSe register.UseSenparcWeixin(senparcWeixinSetting.Value, senparcSetting.Value);//微信全局注册,必须! // 小程序 -await AccessTokenContainer.RegisterAsync("wx8b03fffabbbfe804", "233a99954667ccfd6697dd3d31743fde"); +await AccessTokenContainer.RegisterAsync("wxcdeaf70fb4239637", "38cd5c14af77f86d505437e706633bee"); // 公众号 -await AccessTokenContainer.RegisterAsync("wxa515d1bd73d06294", "9d0ba50302d9ae27916314605b9aa04e"); +await AccessTokenContainer.RegisterAsync("wx69ce4530668e2dee", "e9bb3c94d37f4dd2216850e1ad2f87fb"); // 添加WeChat单例服务 -builder.Services.AddSingleton(new WeChatLogin("wx8b03fffabbbfe804", "233a99954667ccfd6697dd3d31743fde")); +builder.Services.AddSingleton(new WeChatLogin("wxcdeaf70fb4239637", "38cd5c14af77f86d505437e706633bee")); //配置跨域 builder.Services.AddCors(c => diff --git a/ARW.WebApi/appsettings.json b/ARW.WebApi/appsettings.json index 6eca33f..a2902d1 100644 --- a/ARW.WebApi/appsettings.json +++ b/ARW.WebApi/appsettings.json @@ -7,7 +7,7 @@ } }, "ConnectionStrings": { - "conn_db": "server=47.242.159.172;Database=emoticon;Uid=emoticon;Pwd=FBSrBYyPXPXwZkMd;SslMode=none;CharSet=utf8mb4;AllowLoadLocalInfile=true;AllowUserVariables=true;", + "conn_db": "server=39.108.190.52;Database=emoticon;Uid=emoticon;Pwd=FBSrBYyPXPXwZkMd;SslMode=none;CharSet=utf8mb4;AllowLoadLocalInfile=true;AllowUserVariables=true;", //"conn_db": "server=127.0.0.1;Database=shop;Uid=root;Pwd=root;SslMode=none;CharSet=utf8mb4;AllowLoadLocalInfile=true;AllowUserVariables=true;", "conn_db_type": "8" //数据库类型 MySql = 0, SqlServer = 1 }, @@ -41,7 +41,7 @@ "templateCode": "SMS_154950909" }, "gen": { - "conn": "server=47.242.159.172;Database=emoticon;Uid=emoticon;Pwd=FBSrBYyPXPXwZkMd;SslMode=none;CharSet=utf8mb4;AllowLoadLocalInfile=true;AllowUserVariables=true;", + "conn": "server=39.108.190.52;Database=emoticon;Uid=emoticon;Pwd=FBSrBYyPXPXwZkMd;SslMode=none;CharSet=utf8mb4;AllowLoadLocalInfile=true;AllowUserVariables=true;", "dbType": 8, //MySql = 0, SqlServer = 1 "autoPre": true, //自动去除表前缀 "author": "admin", @@ -121,10 +121,10 @@ ] }, "Kuaidi100Setting": { - "key": "QsJHChwz3944", //授权key - "customer": "5279A349F41783B3ECF3140056E76FAB", //customer - "secret": "fcf0f7ae2f484d62be34a402f15cec3d", //secret - "userid": "ff5c88135d414a13aa0c2b21e893fd46", //userid + "key": "", //授权key + "customer": "", //customer + "secret": "", //secret + "userid": "", //userid "siid": "", // 快递100打印机或者云盒设备码(使用电子面单打印接口或云打印相关接口必填) "tid": "" // 短信模板id }, @@ -141,8 +141,8 @@ //公众号 "Token": "", "EncodingAESKey": "", //公众号解密秘钥 - "WeixinAppId": "wxa515d1bd73d06294", //公众号AppId - "WeixinAppSecret": "9d0ba50302d9ae27916314605b9aa04e", //公众号秘钥 + "WeixinAppId": "wx69ce4530668e2dee", //公众号AppId + "WeixinAppSecret": "e9bb3c94d37f4dd2216850e1ad2f87fb", //公众号秘钥 //微信支付V3 "TenPayV3_AppId": "wxcdeaf70fb4239637", // 小程序AppId