update samples

This commit is contained in:
William Cheng 2022-05-03 13:38:23 +08:00
parent af60ec7d04
commit 1e48c95d48
6 changed files with 162 additions and 162 deletions

View File

@ -69,9 +69,9 @@ bool ApiResponse::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("code"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("code")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
int32_t refVal_code; int32_t refVal_setCode;
ok &= ModelBase::fromJson(fieldValue, refVal_code); ok &= ModelBase::fromJson(fieldValue, refVal_setCode);
setCode(refVal_code); setCode(refVal_setCode);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("type")))) if(val.has_field(utility::conversions::to_string_t(U("type"))))
@ -79,9 +79,9 @@ bool ApiResponse::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("type"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("type")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
utility::string_t refVal_type; utility::string_t refVal_setType;
ok &= ModelBase::fromJson(fieldValue, refVal_type); ok &= ModelBase::fromJson(fieldValue, refVal_setType);
setType(refVal_type); setType(refVal_setType);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("message")))) if(val.has_field(utility::conversions::to_string_t(U("message"))))
@ -89,9 +89,9 @@ bool ApiResponse::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("message"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("message")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
utility::string_t refVal_message; utility::string_t refVal_setMessage;
ok &= ModelBase::fromJson(fieldValue, refVal_message); ok &= ModelBase::fromJson(fieldValue, refVal_setMessage);
setMessage(refVal_message); setMessage(refVal_setMessage);
} }
} }
return ok; return ok;
@ -129,21 +129,21 @@ bool ApiResponse::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, co
if(multipart->hasContent(utility::conversions::to_string_t(U("code")))) if(multipart->hasContent(utility::conversions::to_string_t(U("code"))))
{ {
int32_t refVal_code; int32_t refVal_setCode;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("code"))), refVal_code ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("code"))), refVal_setCode );
setCode(refVal_code); setCode(refVal_setCode);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("type")))) if(multipart->hasContent(utility::conversions::to_string_t(U("type"))))
{ {
utility::string_t refVal_type; utility::string_t refVal_setType;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("type"))), refVal_type ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("type"))), refVal_setType );
setType(refVal_type); setType(refVal_setType);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("message")))) if(multipart->hasContent(utility::conversions::to_string_t(U("message"))))
{ {
utility::string_t refVal_message; utility::string_t refVal_setMessage;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("message"))), refVal_message ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("message"))), refVal_setMessage );
setMessage(refVal_message); setMessage(refVal_setMessage);
} }
return ok; return ok;
} }

View File

@ -63,9 +63,9 @@ bool Category::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
int64_t refVal_id; int64_t refVal_setId;
ok &= ModelBase::fromJson(fieldValue, refVal_id); ok &= ModelBase::fromJson(fieldValue, refVal_setId);
setId(refVal_id); setId(refVal_setId);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("name")))) if(val.has_field(utility::conversions::to_string_t(U("name"))))
@ -73,9 +73,9 @@ bool Category::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("name"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("name")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
utility::string_t refVal_name; utility::string_t refVal_setName;
ok &= ModelBase::fromJson(fieldValue, refVal_name); ok &= ModelBase::fromJson(fieldValue, refVal_setName);
setName(refVal_name); setName(refVal_setName);
} }
} }
return ok; return ok;
@ -109,15 +109,15 @@ bool Category::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const
if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) if(multipart->hasContent(utility::conversions::to_string_t(U("id"))))
{ {
int64_t refVal_id; int64_t refVal_setId;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_id ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId );
setId(refVal_id); setId(refVal_setId);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("name")))) if(multipart->hasContent(utility::conversions::to_string_t(U("name"))))
{ {
utility::string_t refVal_name; utility::string_t refVal_setName;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_name ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName );
setName(refVal_name); setName(refVal_setName);
} }
return ok; return ok;
} }

View File

