diff --git a/model/application.go b/model/application.go index da72f7e..339034b 100644 --- a/model/application.go +++ b/model/application.go @@ -6,18 +6,24 @@ package model // // swagger:model Application type Application struct { - // The application id. Can be used as `appToken`. See Authentication. + // The application id. + // + // read only: true + // required: true + // example: 5 + ID uint `gorm:"primary_key;unique_index;AUTO_INCREMENT" json:"id"` + // The application token. Can be used as `appToken`. See Authentication. // // read only: true // required: true // example: AWH0wZ5r0Mbac.r - ID string `gorm:"primary_key;unique_index" json:"id"` - UserID uint `gorm:"index" json:"-"` + Token string `gorm:"unique_index" json:"token"` + UserID uint `gorm:"index" json:"-"` // The application name. This is how the application should be displayed to the user. // // required: true // example: Backup Server - Name string `form:"name" query:"name" json:"name" binding:"required"` + Name string `form:"name" query:"name" json:"name" binding:"required"` // The description of the application. // // required: true diff --git a/model/client.go b/model/client.go index f6723cf..b666746 100644 --- a/model/client.go +++ b/model/client.go @@ -6,16 +6,22 @@ package model // // swagger:model Client type Client struct { - // The client id. Can be used as `clientToken`. See Authentication. + // The client id. + // + // read only: true + // required: true + // example: 5 + ID uint `gorm:"primary_key;unique_index;AUTO_INCREMENT" json:"id"` + // The client token. Can be used as `clientToken`. See Authentication. // // read only: true // required: true // example: CWH0wZ5r0Mbac.r - ID string `gorm:"primary_key;unique_index" json:"id"` + Token string `gorm:"unique_index" json:"token"` UserID uint `gorm:"index" json:"-"` // The client name. This is how the client should be displayed to the user. // // required: true // example: Android Phone - Name string `form:"name" query:"name" json:"name" binding:"required"` + Name string `form:"name" query:"name" json:"name" binding:"required"` } diff --git a/model/message.go b/model/message.go index 7c7bd84..7607160 100644 --- a/model/message.go +++ b/model/message.go @@ -13,31 +13,31 @@ type Message struct { // read only: true // required: true // example: 25 - ID uint `gorm:"AUTO_INCREMENT;primary_key;index" json:"id"` + ID uint `gorm:"AUTO_INCREMENT;primary_key;index" json:"id"` // The application id that send this message. // // read only: true // required: true - // example: AWH0wZ5r0Mbac.r - ApplicationID string `json:"appid"` + // example: 5 + ApplicationID uint `json:"appid"` // The actual message. // // required: true // example: Backup was successfully finished. - Message string `form:"message" query:"message" json:"message" binding:"required"` + Message string `form:"message" query:"message" json:"message" binding:"required"` // The title of the message. // // required: true // example: Backup - Title string `form:"title" query:"title" json:"title" binding:"required"` + Title string `form:"title" query:"title" json:"title" binding:"required"` // The priority of the message. // // example: 2 - Priority int `form:"priority" query:"priority" json:"priority"` + Priority int `form:"priority" query:"priority" json:"priority"` // The date the message was created. // // read only: true // required: true // example: 2018-02-27T19:36:10.5045044+01:00 - Date time.Time `json:"date"` + Date time.Time `json:"date"` }