Javascript: fix the constructFromObject issue

Closes #1721
Also fixed indentations in models
This commit is contained in:
xhh 2015-12-17 21:29:05 +08:00
parent a58f755a6a
commit 1b0294dac0
6 changed files with 288 additions and 270 deletions

View File

@ -35,6 +35,9 @@ var {{classname}} = function {{classname}}({{#mandatory}}{{this}}{{^-last}}, {{/
{{/vars}}
self.constructFromObject = function(data) {
if (!data) {
return;
}
{{#vars}}
self.{{name}}{{{defaultValueWithParam}}}
{{/vars}}

View File

@ -31,6 +31,9 @@ var Category = function Category() {
self.constructFromObject = function(data) {
if (!data) {
return;
}
self.id = data.id;

View File

@ -80,6 +80,9 @@ var Order = function Order() {
self.constructFromObject = function(data) {
if (!data) {
return;
}
self.id = data.id;

View File

@ -84,6 +84,9 @@ var Pet = function Pet(photoUrls, name) {
self.constructFromObject = function(data) {
if (!data) {
return;
}
self.id = data.id;

View File

@ -31,6 +31,9 @@ var Tag = function Tag() {
self.constructFromObject = function(data) {
if (!data) {
return;
}
self.id = data.id;

View File

@ -62,6 +62,9 @@ var User = function User() {
self.constructFromObject = function(data) {
if (!data) {
return;
}
self.id = data.id;