refactor: 批量新增枚举类型并完成实体、DTO、服务层枚举替换
- 新增30+业务枚举类型覆盖用户、宠物、商城、社区、积分等模块 - 完成实体类、DTO、服务层的字符串枚举替换为强类型枚举 - 修复用户状态枚举名称变更,将Frozen改为Disabled - 新增批量发布社区消息接口与控制器实现 - 新增操作日志、积分管理、补偿任务相关服务与DTO
This commit is contained in:
@ -3,6 +3,7 @@ using QYZH.InteractiveMagazine.IService;
|
||||
using QYZH.InteractiveMagazine.Models.Common;
|
||||
using QYZH.InteractiveMagazine.Models.Dto;
|
||||
using QYZH.InteractiveMagazine.Models.Entity;
|
||||
using QYZH.InteractiveMagazine.Models.Enum;
|
||||
using QYZH.InteractiveMagazine.Repository;
|
||||
using SqlSugar;
|
||||
|
||||
@ -42,7 +43,7 @@ public class ProductService(BaseRepository<Product> productRepository, ILogger<P
|
||||
Description = input.Description,
|
||||
ImageUrl = input.ImageUrl,
|
||||
Price = input.Price,
|
||||
Type = input.Type,
|
||||
Type = Enum.Parse<ProductTypeEnum>(input.Type, true),
|
||||
SaleStatus = input.SaleStatus,
|
||||
MetaData = input.MetaData,
|
||||
IsActive = input.IsActive,
|
||||
@ -70,7 +71,7 @@ public class ProductService(BaseRepository<Product> productRepository, ILogger<P
|
||||
Description = product.Description,
|
||||
ImageUrl = product.ImageUrl,
|
||||
Price = product.Price,
|
||||
Type = product.Type,
|
||||
Type = product.Type.ToString(),
|
||||
SaleStatus = product.SaleStatus,
|
||||
MetaData = product.MetaData,
|
||||
IsActive = product.IsActive,
|
||||
@ -115,7 +116,7 @@ public class ProductService(BaseRepository<Product> productRepository, ILogger<P
|
||||
product.Description = input.Description;
|
||||
product.ImageUrl = input.ImageUrl;
|
||||
product.Price = input.Price;
|
||||
product.Type = input.Type;
|
||||
product.Type = Enum.Parse<ProductTypeEnum>(input.Type, true);
|
||||
product.SaleStatus = input.SaleStatus;
|
||||
product.MetaData = input.MetaData;
|
||||
product.IsActive = input.IsActive;
|
||||
@ -139,7 +140,7 @@ public class ProductService(BaseRepository<Product> productRepository, ILogger<P
|
||||
Description = product.Description,
|
||||
ImageUrl = product.ImageUrl,
|
||||
Price = product.Price,
|
||||
Type = product.Type,
|
||||
Type = product.Type.ToString(),
|
||||
SaleStatus = product.SaleStatus,
|
||||
MetaData = product.MetaData,
|
||||
IsActive = product.IsActive,
|
||||
@ -196,7 +197,7 @@ public class ProductService(BaseRepository<Product> productRepository, ILogger<P
|
||||
Description = product.Description,
|
||||
ImageUrl = product.ImageUrl,
|
||||
Price = product.Price,
|
||||
Type = product.Type,
|
||||
Type = product.Type.ToString(),
|
||||
SaleStatus = product.SaleStatus,
|
||||
MetaData = product.MetaData,
|
||||
IsActive = product.IsActive,
|
||||
@ -228,7 +229,7 @@ public class ProductService(BaseRepository<Product> productRepository, ILogger<P
|
||||
RefAsync<int> totalNumber = 0;
|
||||
var pageResult = await productRepository.Queryable()
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Name), p => p.Name.Contains(input.Name))
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Type), p => p.Type == input.Type)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Type), p => p.Type.ToString() == input.Type)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.SaleStatus), p => p.SaleStatus == input.SaleStatus)
|
||||
.WhereIF(input.IsActive.HasValue, p => p.IsActive == input.IsActive.Value)
|
||||
.OrderByDescending(p => p.CreatedAt)
|
||||
@ -239,7 +240,7 @@ public class ProductService(BaseRepository<Product> productRepository, ILogger<P
|
||||
Description = p.Description,
|
||||
ImageUrl = p.ImageUrl,
|
||||
Price = p.Price,
|
||||
Type = p.Type,
|
||||
Type = p.Type.ToString(),
|
||||
SaleStatus = p.SaleStatus,
|
||||
MetaData = p.MetaData,
|
||||
IsActive = p.IsActive,
|
||||
|
||||
Reference in New Issue
Block a user