Added docs via swagger
This commit is contained in:
@ -7,8 +7,65 @@ import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func AddList(c echo.Context) error {
|
||||
// swagger:operation PUT /lists lists addList
|
||||
// ---
|
||||
// summary: Creates a new list owned by the currently logged in user
|
||||
// consumes:
|
||||
// - application/json
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
// - name: body
|
||||
// in: body
|
||||
// schema:
|
||||
// "$ref": "#/definitions/List"
|
||||
// responses:
|
||||
// "200":
|
||||
// "$ref": "#/responses/List"
|
||||
// "400":
|
||||
// "$ref": "#/responses/Message"
|
||||
// "403":
|
||||
// "$ref": "#/responses/Message"
|
||||
// "500":
|
||||
// "$ref": "#/responses/Message"
|
||||
|
||||
return addOrUpdateList(c)
|
||||
}
|
||||
|
||||
func UpdateList(c echo.Context) error {
|
||||
// swagger:operation POST /lists/{listID} lists upadteList
|
||||
// ---
|
||||
// summary: Updates a list
|
||||
// consumes:
|
||||
// - application/json
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
// - name: listID
|
||||
// in: path
|
||||
// description: ID of the list to update
|
||||
// type: string
|
||||
// required: true
|
||||
// - name: body
|
||||
// in: body
|
||||
// schema:
|
||||
// "$ref": "#/definitions/List"
|
||||
// responses:
|
||||
// "200":
|
||||
// "$ref": "#/responses/List"
|
||||
// "400":
|
||||
// "$ref": "#/responses/Message"
|
||||
// "403":
|
||||
// "$ref": "#/responses/Message"
|
||||
// "500":
|
||||
// "$ref": "#/responses/Message"
|
||||
|
||||
return addOrUpdateList(c)
|
||||
}
|
||||
|
||||
// AddOrUpdateList Adds or updates a new list
|
||||
func AddOrUpdateList(c echo.Context) error {
|
||||
func addOrUpdateList(c echo.Context) error {
|
||||
|
||||
// Get the list
|
||||
var list *models.List
|
||||
|
Reference in New Issue
Block a user