This commit is contained in:
cjd
2025-11-04 21:09:16 +08:00
parent 8260e293c7
commit bb90a020dc
592 changed files with 61749 additions and 27 deletions

View File

@@ -0,0 +1,73 @@
using DouyinApi.Model;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace DouyinApi.IServices.BASE
{
public interface IBaseServices<TEntity> where TEntity : class
{
ISqlSugarClient Db { get; }
Task<TEntity> QueryById(object objId);
Task<TEntity> QueryById(object objId, bool blnUseCache = false);
Task<List<TEntity>> QueryByIDs(object[] lstIds);
Task<long> Add(TEntity model);
Task<List<long>> Add(List<TEntity> listEntity);
Task<bool> DeleteById(object id);
Task<bool> Delete(TEntity model);
Task<bool> DeleteByIds(object[] ids);
Task<bool> Update(TEntity model);
Task<bool> Update(List<TEntity> model);
Task<bool> Update(TEntity entity, string where);
Task<bool> Update(object operateAnonymousObjects);
Task<bool> Update(TEntity entity, List<string> lstColumns = null, List<string> lstIgnoreColumns = null, string where = "");
Task<List<TEntity>> Query();
Task<List<TEntity>> Query(string where);
Task<List<TEntity>> Query(Expression<Func<TEntity, bool>> whereExpression);
Task<List<TEntity>> Query(Expression<Func<TEntity, bool>> whereExpression, string orderByFields);
Task<List<TResult>> Query<TResult>(Expression<Func<TEntity, TResult>> expression);
Task<List<TResult>> Query<TResult>(Expression<Func<TEntity, TResult>> expression, Expression<Func<TEntity, bool>> whereExpression, string orderByFields);
Task<List<TEntity>> Query(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, object>> orderByExpression, bool isAsc = true);
Task<List<TEntity>> Query(string where, string orderByFields);
Task<List<TEntity>> QuerySql(string sql, SugarParameter[] parameters = null);
Task<DataTable> QueryTable(string sql, SugarParameter[] parameters = null);
Task<List<TEntity>> Query(Expression<Func<TEntity, bool>> whereExpression, int top, string orderByFields);
Task<List<TEntity>> Query(string where, int top, string orderByFields);
Task<List<TEntity>> Query(
Expression<Func<TEntity, bool>> whereExpression, int pageIndex, int pageSize, string orderByFields);
Task<List<TEntity>> Query(string where, int pageIndex, int pageSize, string orderByFields);
Task<PageModel<TEntity>> QueryPage(Expression<Func<TEntity, bool>> whereExpression, int pageIndex = 1, int pageSize = 20, string orderByFields = null);
Task<List<TResult>> QueryMuch<T, T2, T3, TResult>(
Expression<Func<T, T2, T3, object[]>> joinExpression,
Expression<Func<T, T2, T3, TResult>> selectExpression,
Expression<Func<T, T2, T3, bool>> whereLambda = null) where T : class, new();
Task<PageModel<TEntity>> QueryPage(PaginationModel pagination);
#region
Task<TEntity> QueryByIdSplit(object objId);
Task<List<long>> AddSplit(TEntity entity);
Task<bool> DeleteSplit(TEntity entity, DateTime dateTime);
Task<bool> UpdateSplit(TEntity entity, DateTime dateTime);
Task<PageModel<TEntity>> QueryPageSplit(Expression<Func<TEntity, bool>> whereExpression, DateTime beginTime, DateTime endTime, int pageIndex = 1, int pageSize = 20, string orderByFields = null);
#endregion
}
}

View File

@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<ProjectReference Include="..\DouyinApi.Common\DouyinApi.Common.csproj" />
<ProjectReference Include="..\DouyinApi.Model\DouyinApi.Model.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,14 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model.Models;
namespace DouyinApi.IServices
{
/// <summary>
/// IAccessTrendLogServices
/// </summary>
public interface IAccessTrendLogServices : IBaseServices<AccessTrendLog>
{
}
}

View File

