Example #1
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
}