This commit is contained in:
Abbh1 2023-11-14 16:17:23 +08:00
parent 18f20e0a34
commit 862ff52b01
12 changed files with 352 additions and 24 deletions

View File

@ -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
{
/// <summary>
/// 表情包查询对象Api
///
/// @author lwh
/// @date 2023-10-29
/// </summary>
public class EmoticonDataQueryDtoApi : PagerInfo
{
public long EmoticonCategoryGuid { get; set; }
public string EmoticonDataName { get; set; }
public bool IsLastUpdate { get; set; } = false;
}
/// <summary>
/// 表情包详情输入对象Api
///
/// @author lwh
/// @date 2023-10-29
/// </summary>
public class EmoticonDataDtoApi
{
[Required(ErrorMessage = "EmoticonDataGuid不能为空")]
public long EmoticonDataGuid { get; set; }
}
}

View File

@ -0,0 +1,86 @@
using Newtonsoft.Json;
using OfficeOpenXml.Attributes;
using SqlSugar;
using System;
namespace ARW.Model.Vo.Api.EmotionManage.EmoticonDatas
{
/// <summary>
/// 表情包展示对象Api
///
/// @author lwh
/// @date 2023-10-29
/// </summary>
public class EmoticonDataVoApi
{
/// <summary>
/// 描述 :
/// </summary>
[EpplusIgnore]
public int EmoticonDataId { get; set; }
/// <summary>
/// 描述 :
/// </summary>
[JsonConverter(typeof(ValueToStringConverter))]
[EpplusIgnore]
public long EmoticonDataGuid { get; set; }
/// <summary>
/// 描述 :分类guid
/// </summary>
[JsonConverter(typeof(ValueToStringConverter))]
[EpplusTableColumn(Header = "分类guid")]
public long EmoticonCategoryGuid { get; set; }
/// <summary>
/// 描述 :名称
/// </summary>
[EpplusIgnore]
public string EmoticonDataName { get; set; }
/// <summary>
/// 描述 :图片
/// </summary>
[EpplusTableColumn(Header = "图片")]
public string EmoticonDataImg { get; set; }
/// <summary>
/// 描述 :排序
/// </summary>
[EpplusTableColumn(Header = "排序")]
public int EmoticonDataSort { get; set; }
}
/// <summary>
/// 表情包详情展示对象Api
/// </summary>
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; }
}
}

View File

@ -13,7 +13,7 @@ namespace ARW.Model.Vo.Api.EmotionManage.EmotionCategorys
/// @author lwh
/// @date 2023-10-29
/// </summary>
public class EmotionCategoryListVoApi
public class EmotionCategoryListApiVo
{
/// <summary>
@ -24,7 +24,8 @@ namespace ARW.Model.Vo.Api.EmotionManage.EmotionCategorys
/// <summary>
/// 描述 :
/// </summary>
public int Key { get; set; }
[JsonConverter(typeof(ValueToStringConverter))]
public long Key { get; set; }
}

View File

@ -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
{
/// <summary>
/// 热门表情包分类展示对象Api
///
/// @author lwh
/// @date 2023-10-29
/// </summary>
public class EmotionHotCategoryListVoApi
{
/// <summary>
/// 描述 :
/// </summary>
[EpplusIgnore]
public int EmotionCategoryId { get; set; }
/// <summary>
/// 描述 :名称
/// </summary>
[EpplusTableColumn(Header = "名称")]
public string EmotionCategoryName { get; set; }
/// <summary>
/// 描述 :图片
/// </summary>
[EpplusIgnore]
public string EmotionCategoryImg { get; set; }
}
}

View File