@ -87,9 +87,9 @@ bool Order::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
int64_t refVal_id; int64_t refVal_setId;
ok &= ModelBase::fromJson(fieldValue, refVal_id); ok &= ModelBase::fromJson(fieldValue, refVal_setId);
setId(refVal_id); setId(refVal_setId);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("petId")))) if(val.has_field(utility::conversions::to_string_t(U("petId"))))
@ -97,9 +97,9 @@ bool Order::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("petId"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("petId")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
int64_t refVal_petId; int64_t refVal_setPetId;
ok &= ModelBase::fromJson(fieldValue, refVal_petId); ok &= ModelBase::fromJson(fieldValue, refVal_setPetId);
setPetId(refVal_petId); setPetId(refVal_setPetId);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("quantity")))) if(val.has_field(utility::conversions::to_string_t(U("quantity"))))
@ -107,9 +107,9 @@ bool Order::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("quantity"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("quantity")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
int32_t refVal_quantity; int32_t refVal_setQuantity;
ok &= ModelBase::fromJson(fieldValue, refVal_quantity); ok &= ModelBase::fromJson(fieldValue, refVal_setQuantity);
setQuantity(refVal_quantity); setQuantity(refVal_setQuantity);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("shipDate")))) if(val.has_field(utility::conversions::to_string_t(U("shipDate"))))
@ -117,9 +117,9 @@ bool Order::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("shipDate"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("shipDate")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
utility::datetime refVal_shipDate; utility::datetime refVal_setShipDate;
ok &= ModelBase::fromJson(fieldValue, refVal_shipDate); ok &= ModelBase::fromJson(fieldValue, refVal_setShipDate);
setShipDate(refVal_shipDate); setShipDate(refVal_setShipDate);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("status")))) if(val.has_field(utility::conversions::to_string_t(U("status"))))
@ -127,9 +127,9 @@ bool Order::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("status"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("status")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
utility::string_t refVal_status; utility::string_t refVal_setStatus;
ok &= ModelBase::fromJson(fieldValue, refVal_status); ok &= ModelBase::fromJson(fieldValue, refVal_setStatus);
setStatus(refVal_status); setStatus(refVal_setStatus);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("complete")))) if(val.has_field(utility::conversions::to_string_t(U("complete"))))
@ -137,9 +137,9 @@ bool Order::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("complete"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("complete")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
bool refVal_complete; bool refVal_setComplete;
ok &= ModelBase::fromJson(fieldValue, refVal_complete); ok &= ModelBase::fromJson(fieldValue, refVal_setComplete);
setComplete(refVal_complete); setComplete(refVal_setComplete);
} }
} }
return ok; return ok;
@ -189,39 +189,39 @@ bool Order::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const ut
if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) if(multipart->hasContent(utility::conversions::to_string_t(U("id"))))
{ {
int64_t refVal_id; int64_t refVal_setId;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_id ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId );
setId(refVal_id); setId(refVal_setId);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("petId")))) if(multipart->hasContent(utility::conversions::to_string_t(U("petId"))))
{ {
int64_t refVal_petId; int64_t refVal_setPetId;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("petId"))), refVal_petId ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("petId"))), refVal_setPetId );
setPetId(refVal_petId); setPetId(refVal_setPetId);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("quantity")))) if(multipart->hasContent(utility::conversions::to_string_t(U("quantity"))))
{ {
int32_t refVal_quantity; int32_t refVal_setQuantity;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("quantity"))), refVal_quantity ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("quantity"))), refVal_setQuantity );
setQuantity(refVal_quantity); setQuantity(refVal_setQuantity);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("shipDate")))) if(multipart->hasContent(utility::conversions::to_string_t(U("shipDate"))))
{ {
utility::datetime refVal_shipDate; utility::datetime refVal_setShipDate;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("shipDate"))), refVal_shipDate ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("shipDate"))), refVal_setShipDate );
setShipDate(refVal_shipDate); setShipDate(refVal_setShipDate);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("status")))) if(multipart->hasContent(utility::conversions::to_string_t(U("status"))))
{ {
utility::string_t refVal_status; utility::string_t refVal_setStatus;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("status"))), refVal_status ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("status"))), refVal_setStatus );
setStatus(refVal_status); setStatus(refVal_setStatus);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("complete")))) if(multipart->hasContent(utility::conversions::to_string_t(U("complete"))))
{ {
bool refVal_complete; bool refVal_setComplete;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("complete"))), refVal_complete ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("complete"))), refVal_setComplete );
setComplete(refVal_complete); setComplete(refVal_setComplete);
} }
return ok; return ok;
} }

View File

