首次提交:本地项目同步到Gitea
This commit is contained in:
27
Cowain.Base/IServices/IAccountService.cs
Normal file
27
Cowain.Base/IServices/IAccountService.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Cowain.Base.Models;
|
||||
using Cowain.Base.ViewModels;
|
||||
|
||||
namespace Cowain.Base.IServices;
|
||||
|
||||
public interface IAccountService : IBaseService
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取所有用户
|
||||
/// </summary>
|
||||
Task<List<UserViewModel>> GetAllAsync();
|
||||
|
||||
Task<(List<UserViewModel>, int totals)> GetAllAsync(int pageIndex, int pageSize);
|
||||
/// <summary>
|
||||
/// 登录
|
||||
/// </summary>
|
||||
/// <param name="userName">用户名</param>
|
||||
/// <param name="password">密码</param>
|
||||
/// <returns></returns>
|
||||
Task<ResultModel<LoginUserViewModel>> LoginAsync(string userName, string password);
|
||||
|
||||
Task<ResultModel> CheckHealthAsync(CancellationToken cancellationToken = default);
|
||||
Task<ResultModel> AddUserAsync(UserViewModel? user);
|
||||
|
||||
Task<ResultModel> EditUserAsync(UserViewModel? user);
|
||||
Task<ResultModel> DelUserAsync(UserViewModel? user);
|
||||
}
|
||||
41
Cowain.Base/IServices/IBaseService.cs
Normal file
41
Cowain.Base/IServices/IBaseService.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using MySqlConnector;
|
||||
using System.Data;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace Cowain.Base.IServices
|
||||
{
|
||||
public interface IBaseService
|
||||
{
|
||||
int Delete<T>(int Id) where T : class;
|
||||
int Delete<T>(T t) where T : class;
|
||||
Task<int> DeleteAsync<T>(int Id, CancellationToken cancellationToken = default) where T : class;
|
||||
Task<int> DeleteAsync<T>(T t, CancellationToken cancellationToken = default) where T : class;
|
||||
int ExecuteByDapper(string sql, object? param = null);
|
||||
Task<int> ExecuteByDapperAsync(string sql, object? param = null, CancellationToken cancellationToken = default);
|
||||
List<T> Find<T>() where T : class;
|
||||
T? Find<T>(int id) where T : class;
|
||||
Task<List<T>> FindAsync<T>(CancellationToken cancellationToken = default) where T : class;
|
||||
Task<T?> FindAsync<T>(int id, CancellationToken cancellationToken = default) where T : class;
|
||||
Task<T?> FirstOrDefaultAsync<T>(Expression<Func<T, bool>> funcWhere, CancellationToken cancellationToken = default) where T : class;
|
||||
DataTable GetDataTable(string sql, IEnumerable<MySqlParameter>? parameters = null);
|
||||
Task<DataTable> GetDataTableAsync(string sql, IEnumerable<MySqlParameter>? parameters = null, CancellationToken cancellationToken = default);
|
||||
int Insert<T>(IEnumerable<T> tList) where T : class;
|
||||
int Insert<T>(T t) where T : class;
|
||||
Task<int> InsertAsync<T>(IEnumerable<T> tList, CancellationToken cancellationToken = default) where T : class;
|
||||
Task<int> InsertAsync<T>(T t, CancellationToken cancellationToken = default) where T : class;
|
||||
List<T> Query<T>(Expression<Func<T, bool>>? funcWhere = null) where T : class;
|
||||
Task<(List<TViewModel> Data, int TotalCount)> QueryAsync<T, TKey, TViewModel>(Expression<Func<T, TViewModel>> selectExpression, Expression<Func<T, bool>>? funcWhere = null, Expression<Func<T, TKey>>? orderBy = null, bool isAscending = true, int pageIndex = 1, int pageSize = 20, CancellationToken cancellationToken = default) where T : class;
|
||||
Task<(List<T> Data, int TotalCount)> QueryAsync<T, TKey>(Expression<Func<T, bool>>? funcWhere = null, Expression<Func<T, TKey>>? orderBy = null, bool isAscending = true, int pageIndex = 1, int pageSize = 20, CancellationToken cancellationToken = default) where T : class;
|
||||
Task<List<T>> QueryAsync<T>(Expression<Func<T, bool>>? funcWhere = null, CancellationToken cancellationToken = default) where T : class;
|
||||
IEnumerable<T> QueryByDapper<T>(string sql, object? param = null);
|
||||
Task<IEnumerable<T>> QueryByDapperAsync<T>(string sql, object? param = null, CancellationToken cancellationToken = default);
|
||||
T? QueryFirstOrDefaultByDapper<T>(string sql, object? param = null);
|
||||
Task<T?> QueryFirstOrDefaultByDapperAsync<T>(string sql, object? param = null, CancellationToken cancellationToken = default);
|
||||
DataTable QueryToDataTableByDapper(string sql, object? param = null);
|
||||
Task<DataTable> QueryToDataTableByDapperAsync(string sql, object? param = null, CancellationToken cancellationToken = default);
|
||||
int Update<T>(IEnumerable<T> tList) where T : class;
|
||||
int Update<T>(T t) where T : class;
|
||||
Task<int> UpdateAsync<T>(IEnumerable<T> tList, CancellationToken cancellationToken = default) where T : class;
|
||||
Task<int> UpdateAsync<T>(T t, CancellationToken cancellationToken = default) where T : class;
|
||||
}
|
||||
}
|
||||
18
Cowain.Base/IServices/ILogService.cs
Normal file
18
Cowain.Base/IServices/ILogService.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Cowain.Base.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Cowain.Base.IServices;
|
||||
|
||||
public interface ILogService : IBaseService
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取所有用户
|
||||
/// </summary>
|
||||
Task<List<SerilogViewModel>> GetAllAsync();
|
||||
|
||||
Task<(List<SerilogViewModel>, int totals)> GetAllAsync(int pageIndex, int pageSize);
|
||||
}
|
||||
24
Cowain.Base/IServices/IUserRoleMenuService.cs
Normal file
24
Cowain.Base/IServices/IUserRoleMenuService.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Cowain.Base.Models;
|
||||
using Cowain.Base.ViewModels;
|
||||
|
||||
namespace Cowain.Base.IServices;
|
||||
|
||||
public interface IUserRoleMenuService : IBaseService
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取所有菜单
|
||||
/// </summary>
|
||||
/// <param name="currentUser"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<UserRoleViewModel>> GetAllAsync();
|
||||
|
||||
/// <summary>
|
||||
/// 修改角色菜单
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<ResultModel> EditUserRoleMenuAsync(UserRoleViewModel? userRole);
|
||||
|
||||
Task<ResultModel> EditMenuActionsAsync(UserRoleMenuViewModel? userRoleMenu);
|
||||
|
||||
Task<ResultModel> DeleteMenuActionsAsync(UserRoleMenuViewModel? userRoleMenu);
|
||||
}
|
||||
39
Cowain.Base/IServices/IUserRoleService.cs
Normal file
39
Cowain.Base/IServices/IUserRoleService.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using Cowain.Base.Models;
|
||||
using Cowain.Base.ViewModels;
|
||||
|
||||
namespace Cowain.Base.IServices;
|
||||
|
||||
public interface IUserRoleService : IBaseService
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取所有用户角色
|
||||
/// </summary>
|
||||
/// <param name="currentUser"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<UserRoleViewModel>> GetAllAsync();
|
||||
/// <summary>
|
||||
/// 获取所有用户角色,分页查询
|
||||
/// </summary>
|
||||
/// <param name="pageIndex"></param>
|
||||
/// <param name="pageSize"></param>
|
||||
/// <returns></returns>
|
||||
Task<(List<UserRoleViewModel>, int totals)> GetAllAsync(int pageIndex, int pageSize);
|
||||
|
||||
/// <summary>
|
||||
/// 增加角色
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<ResultModel> AddUserRoleAsync(UserRoleViewModel? userRole);
|
||||
|
||||
/// <summary>
|
||||
/// 删除角色
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<ResultModel> DelUserRoleAsync(UserRoleViewModel? userRole);
|
||||
|
||||
/// <summary>
|
||||
/// 修改角色
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<ResultModel> EditUserRoleAsync(UserRoleViewModel? userRole);
|
||||
}
|
||||
Reference in New Issue
Block a user