func ToBasicJSON(image *models.Image) *jsonschema.Image {
	newImageJSON := jsonschema.Image{
		Checksum:  image.Checksum,
		CreatedAt: json.JSONTime{Time: image.CreatedAt.Timestamp},
		UpdatedAt: json.JSONTime{Time: image.UpdatedAt.Timestamp},
	}

	if image.Title.Valid {
		newImageJSON.Title = image.Title.String
	}

	if image.Rating.Valid {
		newImageJSON.Rating = int(image.Rating.Int64)
	}

	newImageJSON.Organized = image.Organized
	newImageJSON.OCounter = image.OCounter

	newImageJSON.File = getImageFileJSON(image)

	return &newImageJSON
}
// ToBasicJSON converts a image object into its JSON object equivalent. It
// does not convert the relationships to other objects, with the exception
// of cover image.
ToBasicJSON converts a image object into its JSON object equivalent. It
does not convert the relationships to other objects, with the exception
of cover image.
// ToBasicJSON converts a image object into its JSON object equivalent . It // does not convert the relationships to other objects with the exception // of cover image .
func ToBasicJSON(image *models.Image) *jsonschema.Image {
	newImageJSON := jsonschema.Image{
		Checksum:  image.Checksum,
		CreatedAt: json.JSONTime{Time: image.CreatedAt.Timestamp},
		UpdatedAt: json.JSONTime{Time: image.UpdatedAt.Timestamp},
	}
	if image.Title.Valid {
		newImageJSON.Title = image.Title.String
	}
	if image.Rating.Valid {
		newImageJSON.Rating = int(image.Rating.Int64)
	}
	newImageJSON.Organized = image.Organized
	newImageJSON.OCounter = image.OCounter
	newImageJSON.File = getImageFileJSON(image)
	return &newImageJSON
}
func ToBasicJSON ( image * models . Image ) * jsonschema . Image { newImageJSON := jsonschema . Image { Checksum : image . Checksum , CreatedAt : json . JSONTime { Time : image . CreatedAt . Timestamp } , UpdatedAt : json . JSONTime { Time : image . UpdatedAt . Timestamp } , } if image . Title . Valid { newImageJSON . Title = image . Title . String } if image . Rating . Valid { newImageJSON . Rating = int ( image . Rating . Int64 ) } newImageJSON . Organized = image . Organized newImageJSON . OCounter = image . OCounter newImageJSON . File = getImageFileJSON ( image ) return & newImageJSON }
ToBasicJSON converts a image object into its JSON object equivalent.
ToBasicJSON converts a image object into its JSON object equivalent .