@ -84,9 +84,9 @@ bool Pet::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
int64_t refVal_id; int64_t refVal_setId;
ok &= ModelBase::fromJson(fieldValue, refVal_id); ok &= ModelBase::fromJson(fieldValue, refVal_setId);
setId(refVal_id); setId(refVal_setId);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("category")))) if(val.has_field(utility::conversions::to_string_t(U("category"))))
@ -94,9 +94,9 @@ bool Pet::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("category"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("category")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
std::shared_ptr<Category> refVal_category; std::shared_ptr<Category> refVal_setCategory;
ok &= ModelBase::fromJson(fieldValue, refVal_category); ok &= ModelBase::fromJson(fieldValue, refVal_setCategory);
setCategory(refVal_category); setCategory(refVal_setCategory);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("name")))) if(val.has_field(utility::conversions::to_string_t(U("name"))))
@ -104,9 +104,9 @@ bool Pet::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("name"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("name")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
utility::string_t refVal_name; utility::string_t refVal_setName;
ok &= ModelBase::fromJson(fieldValue, refVal_name); ok &= ModelBase::fromJson(fieldValue, refVal_setName);
setName(refVal_name); setName(refVal_setName);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("photoUrls")))) if(val.has_field(utility::conversions::to_string_t(U("photoUrls"))))
@ -114,9 +114,9 @@ bool Pet::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("photoUrls"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("photoUrls")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
std::vector<utility::string_t> refVal_photoUrls; std::vector<utility::string_t> refVal_setPhotoUrls;
ok &= ModelBase::fromJson(fieldValue, refVal_photoUrls); ok &= ModelBase::fromJson(fieldValue, refVal_setPhotoUrls);
setPhotoUrls(refVal_photoUrls); setPhotoUrls(refVal_setPhotoUrls);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("tags")))) if(val.has_field(utility::conversions::to_string_t(U("tags"))))
@ -124,9 +124,9 @@ bool Pet::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("tags"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("tags")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
std::vector<std::shared_ptr<Tag>> refVal_tags; std::vector<std::shared_ptr<Tag>> refVal_setTags;
ok &= ModelBase::fromJson(fieldValue, refVal_tags); ok &= ModelBase::fromJson(fieldValue, refVal_setTags);
setTags(refVal_tags); setTags(refVal_setTags);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("status")))) if(val.has_field(utility::conversions::to_string_t(U("status"))))
@ -134,9 +134,9 @@ bool Pet::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("status"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("status")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
utility::string_t refVal_status; utility::string_t refVal_setStatus;
ok &= ModelBase::fromJson(fieldValue, refVal_status); ok &= ModelBase::fromJson(fieldValue, refVal_setStatus);
setStatus(refVal_status); setStatus(refVal_setStatus);
} }
} }
return ok; return ok;
@ -186,39 +186,39 @@ bool Pet::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const util
if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) if(multipart->hasContent(utility::conversions::to_string_t(U("id"))))
{ {
int64_t refVal_id; int64_t refVal_setId;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_id ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId );
setId(refVal_id); setId(refVal_setId);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("category")))) if(multipart->hasContent(utility::conversions::to_string_t(U("category"))))
{ {
std::shared_ptr<Category> refVal_category; std::shared_ptr<Category> refVal_setCategory;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("category"))), refVal_category ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("category"))), refVal_setCategory );
setCategory(refVal_category); setCategory(refVal_setCategory);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("name")))) if(multipart->hasContent(utility::conversions::to_string_t(U("name"))))
{ {
utility::string_t refVal_name; utility::string_t refVal_setName;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_name ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName );
setName(refVal_name); setName(refVal_setName);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("photoUrls")))) if(multipart->hasContent(utility::conversions::to_string_t(U("photoUrls"))))
{ {
std::vector<utility::string_t> refVal_photoUrls; std::vector<utility::string_t> refVal_setPhotoUrls;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("photoUrls"))), refVal_photoUrls ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("photoUrls"))), refVal_setPhotoUrls );
setPhotoUrls(refVal_photoUrls); setPhotoUrls(refVal_setPhotoUrls);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("tags")))) if(multipart->hasContent(utility::conversions::to_string_t(U("tags"))))
{ {
std::vector<std::shared_ptr<Tag>> refVal_tags; std::vector<std::shared_ptr<Tag>> refVal_setTags;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("tags"))), refVal_tags ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("tags"))), refVal_setTags );
setTags(refVal_tags); setTags(refVal_setTags);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("status")))) if(multipart->hasContent(utility::conversions::to_string_t(U("status"))))
{ {
utility::string_t refVal_status; utility::string_t refVal_setStatus;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("status"))), refVal_status ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("status"))), refVal_setStatus );
setStatus(refVal_status); setStatus(refVal_setStatus);
} }
return ok; return ok;
} }

