This commit is contained in:
2025-11-13 19:07:59 +08:00
parent 5ec950cc61
commit 50163d02a7
9 changed files with 378 additions and 88 deletions

View File

@@ -0,0 +1,34 @@
//
// KBUser.h
// 登录模块-用户模型MJExtension 解析)
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface KBUser : NSObject
// 标识
@property (nonatomic, copy, nullable) NSString *userId; // id/user_id/uid
@property (nonatomic, copy, nullable) NSString *appleUserId; // 用 Apple 登录返回的 userID可选
// 基本信息
@property (nonatomic, copy, nullable) NSString *nickname;
@property (nonatomic, copy, nullable) NSString *avatar; // 头像 URL
@property (nonatomic, copy, nullable) NSString *gender; // 性别(后端可能返回 string/int统一转字符串存
@property (nonatomic, copy, nullable) NSString *mobile;
@property (nonatomic, copy, nullable) NSString *email;
// 会话信息
@property (nonatomic, copy, nullable) NSString *token; // token/access_token/accessToken
@property (nonatomic, copy, nullable) NSString *refreshToken; // refresh_token/refreshToken
@property (nonatomic, strong, nullable) NSDate *expiryDate; // 若后端返回过期时间,转为日期
/// 从后端返回(可能顶层或 data/user 嵌套)中解析用户模型。内部使用 MJExtension。
+ (instancetype)userFromResponseObject:(id)jsonObject;
@end
NS_ASSUME_NONNULL_END