@@ -0,0 +1,16 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model.Models;
namespace DouyinApi.IServices
{
public interface IAdvertisementServices :IBaseServices<Advertisement>
{
//int Sum(int i, int j);
//int Add(Advertisement model);
//bool Delete(Advertisement model);
//bool Update(Advertisement model);
//List<Advertisement> Query(Expression<Func<Advertisement, bool>> whereExpression);
void ReturnExp();
}
}

View File

@@ -0,0 +1,16 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model.Models;
using DouyinApi.Model.ViewModels;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace DouyinApi.IServices
{
public interface IBlogArticleServices :IBaseServices<BlogArticle>
{
Task<List<BlogArticle>> GetBlogs();
Task<BlogViewModels> GetBlogDetails(long id);
}
}

View File

@@ -0,0 +1,11 @@
using System.Threading.Tasks;
using DouyinApi.IServices.BASE;
using DouyinApi.Model.IDS4DbModels;
namespace DouyinApi.IServices
{
public partial interface IApplicationUserServices : IBaseServices<ApplicationUser>
{
bool IsEnable();
}
}

View File

@@ -0,0 +1,12 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model.Models;
namespace DouyinApi.IServices
{
/// <summary>
/// IDepartmentServices
/// </summary>
public interface IDepartmentServices : IBaseServices<Department>
{
}
}

View File

@@ -0,0 +1,21 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model;
using DouyinApi.Model.Models;
using System.Threading.Tasks;
namespace DouyinApi.IServices
{
public partial interface IGuestbookServices : IBaseServices<Guestbook>
{
Task<MessageModel<string>> TestTranInRepository();
Task<bool> TestTranInRepositoryAOP();
Task<bool> TestTranPropagation();
Task<bool> TestTranPropagationNoTran();
Task<bool> TestTranPropagationTran();
Task TestTranPropagationTran2();
Task TestTranPropagationTran3();
}
}

View File

@@ -0,0 +1,14 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model.Models;
namespace DouyinApi.IServices
{
/// <summary>
/// ModuleServices
/// </summary>
public interface IModuleServices :IBaseServices<Modules>
{
}
}

View File

@@ -0,0 +1,14 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model.Models;
namespace DouyinApi.IServices
{
/// <summary>
/// IOperateLogServices
/// </summary>
public interface IOperateLogServices : IBaseServices<OperateLog>
{
}
}

View File

@@ -0,0 +1,14 @@
using System.Threading.Tasks;
using DouyinApi.IServices.BASE;
using DouyinApi.Model.Models;
namespace DouyinApi.IServices
{
public partial interface IPasswordLibServices :IBaseServices<PasswordLib>
{
Task<bool> TestTranPropagation2();
Task<bool> TestTranPropagationNoTranError();
Task<bool> TestTranPropagationTran2();
Task<bool> TestTranPropagationTran3();
}
}

View File

@@ -0,0 +1,42 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model;
using DouyinApi.Model.ViewModels;
using System.Threading.Tasks;
namespace DouyinApi.IServices
{
/// <summary>
/// IPayServices
/// </summary>
public interface IPayServices : IBaseServices<RootEntityTkey<int>>
{
/// <summary>
/// 被扫支付
/// </summary>
/// <returns></returns>
Task<MessageModel<PayReturnResultModel>> Pay(PayNeedModel payModel);
/// <summary>
/// 退款
/// </summary>
/// <param name="payModel"></param>
/// <returns></returns>
Task<MessageModel<PayRefundReturnResultModel>> PayRefund(PayRefundNeedModel payModel);
/// <summary>
/// 轮询查询
/// </summary>
/// <param name="payModel"></param>
/// <param name="times">轮询次数</param>
/// <returns></returns>
Task<MessageModel<PayReturnResultModel>> PayCheck(PayNeedModel payModel,int times);
/// <summary>
/// 验证签名
/// </summary>
/// <param name="strSrc">参数</param>
/// <param name="sign">签名</param>
/// <param name="pubKey">公钥</param>
/// <returns></returns>
bool NotifyCheck(string strSrc, string sign, string pubKey);
}
}

View File

@@ -0,0 +1,8 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model.Models;
namespace DouyinApi.IServices
{
public partial interface IPermissionServices : IBaseServices<Permission>
{
}
}

