123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 |
- //
- // TeacherInfo.m
- //
- // Created by Steven on 2022/4/11
- // Copyright (c) 2022 __MyCompanyName__. All rights reserved.
- //
- #import "TeacherInfo.h"
- NSString *const kTeacherInfoBirthdate = @"birthdate";
- NSString *const kTeacherInfoGraduateSchool = @"graduateSchool";
- NSString *const kTeacherInfoWorkUnit = @"workUnit";
- NSString *const kTeacherInfoHeardUrl = @"heardUrl";
- NSString *const kTeacherInfoSubject = @"subject";
- NSString *const kTeacherInfoGradCertificate = @"gradCertificate";
- NSString *const kTeacherInfoDegreeCertificate = @"degreeCertificate";
- NSString *const kTeacherInfoTeacherCertificate = @"teacherCertificate";
- NSString *const kTeacherInfoMusicianAuthStatus = @"musicianAuthStatus";
- NSString *const kTeacherInfoEducationBackground = @"educationBackground";
- NSString *const kTeacherInfoUpdateTime = @"updateTime";
- NSString *const kTeacherInfoMusicianDate = @"musicianDate";
- NSString *const kTeacherInfoIsBank = @"isBank";
- NSString *const kTeacherInfoRealName = @"realName";
- NSString *const kTeacherInfoIntroduction = @"introduction";
- NSString *const kTeacherInfoStarGrade = @"starGrade";
- NSString *const kTeacherInfoUnExpTime = @"unExpTime";
- NSString *const kTeacherInfoEntryStatus = @"entryStatus";
- NSString *const kTeacherInfoEntryAuthDate = @"entryAuthDate";
- NSString *const kTeacherInfoSubjectId = @"subjectId";
- NSString *const kTeacherInfoUsername = @"username";
- NSString *const kTeacherInfoEntryFlag = @"entryFlag";
- NSString *const kTeacherInfoGender = @"gender";
- NSString *const kTeacherInfoFansNum = @"fansNum";
- NSString *const kTeacherInfoMusicianFlag = @"musicianFlag";
- NSString *const kTeacherInfoLiveFlag = @"liveFlag";
- NSString *const kTeacherInfoCreateTime = @"createTime";
- NSString *const kTeacherInfoExpTime = @"expTime";
- NSString *const kTeacherInfoTechnicalTitles = @"technicalTitles";
- NSString *const kTeacherInfoSubjectName = @"subjectName";
- NSString *const kTeacherInfoPhone = @"phone";
- NSString *const kTeacherInfoMemo = @"memo";
- NSString *const kTeacherInfoIsReal = @"isReal";
- NSString *const kTeacherInfoIdCardNo = @"idCardNo";
- NSString *const kTeacherInfoUserId = @"userId";
- @interface TeacherInfo ()
- - (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
- @end
- @implementation TeacherInfo
- @synthesize birthdate = _birthdate;
- @synthesize graduateSchool = _graduateSchool;
- @synthesize workUnit = _workUnit;
- @synthesize heardUrl = _heardUrl;
- @synthesize subject = _subject;
- @synthesize gradCertificate = _gradCertificate;
- @synthesize degreeCertificate = _degreeCertificate;
- @synthesize teacherCertificate = _teacherCertificate;
- @synthesize musicianAuthStatus = _musicianAuthStatus;
- @synthesize educationBackground = _educationBackground;
- @synthesize updateTime = _updateTime;
- @synthesize musicianDate = _musicianDate;
- @synthesize isBank = _isBank;
- @synthesize realName = _realName;
- @synthesize introduction = _introduction;
- @synthesize starGrade = _starGrade;
- @synthesize unExpTime = _unExpTime;
- @synthesize entryStatus = _entryStatus;
- @synthesize entryAuthDate = _entryAuthDate;
- @synthesize subjectId = _subjectId;
- @synthesize username = _username;
- @synthesize entryFlag = _entryFlag;
- @synthesize gender = _gender;
- @synthesize fansNum = _fansNum;
- @synthesize musicianFlag = _musicianFlag;
- @synthesize liveFlag = _liveFlag;
- @synthesize createTime = _createTime;
- @synthesize expTime = _expTime;
- @synthesize technicalTitles = _technicalTitles;
- @synthesize subjectName = _subjectName;
- @synthesize phone = _phone;
- @synthesize memo = _memo;
- @synthesize isReal = _isReal;
- @synthesize idCardNo = _idCardNo;
- @synthesize userId = _userId;
- + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
- {
- return [[self alloc] initWithDictionary:dict];
- }
- - (instancetype)initWithDictionary:(NSDictionary *)dict
- {
- self = [super init];
-
- // This check serves to make sure that a non-NSDictionary object
- // passed into the model class doesn't break the parsing.
- if(self && [dict isKindOfClass:[NSDictionary class]]) {
- self.birthdate = [self objectOrNilForKey:kTeacherInfoBirthdate fromDictionary:dict];
- self.graduateSchool = [self objectOrNilForKey:kTeacherInfoGraduateSchool fromDictionary:dict];
- self.workUnit = [self objectOrNilForKey:kTeacherInfoWorkUnit fromDictionary:dict];
- self.heardUrl = [self objectOrNilForKey:kTeacherInfoHeardUrl fromDictionary:dict];
- self.subject = [self objectOrNilForKey:kTeacherInfoSubject fromDictionary:dict];
- self.gradCertificate = [self objectOrNilForKey:kTeacherInfoGradCertificate fromDictionary:dict];
- self.degreeCertificate = [self objectOrNilForKey:kTeacherInfoDegreeCertificate fromDictionary:dict];
- self.teacherCertificate = [self objectOrNilForKey:kTeacherInfoTeacherCertificate fromDictionary:dict];
- self.musicianAuthStatus = [self objectOrNilForKey:kTeacherInfoMusicianAuthStatus fromDictionary:dict];
- self.educationBackground = [self objectOrNilForKey:kTeacherInfoEducationBackground fromDictionary:dict];
- self.updateTime = [self objectOrNilForKey:kTeacherInfoUpdateTime fromDictionary:dict];
- self.musicianDate = [self objectOrNilForKey:kTeacherInfoMusicianDate fromDictionary:dict];
- self.isBank = [[self objectOrNilForKey:kTeacherInfoIsBank fromDictionary:dict] doubleValue];
- self.realName = [self objectOrNilForKey:kTeacherInfoRealName fromDictionary:dict];
- self.introduction = [self objectOrNilForKey:kTeacherInfoIntroduction fromDictionary:dict];
- self.starGrade = [[self objectOrNilForKey:kTeacherInfoStarGrade fromDictionary:dict] doubleValue];
- self.unExpTime = [[self objectOrNilForKey:kTeacherInfoUnExpTime fromDictionary:dict] doubleValue];
- self.entryStatus = [self objectOrNilForKey:kTeacherInfoEntryStatus fromDictionary:dict];
- self.entryAuthDate = [self objectOrNilForKey:kTeacherInfoEntryAuthDate fromDictionary:dict];
- self.subjectId = [self objectOrNilForKey:kTeacherInfoSubjectId fromDictionary:dict];
- self.username = [self objectOrNilForKey:kTeacherInfoUsername fromDictionary:dict];
- self.entryFlag = [self objectOrNilForKey:kTeacherInfoEntryFlag fromDictionary:dict];
- self.gender = [self objectOrNilForKey:kTeacherInfoGender fromDictionary:dict];
- self.fansNum = [[self objectOrNilForKey:kTeacherInfoFansNum fromDictionary:dict] doubleValue];
- self.musicianFlag = [self objectOrNilForKey:kTeacherInfoMusicianFlag fromDictionary:dict];
- self.liveFlag = [self objectOrNilForKey:kTeacherInfoLiveFlag fromDictionary:dict];
- self.createTime = [self objectOrNilForKey:kTeacherInfoCreateTime fromDictionary:dict];
- self.expTime = [[self objectOrNilForKey:kTeacherInfoExpTime fromDictionary:dict] doubleValue];
- self.technicalTitles = [self objectOrNilForKey:kTeacherInfoTechnicalTitles fromDictionary:dict];
- self.subjectName = [self objectOrNilForKey:kTeacherInfoSubjectName fromDictionary:dict];
- self.phone = [self objectOrNilForKey:kTeacherInfoPhone fromDictionary:dict];
- self.memo = [self objectOrNilForKey:kTeacherInfoMemo fromDictionary:dict];
- self.isReal = [[self objectOrNilForKey:kTeacherInfoIsReal fromDictionary:dict] doubleValue];
- self.idCardNo = [self objectOrNilForKey:kTeacherInfoIdCardNo fromDictionary:dict];
- self.userId = [self objectOrNilForKey:kTeacherInfoUserId fromDictionary:dict];
- }
-
- return self;
-
- }
- - (NSDictionary *)dictionaryRepresentation
- {
- NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
- [mutableDict setValue:self.birthdate forKey:kTeacherInfoBirthdate];
- [mutableDict setValue:self.graduateSchool forKey:kTeacherInfoGraduateSchool];
- [mutableDict setValue:self.workUnit forKey:kTeacherInfoWorkUnit];
- [mutableDict setValue:self.heardUrl forKey:kTeacherInfoHeardUrl];
- [mutableDict setValue:self.subject forKey:kTeacherInfoSubject];
- [mutableDict setValue:self.gradCertificate forKey:kTeacherInfoGradCertificate];
- [mutableDict setValue:self.degreeCertificate forKey:kTeacherInfoDegreeCertificate];
- [mutableDict setValue:self.teacherCertificate forKey:kTeacherInfoTeacherCertificate];
- [mutableDict setValue:self.musicianAuthStatus forKey:kTeacherInfoMusicianAuthStatus];
- [mutableDict setValue:self.educationBackground forKey:kTeacherInfoEducationBackground];
- [mutableDict setValue:self.updateTime forKey:kTeacherInfoUpdateTime];
- [mutableDict setValue:self.musicianDate forKey:kTeacherInfoMusicianDate];
- [mutableDict setValue:[NSNumber numberWithDouble:self.isBank] forKey:kTeacherInfoIsBank];
- [mutableDict setValue:self.realName forKey:kTeacherInfoRealName];
- [mutableDict setValue:self.introduction forKey:kTeacherInfoIntroduction];
- [mutableDict setValue:[NSNumber numberWithDouble:self.starGrade] forKey:kTeacherInfoStarGrade];
- [mutableDict setValue:[NSNumber numberWithDouble:self.unExpTime] forKey:kTeacherInfoUnExpTime];
- [mutableDict setValue:self.entryStatus forKey:kTeacherInfoEntryStatus];
- [mutableDict setValue:self.entryAuthDate forKey:kTeacherInfoEntryAuthDate];
- [mutableDict setValue:self.subjectId forKey:kTeacherInfoSubjectId];
- [mutableDict setValue:self.username forKey:kTeacherInfoUsername];
- [mutableDict setValue:self.entryFlag forKey:kTeacherInfoEntryFlag];
- [mutableDict setValue:self.gender forKey:kTeacherInfoGender];
- [mutableDict setValue:[NSNumber numberWithDouble:self.fansNum] forKey:kTeacherInfoFansNum];
- [mutableDict setValue:self.musicianFlag forKey:kTeacherInfoMusicianFlag];
- [mutableDict setValue:self.liveFlag forKey:kTeacherInfoLiveFlag];
- [mutableDict setValue:self.createTime forKey:kTeacherInfoCreateTime];
- [mutableDict setValue:[NSNumber numberWithDouble:self.expTime] forKey:kTeacherInfoExpTime];
- [mutableDict setValue:self.technicalTitles forKey:kTeacherInfoTechnicalTitles];
- [mutableDict setValue:self.subjectName forKey:kTeacherInfoSubjectName];
- [mutableDict setValue:self.phone forKey:kTeacherInfoPhone];
- [mutableDict setValue:self.memo forKey:kTeacherInfoMemo];
- [mutableDict setValue:[NSNumber numberWithDouble:self.isReal] forKey:kTeacherInfoIsReal];
- [mutableDict setValue:self.idCardNo forKey:kTeacherInfoIdCardNo];
- [mutableDict setValue:self.userId forKey:kTeacherInfoUserId];
- return [NSDictionary dictionaryWithDictionary:mutableDict];
- }
- - (NSString *)description
- {
- return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
- }
- #pragma mark - Helper Method
- - (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
- {
- id object = [dict objectForKey:aKey];
- if ([object isKindOfClass:[NSNumber class]]) {
- NSNumber *number = object;
- object = [number stringValue];
- }
- return [object isEqual:[NSNull null]] ? nil : object;
- }
- #pragma mark - NSCoding Methods
- - (id)initWithCoder:(NSCoder *)aDecoder
- {
- self = [super init];
- self.birthdate = [aDecoder decodeObjectForKey:kTeacherInfoBirthdate];
- self.graduateSchool = [aDecoder decodeObjectForKey:kTeacherInfoGraduateSchool];
- self.workUnit = [aDecoder decodeObjectForKey:kTeacherInfoWorkUnit];
- self.heardUrl = [aDecoder decodeObjectForKey:kTeacherInfoHeardUrl];
- self.subject = [aDecoder decodeObjectForKey:kTeacherInfoSubject];
- self.gradCertificate = [aDecoder decodeObjectForKey:kTeacherInfoGradCertificate];
- self.degreeCertificate = [aDecoder decodeObjectForKey:kTeacherInfoDegreeCertificate];
- self.teacherCertificate = [aDecoder decodeObjectForKey:kTeacherInfoTeacherCertificate];
- self.musicianAuthStatus = [aDecoder decodeObjectForKey:kTeacherInfoMusicianAuthStatus];
- self.educationBackground = [aDecoder decodeObjectForKey:kTeacherInfoEducationBackground];
- self.updateTime = [aDecoder decodeObjectForKey:kTeacherInfoUpdateTime];
- self.musicianDate = [aDecoder decodeObjectForKey:kTeacherInfoMusicianDate];
- self.isBank = [aDecoder decodeDoubleForKey:kTeacherInfoIsBank];
- self.realName = [aDecoder decodeObjectForKey:kTeacherInfoRealName];
- self.introduction = [aDecoder decodeObjectForKey:kTeacherInfoIntroduction];
- self.starGrade = [aDecoder decodeDoubleForKey:kTeacherInfoStarGrade];
- self.unExpTime = [aDecoder decodeDoubleForKey:kTeacherInfoUnExpTime];
- self.entryStatus = [aDecoder decodeObjectForKey:kTeacherInfoEntryStatus];
- self.entryAuthDate = [aDecoder decodeObjectForKey:kTeacherInfoEntryAuthDate];
- self.subjectId = [aDecoder decodeObjectForKey:kTeacherInfoSubjectId];
- self.username = [aDecoder decodeObjectForKey:kTeacherInfoUsername];
- self.entryFlag = [aDecoder decodeObjectForKey:kTeacherInfoEntryFlag];
- self.gender = [aDecoder decodeObjectForKey:kTeacherInfoGender];
- self.fansNum = [aDecoder decodeDoubleForKey:kTeacherInfoFansNum];
- self.musicianFlag = [aDecoder decodeObjectForKey:kTeacherInfoMusicianFlag];
- self.liveFlag = [aDecoder decodeObjectForKey:kTeacherInfoLiveFlag];
- self.createTime = [aDecoder decodeObjectForKey:kTeacherInfoCreateTime];
- self.expTime = [aDecoder decodeDoubleForKey:kTeacherInfoExpTime];
- self.technicalTitles = [aDecoder decodeObjectForKey:kTeacherInfoTechnicalTitles];
- self.subjectName = [aDecoder decodeObjectForKey:kTeacherInfoSubjectName];
- self.phone = [aDecoder decodeObjectForKey:kTeacherInfoPhone];
- self.memo = [aDecoder decodeObjectForKey:kTeacherInfoMemo];
- self.isReal = [aDecoder decodeDoubleForKey:kTeacherInfoIsReal];
- self.idCardNo = [aDecoder decodeObjectForKey:kTeacherInfoIdCardNo];
- self.userId = [aDecoder decodeObjectForKey:kTeacherInfoUserId];
- return self;
- }
- - (void)encodeWithCoder:(NSCoder *)aCoder
- {
- [aCoder encodeObject:_birthdate forKey:kTeacherInfoBirthdate];
- [aCoder encodeObject:_graduateSchool forKey:kTeacherInfoGraduateSchool];
- [aCoder encodeObject:_workUnit forKey:kTeacherInfoWorkUnit];
- [aCoder encodeObject:_heardUrl forKey:kTeacherInfoHeardUrl];
- [aCoder encodeObject:_subject forKey:kTeacherInfoSubject];
- [aCoder encodeObject:_gradCertificate forKey:kTeacherInfoGradCertificate];
- [aCoder encodeObject:_degreeCertificate forKey:kTeacherInfoDegreeCertificate];
- [aCoder encodeObject:_teacherCertificate forKey:kTeacherInfoTeacherCertificate];
- [aCoder encodeObject:_musicianAuthStatus forKey:kTeacherInfoMusicianAuthStatus];
- [aCoder encodeObject:_educationBackground forKey:kTeacherInfoEducationBackground];
- [aCoder encodeObject:_updateTime forKey:kTeacherInfoUpdateTime];
- [aCoder encodeObject:_musicianDate forKey:kTeacherInfoMusicianDate];
- [aCoder encodeDouble:_isBank forKey:kTeacherInfoIsBank];
- [aCoder encodeObject:_realName forKey:kTeacherInfoRealName];
- [aCoder encodeObject:_introduction forKey:kTeacherInfoIntroduction];
- [aCoder encodeDouble:_starGrade forKey:kTeacherInfoStarGrade];
- [aCoder encodeDouble:_unExpTime forKey:kTeacherInfoUnExpTime];
- [aCoder encodeObject:_entryStatus forKey:kTeacherInfoEntryStatus];
- [aCoder encodeObject:_entryAuthDate forKey:kTeacherInfoEntryAuthDate];
- [aCoder encodeObject:_subjectId forKey:kTeacherInfoSubjectId];
- [aCoder encodeObject:_username forKey:kTeacherInfoUsername];
- [aCoder encodeObject:_entryFlag forKey:kTeacherInfoEntryFlag];
- [aCoder encodeObject:_gender forKey:kTeacherInfoGender];
- [aCoder encodeDouble:_fansNum forKey:kTeacherInfoFansNum];
- [aCoder encodeObject:_musicianFlag forKey:kTeacherInfoMusicianFlag];
- [aCoder encodeObject:_liveFlag forKey:kTeacherInfoLiveFlag];
- [aCoder encodeObject:_createTime forKey:kTeacherInfoCreateTime];
- [aCoder encodeDouble:_expTime forKey:kTeacherInfoExpTime];
- [aCoder encodeObject:_technicalTitles forKey:kTeacherInfoTechnicalTitles];
- [aCoder encodeObject:_subjectName forKey:kTeacherInfoSubjectName];
- [aCoder encodeObject:_phone forKey:kTeacherInfoPhone];
- [aCoder encodeObject:_memo forKey:kTeacherInfoMemo];
- [aCoder encodeDouble:_isReal forKey:kTeacherInfoIsReal];
- [aCoder encodeObject:_idCardNo forKey:kTeacherInfoIdCardNo];
- [aCoder encodeObject:_userId forKey:kTeacherInfoUserId];
- }
- - (id)copyWithZone:(NSZone *)zone
- {
- TeacherInfo *copy = [[TeacherInfo alloc] init];
-
- if (copy) {
- copy.birthdate = [self.birthdate copyWithZone:zone];
- copy.graduateSchool = [self.graduateSchool copyWithZone:zone];
- copy.workUnit = [self.workUnit copyWithZone:zone];
- copy.heardUrl = [self.heardUrl copyWithZone:zone];
- copy.subject = [self.subject copyWithZone:zone];
- copy.gradCertificate = [self.gradCertificate copyWithZone:zone];
- copy.degreeCertificate = [self.degreeCertificate copyWithZone:zone];
- copy.teacherCertificate = [self.teacherCertificate copyWithZone:zone];
- copy.musicianAuthStatus = [self.musicianAuthStatus copyWithZone:zone];
- copy.educationBackground = [self.educationBackground copyWithZone:zone];
- copy.updateTime = [self.updateTime copyWithZone:zone];
- copy.musicianDate = [self.musicianDate copyWithZone:zone];
- copy.isBank = self.isBank;
- copy.realName = [self.realName copyWithZone:zone];
- copy.introduction = [self.introduction copyWithZone:zone];
- copy.starGrade = self.starGrade;
- copy.unExpTime = self.unExpTime;
- copy.entryStatus = [self.entryStatus copyWithZone:zone];
- copy.entryAuthDate = [self.entryAuthDate copyWithZone:zone];
- copy.subjectId = [self.subjectId copyWithZone:zone];
- copy.username = [self.username copyWithZone:zone];
- copy.entryFlag = [self.entryFlag copyWithZone:zone];
- copy.gender = [self.gender copyWithZone:zone];
- copy.fansNum = self.fansNum;
- copy.musicianFlag = [self.musicianFlag copyWithZone:zone];
- copy.liveFlag = [self.liveFlag copyWithZone:zone];
- copy.createTime = [self.createTime copyWithZone:zone];
- copy.expTime = self.expTime;
- copy.technicalTitles = [self.technicalTitles copyWithZone:zone];
- copy.subjectName = [self.subjectName copyWithZone:zone];
- copy.phone = [self.phone copyWithZone:zone];
- copy.memo = [self.memo copyWithZone:zone];
- copy.isReal = self.isReal;
- copy.idCardNo = [self.idCardNo copyWithZone:zone];
- copy.userId = [self.userId copyWithZone:zone];
- }
-
- return copy;
- }
- @end
|