Skip to content

Commit

Permalink
update swagger model for PluginConf
Browse files Browse the repository at this point in the history
  • Loading branch information
eternal-flame-AD committed Jan 9, 2019
1 parent f70ac8e commit ff77c4e
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
39 changes: 39 additions & 0 deletions docs/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1617,6 +1617,45 @@
},
"x-go-package": "github.com/gotify/server/model"
},
"PluginConf": {
"description": "Holds information about a plugin instance for one user.",
"type": "object",
"title": "PluginConfExternal Model",
"required": [
"user_id",
"token"
],
"properties": {
"enabled": {
"description": "Whether the plugin instance is enabled.",
"type": "boolean",
"x-go-name": "Enabled",
"example": true
},
"file_name": {
"description": "The file name of the plugin.",
"type": "string",
"x-go-name": "FileName",
"example": "rss.so"
},
"token": {
"description": "The user name. For login.",
"type": "string",
"x-go-name": "Token",
"example": "P1234"
},
"user_id": {
"description": "The user id.",
"type": "integer",
"format": "uint64",
"x-go-name": "UserID",
"readOnly": true,
"example": 25
}
},
"x-go-name": "PluginConfExternal",
"x-go-package": "github.com/gotify/server/model"
},
"User": {
"description": "The User holds information about permission and other stuff.",
"type": "object",
Expand Down
27 changes: 27 additions & 0 deletions model/pluginconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,30 @@ type PluginConf struct {
Enabled bool
Config []byte
}

// PluginConfExternal Model
//
// Holds information about a plugin instance for one user.
//
// swagger:model PluginConf
type PluginConfExternal struct {
// The user id.
//
// read only: true
// required: true
// example: 25
UserID uint `json:"user_id"`
// The user name. For login.
//
// required: true
// example: P1234
Token string `binding:"required" json:"token" query:"token" form:"token"`
// The file name of the plugin.
//
// example: rss.so
FileName string `json:"file_name" form:"admin" query:"admin"`
// Whether the plugin instance is enabled.
//
// example: true
Enabled bool `json:"enabled"`
}

0 comments on commit ff77c4e

Please sign in to comment.