View File

@ -63,9 +63,9 @@ bool Tag::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
int64_t refVal_id; int64_t refVal_setId;
ok &= ModelBase::fromJson(fieldValue, refVal_id); ok &= ModelBase::fromJson(fieldValue, refVal_setId);
setId(refVal_id); setId(refVal_setId);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("name")))) if(val.has_field(utility::conversions::to_string_t(U("name"))))
@ -73,9 +73,9 @@ bool Tag::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("name"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("name")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
utility::string_t refVal_name; utility::string_t refVal_setName;
ok &= ModelBase::fromJson(fieldValue, refVal_name); ok &= ModelBase::fromJson(fieldValue, refVal_setName);
setName(refVal_name); setName(refVal_setName);
} }
} }
return ok; return ok;
@ -109,15 +109,15 @@ bool Tag::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const util
if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) if(multipart->hasContent(utility::conversions::to_string_t(U("id"))))
{ {
int64_t refVal_id; int64_t refVal_setId;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_id ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId );
setId(refVal_id); setId(refVal_setId);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("name")))) if(multipart->hasContent(utility::conversions::to_string_t(U("name"))))
{ {
utility::string_t refVal_name; utility::string_t refVal_setName;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_name ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("name"))), refVal_setName );
setName(refVal_name); setName(refVal_setName);
} }
return ok; return ok;
} }

View File

