Files
QYZH.InteractiveMagazine/QYZH.InteractiveMagazine.IService/IWeChatAuthService.cs
glz 028e3dfb34 refactor: 重构用户与勋章体系,统一状态管理与数据结构
1.  新增通用默认状态枚举 DefaultStatusEnum,替换原有分散的状态枚举
2.  重构用户体系:拆分 WxUser 独立表存储微信身份,Users 表改为角色子用户表并关联 WxUser
3.  重构勋章模块:新增系统/期刊勋章类型,调整 JournalId 为可空,新增勋章状态字段
4.  重构微信认证流程:基于 WxUser 生成 Token,支持多子用户管理
5.  清理冗余枚举文件,重构多处业务逻辑适配新的数据结构
6.  修复用户手机号关联逻辑,迁移手机号字段至 WxUser 表
2026-06-10 13:47:13 +08:00

41 lines
1.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using QYZH.InteractiveMagazine.Models.Entity;
using QYZH.InteractiveMagazine.Models.WeChat;
namespace QYZH.InteractiveMagazine.IService;
/// <summary>
/// 微信小程序认证服务
/// </summary>
public interface IWeChatAuthService : IBaseService<WxUser>
{
/// <summary>
/// 微信小程序登录(首次仅创建 WxUser不自动创建 User
/// </summary>
Task<WeChatLoginOutput> LoginAsync(WeChatLoginInput input);
/// <summary>
/// 微信小程序快捷登录(通过 OpenId 直接登录)
/// </summary>
Task<WeChatLoginOutput> QuickLoginAsync(WeChatQuickLoginInput input);
/// <summary>
/// 切换用户(同一 WxUser 下切换 User 身份JWT 基于 WxUser 无需重新生成 Token
/// </summary>
Task<WeChatSwitchUserOutput> SwitchUserAsync(long wxUserId, WeChatSwitchUserInput input);
/// <summary>
/// 获取当前 WxUser 下所有用户列表
/// </summary>
/// <param name="wxUserId">当前登录的 WxUser.Id来自 JWT</param>
/// <returns>用户列表</returns>
Task<List<WxUserOutput>> GetUsersAsync(long wxUserId);
/// <summary>
/// 在当前 WxUser 下新增用户(子用户/角色)
/// </summary>
/// <param name="wxUserId">当前登录的 WxUser.Id来自 JWT</param>
/// <param name="input">新增用户参数</param>
/// <returns>新创建的用户信息</returns>
Task<WxUserOutput> CreateUserAsync(long wxUserId, CreateChildUserInput input);
}