@ -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
{
/// <summary>
/// 表情包接口实现类Api
///
/// @author lwh
/// @date 2023-10-29
/// </summary>
[AppService(ServiceType = typeof(IEmoticonDataServiceApi), ServiceLifetime = LifeTime.Transient)]
public class EmoticonDataServiceImplApi : BaseService<EmoticonData>, IEmoticonDataServiceApi
{
private readonly EmoticonDataRepository _EmoticonDataRepository;
public EmoticonDataServiceImplApi(EmoticonDataRepository EmoticonDataRepository)
{
this._EmoticonDataRepository = EmoticonDataRepository;
}
#region Api接口代码
/// <summary>
/// 查询表情包列表(Api)
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
public async Task<PagedInfo<EmoticonDataVoApi>> GetEmoticonDataListApi(EmoticonDataQueryDtoApi parm)
{
//开始拼装查询条件d
var predicate = Expressionable.Create<EmoticonData>();
predicate = predicate.AndIF(parm.EmoticonCategoryGuid != 0, s => s.EmoticonCategoryGuid == parm.EmoticonCategoryGuid);
var query = _EmoticonDataRepository
.Queryable()
.LeftJoin<EmotionCategory>((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
}
}

View File

@ -41,7 +41,7 @@ namespace ARW.Service.Api.BusinessService.EmotionManage.EmotionCategorys
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
public async Task<List<EmotionCategoryListVoApi>> GetHotEmotionCategoryListApi(EmotionCategoryQueryDtoApi parm)
public async Task<List<EmotionHotCategoryListVoApi>> GetHotEmotionCategoryListApi(EmotionCategoryQueryDtoApi parm)
{
//开始拼装查询条件d
var predicate = Expressionable.Create<EmotionCategory>();
@ -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
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
public async Task<List<EmotionCategoryListVoApi>> GetEmotionCategoryListApi(EmotionCategoryQueryDtoApi parm)
public async Task<List<EmotionCategoryListApiVo>> GetEmotionCategoryListApi(EmotionCategoryQueryDtoApi parm)
{
//开始拼装查询条件d
var predicate = Expressionable.Create<EmotionCategory>();
@ -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,
});

View File

@ -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
{
/// <summary>
/// 表情包接口类Api
///
/// @author lwh
/// @date 2023-10-29
/// </summary>
public interface IEmoticonDataServiceApi : IBaseService<EmoticonData>
{
/// <summary>
/// 获取表情包分页列表(Api)
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
Task<PagedInfo<EmoticonDataVoApi>> GetEmoticonDataListApi(EmoticonDataQueryDtoApi parm);
}
}

View File

@ -24,14 +24,14 @@ namespace ARW.Service.Api.IBusinessService.EmotionManage.EmotionCategorys
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
Task<List<EmotionCategoryListVoApi>> GetHotEmotionCategoryListApi(EmotionCategoryQueryDtoApi parm);
Task<List<EmotionHotCategoryListVoApi>> GetHotEmotionCategoryListApi(EmotionCategoryQueryDtoApi parm);
/// <summary>
/// 获取表情包分类列表(Api)
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
Task<List<EmotionCategoryListVoApi>> GetEmotionCategoryListApi(EmotionCategoryQueryDtoApi parm);
Task<List<EmotionCategoryListApiVo>> GetEmotionCategoryListApi(EmotionCategoryQueryDtoApi parm);
/// <summary>
/// 获取表情包分类树形列表(Api)

View File

@ -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
{
/// <summary>
/// 表情包控制器Api
///
/// @author lwh
/// @date 2023-10-29
/// </summary>
//[Verify]
[Route("api/[controller]")]
public class EmoticonDataApiController : BaseController
{
private readonly IEmoticonDataServiceApi _EmoticonDataServiceApi;
/// <summary>
/// 依赖注入
/// </summary>
/// <param name="EmoticonDataServiceApi">表情包表情包Api服务</param>
public EmoticonDataApiController(IEmoticonDataServiceApi EmoticonDataServiceApi)
{
_EmoticonDataServiceApi = EmoticonDataServiceApi;
}
/// <summary>
/// 获取表情包列表(Api)
/// </summary>
/// <param name="parm">查询参数</param>
/// <returns></returns>
[HttpGet("getEmoticonDataList")]
public async Task<IActionResult> GetEmoticonDataListApi([FromQuery] EmoticonDataQueryDtoApi parm)
{
var res = await _EmoticonDataServiceApi.GetEmoticonDataListApi(parm);
return SUCCESS(res);
}
}
}

View File

@ -24,7 +24,7 @@ namespace ARW.WebApi.Controllers.Api.EmotionManage.EmotionCategorys
/// @author lwh
/// @date 2023-10-29
/// </summary>
[Verify]
//[Verify]
[Route("api/[controller]")]
public class EmotionCategoryApiController : BaseController
{

View File

@ -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<WeChatLogin>(new WeChatLogin("wx8b03fffabbbfe804", "233a99954667ccfd6697dd3d31743fde"));
builder.Services.AddSingleton<WeChatLogin>(new WeChatLogin("wxcdeaf70fb4239637", "38cd5c14af77f86d505437e706633bee"));
//配置跨域
builder.Services.AddCors(c =>

View File

@ -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