@ -99,9 +99,9 @@ bool User::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("id")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
int64_t refVal_id; int64_t refVal_setId;
ok &= ModelBase::fromJson(fieldValue, refVal_id); ok &= ModelBase::fromJson(fieldValue, refVal_setId);
setId(refVal_id); setId(refVal_setId);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("username")))) if(val.has_field(utility::conversions::to_string_t(U("username"))))
@ -109,9 +109,9 @@ bool User::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("username"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("username")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
utility::string_t refVal_username; utility::string_t refVal_setUsername;
ok &= ModelBase::fromJson(fieldValue, refVal_username); ok &= ModelBase::fromJson(fieldValue, refVal_setUsername);
setUsername(refVal_username); setUsername(refVal_setUsername);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("firstName")))) if(val.has_field(utility::conversions::to_string_t(U("firstName"))))
@ -119,9 +119,9 @@ bool User::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("firstName"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("firstName")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
utility::string_t refVal_firstName; utility::string_t refVal_setFirstName;
ok &= ModelBase::fromJson(fieldValue, refVal_firstName); ok &= ModelBase::fromJson(fieldValue, refVal_setFirstName);
setFirstName(refVal_firstName); setFirstName(refVal_setFirstName);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("lastName")))) if(val.has_field(utility::conversions::to_string_t(U("lastName"))))
@ -129,9 +129,9 @@ bool User::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("lastName"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("lastName")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
utility::string_t refVal_lastName; utility::string_t refVal_setLastName;
ok &= ModelBase::fromJson(fieldValue, refVal_lastName); ok &= ModelBase::fromJson(fieldValue, refVal_setLastName);
setLastName(refVal_lastName); setLastName(refVal_setLastName);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("email")))) if(val.has_field(utility::conversions::to_string_t(U("email"))))
@ -139,9 +139,9 @@ bool User::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("email"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("email")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
utility::string_t refVal_email; utility::string_t refVal_setEmail;
ok &= ModelBase::fromJson(fieldValue, refVal_email); ok &= ModelBase::fromJson(fieldValue, refVal_setEmail);
setEmail(refVal_email); setEmail(refVal_setEmail);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("password")))) if(val.has_field(utility::conversions::to_string_t(U("password"))))
@ -149,9 +149,9 @@ bool User::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("password"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("password")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
utility::string_t refVal_password; utility::string_t refVal_setPassword;
ok &= ModelBase::fromJson(fieldValue, refVal_password); ok &= ModelBase::fromJson(fieldValue, refVal_setPassword);
setPassword(refVal_password); setPassword(refVal_setPassword);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("phone")))) if(val.has_field(utility::conversions::to_string_t(U("phone"))))
@ -159,9 +159,9 @@ bool User::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("phone"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("phone")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
utility::string_t refVal_phone; utility::string_t refVal_setPhone;
ok &= ModelBase::fromJson(fieldValue, refVal_phone); ok &= ModelBase::fromJson(fieldValue, refVal_setPhone);
setPhone(refVal_phone); setPhone(refVal_setPhone);
} }
} }
if(val.has_field(utility::conversions::to_string_t(U("userStatus")))) if(val.has_field(utility::conversions::to_string_t(U("userStatus"))))
@ -169,9 +169,9 @@ bool User::fromJson(const web::json::value& val)
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("userStatus"))); const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("userStatus")));
if(!fieldValue.is_null()) if(!fieldValue.is_null())
{ {
int32_t refVal_userStatus; int32_t refVal_setUserStatus;
ok &= ModelBase::fromJson(fieldValue, refVal_userStatus); ok &= ModelBase::fromJson(fieldValue, refVal_setUserStatus);
setUserStatus(refVal_userStatus); setUserStatus(refVal_setUserStatus);
} }
} }
return ok; return ok;
@ -229,51 +229,51 @@ bool User::fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const uti
if(multipart->hasContent(utility::conversions::to_string_t(U("id")))) if(multipart->hasContent(utility::conversions::to_string_t(U("id"))))
{ {
int64_t refVal_id; int64_t refVal_setId;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_id ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("id"))), refVal_setId );
setId(refVal_id); setId(refVal_setId);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("username")))) if(multipart->hasContent(utility::conversions::to_string_t(U("username"))))
{ {
utility::string_t refVal_username; utility::string_t refVal_setUsername;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("username"))), refVal_username ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("username"))), refVal_setUsername );
setUsername(refVal_username); setUsername(refVal_setUsername);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("firstName")))) if(multipart->hasContent(utility::conversions::to_string_t(U("firstName"))))
{ {
utility::string_t refVal_firstName; utility::string_t refVal_setFirstName;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("firstName"))), refVal_firstName ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("firstName"))), refVal_setFirstName );
setFirstName(refVal_firstName); setFirstName(refVal_setFirstName);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("lastName")))) if(multipart->hasContent(utility::conversions::to_string_t(U("lastName"))))
{ {
utility::string_t refVal_lastName; utility::string_t refVal_setLastName;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("lastName"))), refVal_lastName ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("lastName"))), refVal_setLastName );
setLastName(refVal_lastName); setLastName(refVal_setLastName);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("email")))) if(multipart->hasContent(utility::conversions::to_string_t(U("email"))))
{ {
utility::string_t refVal_email; utility::string_t refVal_setEmail;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("email"))), refVal_email ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("email"))), refVal_setEmail );
setEmail(refVal_email); setEmail(refVal_setEmail);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("password")))) if(multipart->hasContent(utility::conversions::to_string_t(U("password"))))
{ {
utility::string_t refVal_password; utility::string_t refVal_setPassword;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("password"))), refVal_password ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("password"))), refVal_setPassword );
setPassword(refVal_password); setPassword(refVal_setPassword);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("phone")))) if(multipart->hasContent(utility::conversions::to_string_t(U("phone"))))
{ {
utility::string_t refVal_phone; utility::string_t refVal_setPhone;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("phone"))), refVal_phone ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("phone"))), refVal_setPhone );
setPhone(refVal_phone); setPhone(refVal_setPhone);
} }
if(multipart->hasContent(utility::conversions::to_string_t(U("userStatus")))) if(multipart->hasContent(utility::conversions::to_string_t(U("userStatus"))))
{ {
int32_t refVal_userStatus; int32_t refVal_setUserStatus;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("userStatus"))), refVal_userStatus ); ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("userStatus"))), refVal_setUserStatus );
setUserStatus(refVal_userStatus); setUserStatus(refVal_setUserStatus);
} }
return ok; return ok;
} }