View File

@@ -0,0 +1,26 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace DouyinApi.IServices
{
/// <summary>
/// RoleModulePermissionServices
/// </summary>
public interface IRoleModulePermissionServices :IBaseServices<RoleModulePermission>
{
Task<List<RoleModulePermission>> GetRoleModule();
Task<List<TestMuchTableResult>> QueryMuchTable();
Task<List<RoleModulePermission>> RoleModuleMaps();
Task<List<RoleModulePermission>> GetRMPMaps();
/// <summary>
/// 批量更新菜单与接口的关系
/// </summary>
/// <param name="permissionId">菜单主键</param>
/// <param name="moduleId">接口主键</param>
/// <returns></returns>
Task UpdateModuleId(long permissionId, long moduleId);
}
}

View File

@@ -0,0 +1,16 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model.Models;
using System.Threading.Tasks;
namespace DouyinApi.IServices
{
/// <summary>
/// RoleServices
/// </summary>
public interface IRoleServices :IBaseServices<Role>
{
Task<Role> SaveRole(string roleName);
Task<string> GetRoleNameByRid(int rid);
}
}

View File

@@ -0,0 +1,15 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model.Models;
using System.Threading.Tasks;
namespace DouyinApi.IServices
{
/// <summary>
/// sysUserInfoServices
/// </summary>
public interface ISplitDemoServices : IBaseServices<SplitDemo>
{
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Threading.Tasks;
using DouyinApi.IServices.BASE;
using DouyinApi.Model;
using DouyinApi.Model.Models;
namespace DouyinApi.IServices
{
/// <summary>
/// ITasksLogServices
/// </summary>
public interface ITasksLogServices :IBaseServices<TasksLog>
{
public Task<PageModel<TasksLog>> GetTaskLogs(long jobId, int page, int intPageSize,DateTime? runTime,DateTime? endTime);
public Task<object> GetTaskOverview(long jobId, DateTime? runTime, DateTime? endTime, string type);
}
}

View File

@@ -0,0 +1,16 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model.Models;
namespace DouyinApi.IServices
{
/// <summary>
/// ITasksQzServices
/// </summary>
public interface ITasksQzServices :IBaseServices<TasksQz>
{
}
}

View File

@@ -0,0 +1,12 @@
using System.Threading.Tasks;
using DouyinApi.IServices.BASE;
using DouyinApi.Model.Models;
namespace DouyinApi.IServices;
public interface ITenantService : IBaseServices<SysTenant>
{
public Task SaveTenant(SysTenant tenant);
public Task InitTenantDb(SysTenant tenant);
}

View File

@@ -0,0 +1,12 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace DouyinApi.IServices
{
public interface ITopicDetailServices : IBaseServices<TopicDetail>
{
Task<List<TopicDetail>> GetTopicDetails();
}
}

View File

@@ -0,0 +1,12 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace DouyinApi.IServices
{
public interface ITopicServices : IBaseServices<Topic>
{
Task<List<Topic>> GetTopics();
}
}

View File

@@ -0,0 +1,17 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model.Models;
using System.Threading.Tasks;
namespace DouyinApi.IServices
{
/// <summary>
/// UserRoleServices
/// </summary>
public interface IUserRoleServices :IBaseServices<UserRole>
{
Task<UserRole> SaveUserRole(long uid, long rid);
Task<int> GetRoleIdByUid(long uid);
}
}

View File

@@ -0,0 +1,16 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model;
using DouyinApi.Model.Models;
using DouyinApi.Model.ViewModels;
using System.Threading.Tasks;
namespace DouyinApi.IServices
{
/// <summary>
/// IWeChatCompanyServices
/// </summary>
public interface IWeChatCompanyServices : IBaseServices<WeChatCompany>
{
}
}

View File

@@ -0,0 +1,102 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model;
using DouyinApi.Model.Models;
using DouyinApi.Model.ViewModels;
using System.Threading.Tasks;
namespace DouyinApi.IServices
{
/// <summary>
/// IWeChatConfigServices
/// </summary>
public interface IWeChatConfigServices :IBaseServices<WeChatConfig>
{
/// <summary>
/// 获取可用的微信token
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
Task<MessageModel<WeChatApiDto>> GetToken(string id);
/// <summary>
/// 刷新微信token
/// </summary>
/// <param name="publicAccount"></param>
/// <returns></returns>
Task<MessageModel<WeChatApiDto>> RefreshToken(string id);
/// <summary>
/// 获取模板信息
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
Task<MessageModel<WeChatApiDto>> GetTemplate(string id);
/// <summary>
/// 获取菜单
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
Task<MessageModel<WeChatApiDto>> GetMenu(string id);
/// <summary>
/// 获取订阅用户
/// </summary>
/// <param name="id"></param>
/// <param name="openid"></param>
/// <returns></returns>
Task<MessageModel<WeChatApiDto>> GetSubUser(string id,string openid);
/// <summary>
/// 获取订阅用户列表
/// </summary>
/// <returns></returns>
Task<MessageModel<WeChatApiDto>> GetSubUsers(string id);
/// <summary>
/// 处理微信事件
/// </summary>
/// <param name="weChat"></param>
/// <returns></returns>
Task<string> HandleWeChat(WeChatXMLDto weChat);
/// <summary>
/// 微信验证入库
/// </summary>
/// <param name="validDto"></param>
/// <param name="body"></param>
/// <returns></returns>
Task<string> Valid(WeChatValidDto validDto,string body);
/// <summary>
/// 获取绑定二维码
/// </summary>
/// <param name="info"></param>
/// <returns></returns>
Task<MessageModel<WeChatResponseUserInfo>> GetQRBind(WeChatUserInfo info);
/// <summary>
/// 推送卡片消息(绑定用户)
/// </summary>
/// <param name="msg"></param>
/// <param name="ip"></param>
/// <returns></returns>
Task<MessageModel<WeChatResponseUserInfo>> PushCardMsg(WeChatCardMsgDataDto msg,string ip);
/// <summary>
/// 推送文本消息(绑定或订阅)
/// </summary>
/// <param name="msg"></param>
/// <returns></returns>
Task<MessageModel<WeChatApiDto>> PushTxtMsg(WeChatPushTestDto msg);
/// <summary>
/// 更新菜单
/// </summary>
/// <param name="menu"></param>
/// <returns></returns>
Task<MessageModel<WeChatApiDto>> UpdateMenu(WeChatApiDto menu);
/// <summary>
/// 通过绑定用户获取微信用户信息
/// </summary>
/// <param name="info"></param>
/// <returns></returns>
Task<MessageModel<WeChatResponseUserInfo>> GetBindUserInfo(WeChatUserInfo info);
/// <summary>
/// 解除绑定用户
/// </summary>
/// <param name="info"></param>
/// <returns></returns>
Task<MessageModel<WeChatResponseUserInfo>> UnBind(WeChatUserInfo info);
}
}

View File

@@ -0,0 +1,16 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model;
using DouyinApi.Model.Models;
using DouyinApi.Model.ViewModels;
using System.Threading.Tasks;
namespace DouyinApi.IServices
{
/// <summary>
/// IWeChatPushLogServices
/// </summary>
public interface IWeChatPushLogServices : IBaseServices<WeChatPushLog>
{
}
}

View File

@@ -0,0 +1,16 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model;
using DouyinApi.Model.Models;
using DouyinApi.Model.ViewModels;
using System.Threading.Tasks;
namespace DouyinApi.IServices
{
/// <summary>
/// IWeChatSubServices
/// </summary>
public interface IWeChatSubServices : IBaseServices<WeChatSub>
{
}
}

View File

@@ -0,0 +1,17 @@
using DouyinApi.IServices.BASE;
using DouyinApi.Model.Models;
using System.Threading.Tasks;
namespace DouyinApi.IServices
{
/// <summary>
/// sysUserInfoServices
/// </summary>
public interface ISysUserInfoServices :IBaseServices<SysUserInfo>
{
Task<SysUserInfo> SaveUserInfo(string loginName, string loginPwd);
Task<string> GetUserRoleNameStr(string loginName, string loginPwd);
}
}