feat: 新增签到、宠物、期刊绑定、补偿任务等业务模块,优化微信登录流程
本次提交完成了多个核心业务模块的开发与优化: 1. 宠物模块:新增宠物实体、服务接口与实现,支持创建默认宠物、激活、喂养、进化以及喂养记录查询 2. 签到模块:新增签到实体、服务接口、控制器以及相关DTO,支持用户签到和签到信息查询,新增成长值奖励字段 3. 期刊绑定模块:新增用户期刊关联实体、服务接口与控制器,支持扫码绑定期刊、解绑和查询绑定列表 4. 补偿任务模块:新增补偿任务实体、服务接口与实现,用于处理业务失败后的异步重试补偿 5. 优化微信登录流程:拆分登录与快捷登录接口,支持手机号获取,新增首次登录自动创建默认宠物逻辑 6. 调整基础路由与实体状态:修改微信控制器路由前缀,更新宠物状态枚举与默认值
This commit is contained in:
@ -4,7 +4,7 @@ using Newtonsoft.Json;
|
||||
namespace QYZH.InteractiveMagazine.IService.Dto;
|
||||
|
||||
/// <summary>
|
||||
/// 微信小程序登录输入
|
||||
/// 微信小程序初次登录输入
|
||||
/// </summary>
|
||||
public class WeChatLoginInput
|
||||
{
|
||||
@ -12,6 +12,22 @@ public class WeChatLoginInput
|
||||
/// 微信登录凭证(wx.login 获取的 code)
|
||||
/// </summary>
|
||||
public string Code { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 手机号获取凭证(getPhoneNumber 按钮回调中的 code,可选)
|
||||
/// </summary>
|
||||
public string? PhoneCode { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 微信小程序快捷登录输入(通过 OpenId 登录)
|
||||
/// </summary>
|
||||
public class WeChatQuickLoginInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 微信OpenId(初次登录后客户端缓存的 OpenId)
|
||||
/// </summary>
|
||||
public string OpenId { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -225,6 +241,84 @@ public class WxCode2SessionResponse
|
||||
public string? ErrMsg { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 微信获取手机号接口响应
|
||||
/// </summary>
|
||||
public class WxPhoneNumberResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 错误码
|
||||
/// </summary>
|
||||
[JsonProperty("errcode")]
|
||||
public int ErrCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 错误信息
|
||||
/// </summary>
|
||||
[JsonProperty("errmsg")]
|
||||
public string? ErrMsg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机号信息
|
||||
/// </summary>
|
||||
[JsonProperty("phone_info")]
|
||||
public WxPhoneInfo? PhoneInfo { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 微信手机号信息
|
||||
/// </summary>
|
||||
public class WxPhoneInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户绑定的手机号(国外手机号会有区号)
|
||||
/// </summary>
|
||||
[JsonProperty("phoneNumber")]
|
||||
public string? PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 没有区号的手机号
|
||||
/// </summary>
|
||||
[JsonProperty("purePhoneNumber")]
|
||||
public string? PurePhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 区号
|
||||
/// </summary>
|
||||
[JsonProperty("countryCode")]
|
||||
public string? CountryCode { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 微信 access_token 接口响应
|
||||
/// </summary>
|
||||
public class WxAccessTokenResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取到的凭证
|
||||
/// </summary>
|
||||
[JsonProperty("access_token")]
|
||||
public string? AccessToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 凭证有效时间(秒)
|
||||
/// </summary>
|
||||
[JsonProperty("expires_in")]
|
||||
public int ExpiresIn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 错误码
|
||||
/// </summary>
|
||||
[JsonProperty("errcode")]
|
||||
public int ErrCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 错误信息
|
||||
/// </summary>
|
||||
[JsonProperty("errmsg")]
|
||||
public string? ErrMsg { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 微信切换用户输入
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user