You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.6 KiB
C#

using DS.Module.Core;
using DS.WMS.Core.Code.Entity;
using DS.WMS.Core.Map.Entity;
using DS.WMS.Core.Sys.Method;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Sys.Interface
{
/// <summary>
/// 公共缓存
/// </summary>
public interface ISysCacheService
{
/// <summary>
/// 获取缓存数据
/// </summary>
/// <typeparam name="T">数据类型</typeparam>
/// <param name="cacheCategory">缓存key枚举</param>
/// <param name="systemKey">缓存系统KEY</param>
/// <returns>返回列表</returns>
Task<DataResult<List<T>>> GetAllCommonCodeFromCache<T>(SysCacheCategoryEnum cacheCategory, string systemKey);
/// <summary>
/// 设置缓存
/// </summary>
/// <param name="cacheObj">被缓存的详情</param>
/// <param name="cacheCategory">缓存类型枚举</param>
/// <param name="systemKey">缓存系统KEY</param>
/// <param name="outSecond">超期时间(毫米)</param>
/// <returns></returns>
Task<DataResult<string>> SetCommonCode(object cacheObj, SysCacheCategoryEnum cacheCategory, string systemKey, int outSecond = 0);
/// <summary>
/// 清除缓存
/// </summary>
/// <param name="cacheCategory">缓存类型枚举</param>
/// <param name="systemKey">缓存系统KEY</param>
/// <returns></returns>
Task<DataResult> RemoveCache(SysCacheCategoryEnum cacheCategory, string systemKey);
}
}