22 lines
397 B
Go
22 lines
397 B
Go
package models
|
|
|
|
import (
|
|
u "gocommunity.ru/workshop/internal/utils"
|
|
"github.com/jinzhu/gorm"
|
|
)
|
|
|
|
type Client struct {
|
|
gorm.Model
|
|
Bonuse Bonuse `json:"bonus_id"`
|
|
Name string `json:"name"`
|
|
Vehicles []Vehicle `json:"vehicles"`
|
|
}
|
|
|
|
func (client *Client) CreateClient() map[string]interface{} {
|
|
|
|
GetDB().Create(client)
|
|
|
|
resp := u.Message(true, "success")
|
|
resp["client"] = client
|
|
return resp
|
|
} |