1. 重命名枚举项与实体字段,修正类型引用 2. 新增IsNull扩展方法与多项字符串处理扩展 3. 新增大量业务DTO、服务接口与枚举定义 4. 重构RabbitMQ服务实现,替换旧版消息队列组件 5. 优化签到服务的宠物喂养事务逻辑 6. 移除冗余的项目引用与旧版消息队列代码 7. 新增Excel导出、导入模板相关工具方法
45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
//using Microsoft.AspNetCore.Http;
|
|
|
|
namespace QYZH.InteractiveMagazine.Common.Extensions
|
|
{
|
|
public static partial class Extensions
|
|
{
|
|
public static bool IsEmpty(this object value)
|
|
{
|
|
if (value != null && !string.IsNullOrEmpty(value.ParseToString()))
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
public static bool IsNotEmpty(this object value)
|
|
{
|
|
return !IsEmpty(value);
|
|
}
|
|
public static bool IsNullOrZero(this object value)
|
|
{
|
|
if (value == null || value.ParseToString().Trim() == "0")
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
//public static bool IsAjaxRequest(this HttpRequest request)
|
|
//{
|
|
// if (request == null)
|
|
// throw new ArgumentNullException("request");
|
|
|
|
// if (request.Headers != null)
|
|
// return request.Headers["X-Requested-With"] == "XMLHttpRequest";
|
|
// return false;
|
|
//}
|
|
}
|
|
}
|