refactor: 重构用户与商品模块,统一业务模型与服务
1. 新增用户状态枚举UserStatusEnum,统一用户状态定义 2. 重构用户体系:合并WxUser与User实体为Users实体,统一用户管理 3. 新增微信小程序认证相关服务与控制器,实现一键登录功能 4. 新增商品管理完整服务与控制器,修复商品表字段映射问题 5. 删除冗余的WxUser相关服务与控制器代码 6. 新增Newtonsoft.Json依赖用于微信接口响应解析 7. 清理无用的文件夹引用配置
This commit is contained in:
@ -0,0 +1,51 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using QYZH.InteractiveMagazine.IService;
|
||||
using QYZH.InteractiveMagazine.IService.Dto;
|
||||
using QYZH.InteractiveMagazine.Models.Common;
|
||||
using QYZH.InteractiveMagazine.Models.Dto;
|
||||
|
||||
namespace QYZH.InteractiveMagazine.WebApi.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// 用户控制器
|
||||
/// </summary>
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class UsersController : BaseController
|
||||
{
|
||||
private readonly IUsersService _usersService;
|
||||
private readonly ILogger<UsersController> _logger;
|
||||
|
||||
public UsersController(IUsersService usersService, ILogger<UsersController> logger)
|
||||
{
|
||||
_usersService = usersService;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户列表(分页)
|
||||
/// </summary>
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<PageListModel<UsersOutput>>> GetList([FromQuery] UsersQueryInput input)
|
||||
{
|
||||
return await _usersService.GetListAsync(input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户详情
|
||||
/// </summary>
|
||||
[HttpGet("{id}")]
|
||||
public async Task<BaseResponse<UsersOutput>> GetDetail(long id)
|
||||
{
|
||||
return await _usersService.GetDetailAsync(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新用户状态
|
||||
/// </summary>
|
||||
[HttpPut("{id}/status")]
|
||||
public async Task<BaseResponse> UpdateStatus(long id, [FromBody] UpdateUserStatusInput input)
|
||||
{
|
||||
return await _usersService.UpdateStatusAsync(id, input);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user