//
//  RDSSystemParameterModel.m
//  Temperature
//
//  Created by 姓二名哈字富贵儿 on 2023/8/30.
//

#import "RDSSystemParameterModel.h"

@implementation RDSSystemParameterModel

- (instancetype)init {
    self = [super init];
    if (self) {
        self.nameValue = @"感谢使用五恒健康系统";
    }
    return self;
}

+ (NSDictionary *)mj_replacedKeyFromPropertyName {
    return @{@"nameValue": @"value"};
}

+ (void)rds_getWelcomeMessageFinished:(void (^)(RDSSystemParameterModel * _Nullable, NSError * _Nullable))finished {
    [RDSDemoApiHelper rds_getWelcomeMessageSuccess:^(id responseObject) {
        if ([responseObject[@"code"] intValue] == 0) {
            NSDictionary *data = responseObject[@"data"];
            RDSSystemParameterModel *model = [RDSSystemParameterModel mj_objectWithKeyValues:data];
            BLOCK_SAFE_RUN(finished, model, nil)
        } else{
            NSError *error = [NSError errorWithDomain:responseObject[@"message"] code:[responseObject[@"code"] intValue] userInfo:nil];
            BLOCK_SAFE_RUN(finished, nil, error)
        }
    } failure:^(NSError *error) {
        BLOCK_SAFE_RUN(finished, nil, error)
    }];
}

@end
