Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { Id int64 `json:"id,omitempty"` Name string `json:"name,omitempty"` Manufacturer string `json:"manufacturer,omitempty"` Carrier string `json:"carrier,omitempty"` Os string `json:"os,omitempty"` Size string `json:"size,omitempty"` Resolution string `json:"resolution,omitempty"` Memory string `json:"memory,omitempty"` DateOfRelease int64 `json:"dataOfRelease,omitempty"` Other string `json:"other,omitempty"` CreatedAt int64 `json:"createdAt,omitempty"` UpdatedAt int64 `json:"updatedAt,omitempty"` DeletedAt int64 `json:"deletedAt,omitempty"` User User `json:"user,omitempty"` // One-To-One relationship (has one) UserId int64 `json:"user_id,omitempty"` // Foreign key of User DeviceStates []DeviceState `json:"device_states,omitempty"` // One-To-Many relationship (has many) State bool `json:"state"` }
*
- 端末モデル
func (*Device) BeforeCreate ¶
func (*Device) BeforeDelete ¶
func (*Device) BeforeUpdate ¶
type DeviceState ¶
type DeviceState struct { Id int64 `json:"id,omitempty"` DeviceId int64 `json:"device_id,omitempty"` // Foreign key for Device (belongs to) State bool `json:"state"` User User `json:"user,omitempty"` // One-To-One relationship (has one) UserId int64 `json:"user_id,omitempty"` // Foreign key of User CreatedAt int64 `json:"createdAt,omitempty"` }
*
- 貸出、返却
func (*DeviceState) BeforeCreate ¶
func (d *DeviceState) BeforeCreate() (err error)
type User ¶
type User struct { Id int64 `json:"id,omitempty"` Name string `json:"name,omitempty"` CreatedAt int64 `json:"createdAt,omitempty"` UpdatedAt int64 `json:"updatedAt,omitempty"` DeletedAt int64 `json:"deletedAt,omitempty"` }
*
- ユーザーモデル
func (*User) BeforeCreate ¶
func (*User) BeforeDelete ¶
func (*User) BeforeUpdate ¶
Click to show internal directories.
Click to hide internal directories.