Exemple #1
0
func toBrandInput(brand *brands.Brand) (brandInput *duoerlapi.BrandInput) {
	brandInput = &duoerlapi.BrandInput{
		Id:        brand.Id.Hex(),
		Name:      brand.Name,
		Alias:     brand.Alias,
		Intro:     brand.Intro,
		Country:   brand.Country,
		Website:   brand.Website,
		Logo:      brand.LogoUrl(),
		ImageAttr: newBrandImageAttr(),
	}

	return
}
Exemple #2
0
func toApiBrand(brand *brands.Brand) *duoerlapi.Brand {
	apiBrand := new(duoerlapi.Brand)

	if brand != nil {
		apiBrand = &duoerlapi.Brand{
			Id:      brand.Id.Hex(),
			Link:    brand.Link(),
			Name:    brand.Name,
			Alias:   brand.Alias,
			Intro:   brand.Intro,
			Country: brand.Country,
			Website: brand.Website,
			Logo:    brand.LogoUrl(),
		}
	}

	return apiBrand
}