Files
keyboard/keyBoard/Class/Login/M/KBUser.m

36 lines
868 B
Mathematica
Raw Normal View History

2025-11-13 19:07:59 +08:00
//
// KBUser.m
//
#import "KBUser.h"
#import <MJExtension/MJExtension.h>
@implementation KBUser
+ (NSDictionary *)mj_replacedKeyFromPropertyName {
return @{
2025-12-02 20:33:17 +08:00
@"userId": @[@"uid"],
2025-11-13 19:07:59 +08:00
};
}
2025-12-04 13:37:11 +08:00
+ (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property {
if ([property.name isEqualToString:@"gender"]) {
if ([oldValue isKindOfClass:[NSNumber class]]) {
NSInteger intValue = [(NSNumber *)oldValue integerValue];
if (intValue >= UserSexTwoSex && intValue <= UserSexMan) {
return @(intValue);
} else {
//
KBLOG(@"⚠️ 收到非法的userStatus值: %ld", (long)intValue);
return @(UserSexMan);
}
}
return @(UserSexMan);
}
return oldValue;
}
2025-11-13 19:07:59 +08:00
@end