Files
QYZH.InteractiveMagazine/QYZH.InteractiveMagazine.IService/IWeChatAuthService.cs
glz 018d7e1733 feat(wechat-auth): 实现微信同一OpenId下多用户切换功能
1. 新增用户实体字段IsLastOnline标记上次在线用户
2. 重构微信登录逻辑,返回同一OpenId下的所有用户列表而非单用户
3. 新增SwitchUserAsync服务方法与控制器接口,支持同OpenId下切换用户
4. 添加用户实体到输出DTO的映射工具方法
5. 实现切换用户时的身份校验、Token刷新与在线状态更新
2026-06-03 18:28:45 +08:00

26 lines
931 B
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.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);
/// <summary>
/// 切换用户(同一 OpenId 下切换身份)
/// </summary>
/// <param name="currentUserId">当前登录用户ID</param>
/// <param name="input">切换用户输入</param>
/// <returns>切换结果(含新 Token 和目标用户详情)</returns>
Task<WeChatSwitchUserOutput> SwitchUserAsync(long currentUserId, WeChatSwitchUserInput input);
}