using QYZH.InteractiveMagazine.Models.Dto; using Newtonsoft.Json; namespace QYZH.InteractiveMagazine.IService.Dto; /// /// 微信小程序登录输入 /// public class WeChatLoginInput { /// /// 微信登录凭证(wx.login 获取的 code) /// public string Code { get; set; } = string.Empty; } /// /// 微信登录输出 /// public class WeChatLoginOutput { /// /// 访问令牌 /// public string Token { get; set; } = string.Empty; /// /// 微信OpenId /// public string OpenId { get; set; } = string.Empty; /// /// 该 OpenId 下的用户列表 /// public List Users { get; set; } = []; } /// /// 微信用户创建/更新输入 /// public class WxUserInput { /// /// 微信OpenId /// public string OpenId { get; set; } = string.Empty; /// /// 微信UnionId /// public string? UnionId { get; set; } /// /// 昵称 /// public string? NickName { get; set; } /// /// 头像地址 /// public string? AvatarUrl { get; set; } /// /// 手机号 /// public string? Phone { get; set; } /// /// 积分余额 /// public int Points { get; set; } = 0; /// /// 用户类型: Normal, VIP /// public string Type { get; set; } = "Normal"; /// /// 状态: Active, Disabled /// public string Status { get; set; } = "Active"; /// /// 密码,默认手机后4位 /// public string? Pwd { get; set; } /// /// 当前成长值 /// public int GrowthPoints { get; set; } = 0; } /// /// 微信用户输出 /// public class WxUserOutput { /// /// 主键ID /// public long Id { get; set; } /// /// 微信OpenId /// public string OpenId { get; set; } = string.Empty; /// /// 微信UnionId /// public string? UnionId { get; set; } /// /// 昵称 /// public string? NickName { get; set; } /// /// 头像地址 /// public string? AvatarUrl { get; set; } /// /// 手机号 /// public string? Phone { get; set; } /// /// 积分余额 /// public int Points { get; set; } /// /// 用户类型 /// public string Type { get; set; } = string.Empty; /// /// 状态 /// public string Status { get; set; } = string.Empty; /// /// 当前成长值 /// public int GrowthPoints { get; set; } /// /// 是否上次在线用户 /// public bool IsLastOnline { get; set; } /// /// 创建人 /// public string? CreatedBy { get; set; } /// /// 创建时间 /// public DateTime CreatedAt { get; set; } /// /// 更新人 /// public string? UpdatedBy { get; set; } /// /// 更新时间 /// public DateTime? UpdatedAt { get; set; } } /// /// 微信用户分页查询输入 /// public class WxUserQueryInput : PageQueryModel { /// /// 昵称(模糊查询) /// public string? NickName { get; set; } /// /// 手机号(模糊查询) /// public string? Phone { get; set; } } /// /// 微信 code2session 接口响应 /// public class WxCode2SessionResponse { /// /// 用户唯一标识 /// [JsonProperty("openid")] public string? OpenId { get; set; } /// /// 会话密钥 /// [JsonProperty("session_key")] public string? SessionKey { get; set; } /// /// 用户统一标识(在开放平台绑定了多个应用时使用) /// [JsonProperty("unionid")] public string? UnionId { get; set; } /// /// 错误码 /// [JsonProperty("errcode")] public int ErrCode { get; set; } /// /// 错误信息 /// [JsonProperty("errmsg")] public string? ErrMsg { get; set; } } /// /// 微信切换用户输入 /// public class WeChatSwitchUserInput { /// /// 目标用户ID /// public long UserId { get; set; } } /// /// 微信切换用户输出 /// public class WeChatSwitchUserOutput { /// /// 新的访问令牌 /// public string Token { get; set; } = string.Empty; /// /// 当前切换的用户详情 /// public WxUserOutput User { get; set; } = new(); }