140 lines
5.2 KiB
C#
140 lines
5.2 KiB
C#
/***********************************************************************
|
|
* Project: CoreCms
|
|
* ProjectName: 核心内容管理系统
|
|
* Web: https://www.corecms.net
|
|
* Author: 大灰灰
|
|
* Email: jianweie@163.com
|
|
* CreateTime: 2025/9/2 17:54:05
|
|
* Description: 暂无
|
|
***********************************************************************/
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq.Expressions;
|
|
using System.Threading.Tasks;
|
|
|
|
using CoreCms.Net.Model.Entities;
|
|
using CoreCms.Net.Model.ViewModels.Basics;
|
|
using CoreCms.Net.Model.ViewModels.UI;
|
|
using CoreCms.Net.Model.ViewModels.SQ;
|
|
|
|
using SqlSugar;
|
|
|
|
namespace CoreCms.Net.IServices
|
|
{
|
|
/// <summary>
|
|
/// 预约表 服务工厂接口
|
|
/// </summary>
|
|
public interface ISQReservationsServices : IBaseServices<SQReservations>
|
|
{
|
|
#region 重写增删改查操作===========================================================
|
|
|
|
/// <summary>
|
|
/// 重写异步插入方法
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
/// <returns></returns>
|
|
new Task<AdminUiCallBack> InsertAsync(SQReservations entity);
|
|
|
|
/// <summary>
|
|
/// 重写异步更新方法
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
/// <returns></returns>
|
|
new Task<AdminUiCallBack> UpdateAsync(SQReservations entity);
|
|
|
|
/// <summary>
|
|
/// 重写异步更新方法
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
/// <returns></returns>
|
|
new Task<AdminUiCallBack> UpdateAsync(List<SQReservations> entity);
|
|
|
|
/// <summary>
|
|
/// 重写删除指定ID的数据
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
new Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
|
|
|
/// <summary>
|
|
/// 重写删除指定ID集合的数据(批量删除)
|
|
/// </summary>
|
|
/// <param name="ids"></param>
|
|
/// <returns></returns>
|
|
new Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
|
|
|
|
#endregion
|
|
|
|
|
|
#region 获取缓存的所有数据==========================================================
|
|
|
|
/// <summary>
|
|
/// 获取缓存的所有数据
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
Task<List<SQReservations>> GetCaChe();
|
|
|
|
/// <summary>
|
|
/// 更新cache
|
|
/// </summary>
|
|
Task<List<SQReservations>> UpdateCaChe();
|
|
|
|
#endregion
|
|
|
|
#region 重写根据条件查询分页数据
|
|
/// <summary>
|
|
/// 重写根据条件查询分页数据
|
|
/// </summary>
|
|
/// <param name="predicate">判断集合</param>
|
|
/// <param name="orderByType">排序方式</param>
|
|
/// <param name="pageIndex">当前页面索引</param>
|
|
/// <param name="pageSize">分布大小</param>
|
|
/// <param name="orderByExpression"></param>
|
|
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
|
/// <returns></returns>
|
|
new Task<IPageList<SQReservations>> QueryPageAsync(
|
|
Expression<Func<SQReservations, bool>> predicate,
|
|
Expression<Func<SQReservations, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
|
int pageSize = 20, bool blUseNoLock = false);
|
|
#endregion
|
|
|
|
#region 预约模板消息通知==========================================================
|
|
/// <summary>
|
|
/// 组局失败通知(批量入队模板消息)
|
|
/// </summary>
|
|
/// <param name="reservation">预约</param>
|
|
/// <param name="participants">需通知的参与人集合</param>
|
|
Task NotifyReservationFailedAsync(SQReservations reservation, IEnumerable<SQReservationParticipants> participants, string tips = "组局人数未满,自动解散!");
|
|
|
|
/// <summary>
|
|
/// 组局成功通知(批量入队模板消息)
|
|
/// </summary>
|
|
/// <param name="reservation">预约</param>
|
|
/// <param name="participants">需通知的参与人集合</param>
|
|
Task NotifyReservationSuccessAsync(SQReservations reservation, IEnumerable<SQReservationParticipants> participants);
|
|
#endregion
|
|
|
|
#region 按时段预约相关方法
|
|
|
|
/// <summary>
|
|
/// 按时段创建预约
|
|
/// </summary>
|
|
/// <param name="dto">创建预约DTO</param>
|
|
/// <param name="userId">用户ID</param>
|
|
/// <returns>预约ID和相关信息</returns>
|
|
Task<(bool success, int reservationId, string message, SQReservations reservation)> CreateReservationBySlotAsync(SQReservationsAddBySlotDto dto, int userId);
|
|
|
|
/// <summary>
|
|
/// 校验是否可以按时段创建预约
|
|
/// </summary>
|
|
/// <param name="dto">创建预约DTO</param>
|
|
/// <param name="userId">用户ID</param>
|
|
/// <returns>是否可以创建及原因</returns>
|
|
Task<(bool canCreate, string reason)> ValidateReservationBySlotAsync(SQReservationsAddBySlotDto dto, int userId);
|
|
|
|
#endregion
|
|
|
|
}
|
|
}
|