package models import ( u "gocommunity.ru/workshop/internal/utils" "github.com/jinzhu/gorm" ) type Service struct { gorm.Model Price string `json:"email"` Name string `json:"name"` Description string `json:"description"` } func (service *Service) CreateService() map[string]interface{} { GetDB().Create(service) resp := u.Message(true, "success") resp["service"] = service return resp }