Add ID to model.Client & model.Application
This commit is contained in:
parent
a26e2cf216
commit
6aa10ad917
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"`
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue