This commit is contained in:
2025-12-08 16:39:47 +08:00
parent 0a1c30f669
commit fd8c08316b
30 changed files with 306 additions and 85 deletions

View File

@@ -0,0 +1,20 @@
//
// KBMyMainModel.h
// keyBoard
//
// Created by Mac on 2025/12/8.
//
#import <Foundation/Foundation.h>
#import "KBTagItemModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface KBMyMainModel : NSObject
@property (nonatomic, copy) NSString *message;
@property (nonatomic, assign) NSInteger code;
@property (nonatomic, strong) NSArray <KBTagItemModel *>*data;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,16 @@
//
// KBMyMainModel.m
// keyBoard
//
// Created by Mac on 2025/12/8.
//
#import "KBMyMainModel.h"
@implementation KBMyMainModel
+ (NSDictionary *)mj_objectClassInArray {
// JSON: { "id": 0, "tagName": "xxx" }
// Model: tagId / tagName
return @{@"data":[KBTagItemModel class]};
}
@end

View File

@@ -0,0 +1,20 @@
//
// KBTagItemModel.h
// keyBoard
//
// Created by Mac on 2025/12/8.
// 键盘里的model
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface KBTagItemModel : NSObject
@property (nonatomic, assign) NSInteger tagId; // 对应 JSON 里的 id
@property (nonatomic, assign) NSInteger characterId; // 对应 JSON 里的 id
@property (nonatomic, copy) NSString *characterName;
@property (nonatomic, copy) NSString *emoji;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,36 @@
//
// KBTagItemModel.m
// keyBoard
//
// Created by Mac on 2025/12/8.
//
#import "KBTagItemModel.h"
#import <MJExtension/MJExtension.h>
@implementation KBTagItemModel
// null -> @""
//- (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property {
// if (oldValue == nil || [oldValue isKindOfClass:[NSNull class]]) {
// return @""; // null ""
// }
// return oldValue;
//}
- (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property{
if (oldValue == nil || [oldValue isKindOfClass:[NSNull class]]) {
return @""; // null ""
}
return oldValue;
}
+ (NSDictionary *)mj_replacedKeyFromPropertyName {
// JSON: { "id": 0, "tagName": "xxx" }
// Model: tagId / tagName
return @{
@"tagId" : @"id",
};
}
@end