refactor: 重构用户与商品模块,统一业务模型与服务
1. 新增用户状态枚举UserStatusEnum,统一用户状态定义 2. 重构用户体系:合并WxUser与User实体为Users实体,统一用户管理 3. 新增微信小程序认证相关服务与控制器,实现一键登录功能 4. 新增商品管理完整服务与控制器,修复商品表字段映射问题 5. 删除冗余的WxUser相关服务与控制器代码 6. 新增Newtonsoft.Json依赖用于微信接口响应解析 7. 清理无用的文件夹引用配置
This commit is contained in:
45
QYZH.InteractiveMagazine.IService/IProductService.cs
Normal file
45
QYZH.InteractiveMagazine.IService/IProductService.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using QYZH.InteractiveMagazine.Models.Dto;
|
||||
using QYZH.InteractiveMagazine.Models.Entity;
|
||||
|
||||
namespace QYZH.InteractiveMagazine.IService;
|
||||
|
||||
/// <summary>
|
||||
/// 商品服务接口
|
||||
/// </summary>
|
||||
public interface IProductService : IBaseService<Product>
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建商品
|
||||
/// </summary>
|
||||
/// <param name="input">商品输入</param>
|
||||
/// <returns>创建的商品信息</returns>
|
||||
Task<ProductOutput> CreateAsync(ProductInput input);
|
||||
|
||||
/// <summary>
|
||||
/// 更新商品
|
||||
/// </summary>
|
||||
/// <param name="id">商品ID</param>
|
||||
/// <param name="input">商品输入</param>
|
||||
/// <returns>更新后的商品信息</returns>
|
||||
Task<ProductOutput> UpdateAsync(long id, ProductInput input);
|
||||
|
||||
/// <summary>
|
||||
/// 删除商品(软删除)
|
||||
/// </summary>
|
||||
/// <param name="id">商品ID</param>
|
||||
Task DeleteAsync(long id);
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID获取商品
|
||||
/// </summary>
|
||||
/// <param name="id">商品ID</param>
|
||||
/// <returns>商品信息</returns>
|
||||
Task<ProductOutput> GetByIdAsync(long id);
|
||||
|
||||
/// <summary>
|
||||
/// 分页查询商品列表
|
||||
/// </summary>
|
||||
/// <param name="input">查询条件</param>
|
||||
/// <returns>分页结果</returns>
|
||||
Task<PageListModel<ProductOutput>> GetListAsync(ProductQueryInput input);
|
||||
}
|
||||
23
QYZH.InteractiveMagazine.IService/IUsersService.cs
Normal file
23
QYZH.InteractiveMagazine.IService/IUsersService.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using QYZH.InteractiveMagazine.IService.Dto;
|
||||
using QYZH.InteractiveMagazine.Models.Dto;
|
||||
using QYZH.InteractiveMagazine.Models.Entity;
|
||||
|
||||
namespace QYZH.InteractiveMagazine.IService;
|
||||
|
||||
public interface IUsersService : IBaseService<Users>
|
||||
{
|
||||
/// <summary>
|
||||
/// 分页查询用户列表
|
||||
/// </summary>
|
||||
Task<BaseResponse<PageListModel<UsersOutput>>> GetListAsync(UsersQueryInput input);
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户详情
|
||||
/// </summary>
|
||||
Task<BaseResponse<UsersOutput>> GetDetailAsync(long id);
|
||||
|
||||
/// <summary>
|
||||
/// 更新用户状态
|
||||
/// </summary>
|
||||
Task<BaseResponse> UpdateStatusAsync(long id, UpdateUserStatusInput input);
|
||||
}
|
||||
17
QYZH.InteractiveMagazine.IService/IWeChatAuthService.cs
Normal file
17
QYZH.InteractiveMagazine.IService/IWeChatAuthService.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using QYZH.InteractiveMagazine.IService.Dto;
|
||||
using QYZH.InteractiveMagazine.Models.Entity;
|
||||
|
||||
namespace QYZH.InteractiveMagazine.IService;
|
||||
|
||||
/// <summary>
|
||||
/// 微信小程序认证服务
|
||||
/// </summary>
|
||||
public interface IWeChatAuthService : IBaseService<Users>
|
||||
{
|
||||
/// <summary>
|
||||
/// 微信小程序一键登录
|
||||
/// </summary>
|
||||
/// <param name="input">登录输入(含微信 code)</param>
|
||||
/// <returns>登录结果(含 Token 和用户信息)</returns>
|
||||
Task<WeChatLoginOutput> LoginAsync(WeChatLoginInput input);
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
using QYZH.InteractiveMagazine.IService.Dto;
|
||||
using QYZH.InteractiveMagazine.Models.Dto;
|
||||
using QYZH.InteractiveMagazine.Models.Entity;
|
||||
|
||||
namespace QYZH.InteractiveMagazine.IService;
|
||||
|
||||
public interface IWxUserService : IBaseService<WxUser>
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建微信用户
|
||||
/// </summary>
|
||||
Task<WxUserOutput> CreateAsync(WxUserInput input);
|
||||
|
||||
/// <summary>
|
||||
/// 更新微信用户
|
||||
/// </summary>
|
||||
Task<WxUserOutput> UpdateAsync(long id, WxUserInput input);
|
||||
|
||||
/// <summary>
|
||||
/// 删除微信用户(软删除)
|
||||
/// </summary>
|
||||
Task DeleteAsync(long id);
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID获取微信用户
|
||||
/// </summary>
|
||||
Task<WxUserOutput> GetByIdAsync(long id);
|
||||
|
||||
/// <summary>
|
||||
/// 分页查询微信用户列表
|
||||
/// </summary>
|
||||
Task<PageListModel<WxUserOutput>> GetListAsync(WxUserQueryInput input);
|
||||
}
|
||||
Reference in New Issue
Block a user