Task collection improvements #109
|
@ -34,23 +34,6 @@ type TaskCollection struct {
|
||||||
web.Rights `xorm:"-" json:"-"`
|
web.Rights `xorm:"-" json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadAll gets all tasks for a user
|
|
||||||
// @Summary Get tasks
|
|
||||||
// @Description Returns all tasks on any list the user has access to.
|
|
||||||
// @tags task
|
|
||||||
// @Accept json
|
|
||||||
// @Produce json
|
|
||||||
// @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned."
|
|
||||||
// @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page."
|
|
||||||
// @Param s query string false "Search tasks by task text."
|
|
||||||
// @Param sort query string false "The sorting parameter. Possible values to sort by are priority, prioritydesc, priorityasc, duedate, duedatedesc, duedateasc."
|
|
||||||
// @Param startdate query int false "The start date parameter to filter by. Expects a unix timestamp. If no end date, but a start date is specified, the end date is set to the current time."
|
|
||||||
// @Param enddate query int false "The end date parameter to filter by. Expects a unix timestamp. If no start date, but an end date is specified, the start date is set to the current time."
|
|
||||||
// @Security JWTKeyAuth
|
|
||||||
// @Success 200 {array} models.Task "The tasks"
|
|
||||||
// @Failure 500 {object} models.Message "Internal error"
|
|
||||||
// @Router /tasks/all [get]
|
|
||||||
|
|
||||||
// ReadAll gets all tasks for a collection
|
// ReadAll gets all tasks for a collection
|
||||||
// @Summary Get tasks on a list
|
// @Summary Get tasks on a list
|
||||||
// @Description Returns all tasks for the current list.
|
// @Description Returns all tasks for the current list.
|
||||||
|
|
|
@ -126,6 +126,26 @@ type taskOptions struct {
|
||||||
perPage int
|
perPage int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ReadAll is a dummy function to still have that endpoint documented
|
||||||
|
// @Summary Get tasks
|
||||||
|
// @Description Returns all tasks on any list the user has access to.
|
||||||
|
// @tags task
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned."
|
||||||
|
// @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page."
|
||||||
|
// @Param s query string false "Search tasks by task text."
|
||||||
|
// @Param sort query string false "The sorting parameter. Possible values to sort by are priority, prioritydesc, priorityasc, duedate, duedatedesc, duedateasc."
|
||||||
|
// @Param startdate query int false "The start date parameter to filter by. Expects a unix timestamp. If no end date, but a start date is specified, the end date is set to the current time."
|
||||||
|
// @Param enddate query int false "The end date parameter to filter by. Expects a unix timestamp. If no start date, but an end date is specified, the start date is set to the current time."
|
||||||
|
// @Security JWTKeyAuth
|
||||||
|
// @Success 200 {array} models.Task "The tasks"
|
||||||
|
// @Failure 500 {object} models.Message "Internal error"
|
||||||
|
// @Router /tasks/all [get]
|
||||||
|
func (t *Task) ReadAll(a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, totalItems int64, err error) {
|
||||||
|
return nil, 0, 0, nil
|
||||||
|
}
|
||||||
|
|
||||||
func getRawTasksForLists(lists []*List, opts *taskOptions) (taskMap map[int64]*Task, resultCount int, totalItems int64, err error) {
|
func getRawTasksForLists(lists []*List, opts *taskOptions) (taskMap map[int64]*Task, resultCount int, totalItems int64, err error) {
|
||||||
|
|
||||||
// Get all list IDs and get the tasks
|
// Get all list IDs and get the tasks
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
||||||
// This file was generated by swaggo/swag at
|
// This file was generated by swaggo/swag at
|
||||||
// 2019-11-29 18:11:53.766019702 +0100 CET m=+0.153156633
|
// 2019-12-01 13:20:36.822585642 +0100 CET m=+0.129079038
|
||||||
|
|
||||||
package swagger
|
package swagger
|
||||||
|
|
||||||
|
@ -407,7 +407,7 @@ var doc = `{
|
||||||
"JWTKeyAuth": []
|
"JWTKeyAuth": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Returns a team by its ID.",
|
"description": "Returns a list by its ID.",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
|
@ -415,13 +415,13 @@ var doc = `{
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"team"
|
"list"
|
||||||
],
|
],
|
||||||
"summary": "Gets one team",
|
"summary": "Gets one list",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"description": "Team ID",
|
"description": "List ID",
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"required": true
|
"required": true
|
||||||
|
@ -429,13 +429,13 @@ var doc = `{
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "The team",
|
"description": "The list",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/models.Team"
|
"$ref": "#/definitions/models.List"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"403": {
|
"403": {
|
||||||
"description": "The user does not have access to the team",
|
"description": "The user does not have access to the list",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/code.vikunja.io.web.HTTPError"
|
"$ref": "#/definitions/code.vikunja.io.web.HTTPError"
|
||||||
}
|
}
|
||||||
|
|
|
@ -389,7 +389,7 @@
|
||||||
"JWTKeyAuth": []
|
"JWTKeyAuth": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Returns a team by its ID.",
|
"description": "Returns a list by its ID.",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
|
@ -397,13 +397,13 @@
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"team"
|
"list"
|
||||||
],
|
],
|
||||||
"summary": "Gets one team",
|
"summary": "Gets one list",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"description": "Team ID",
|
"description": "List ID",
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"required": true
|
"required": true
|
||||||
|
@ -411,13 +411,13 @@
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "The team",
|
"description": "The list",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/models.Team"
|
"$ref": "#/definitions/models.List"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"403": {
|
"403": {
|
||||||
"description": "The user does not have access to the team",
|
"description": "The user does not have access to the list",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/code.vikunja.io/web.HTTPError"
|
"$ref": "#/definitions/code.vikunja.io/web.HTTPError"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1138,9 +1138,9 @@ paths:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: Returns a team by its ID.
|
description: Returns a list by its ID.
|
||||||
parameters:
|
parameters:
|
||||||
- description: Team ID
|
- description: List ID
|
||||||
in: path
|
in: path
|
||||||
name: id
|
name: id
|
||||||
required: true
|
required: true
|
||||||
|
@ -1149,11 +1149,11 @@ paths:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: The team
|
description: The list
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/models.Team'
|
$ref: '#/definitions/models.List'
|
||||||
"403":
|
"403":
|
||||||
description: The user does not have access to the team
|
description: The user does not have access to the list
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/code.vikunja.io/web.HTTPError'
|
$ref: '#/definitions/code.vikunja.io/web.HTTPError'
|
||||||
"500":
|
"500":
|
||||||
|
@ -1162,9 +1162,9 @@ paths:
|
||||||
$ref: '#/definitions/models.Message'
|
$ref: '#/definitions/models.Message'
|
||||||
security:
|
security:
|
||||||
- JWTKeyAuth: []
|
- JWTKeyAuth: []
|
||||||
summary: Gets one team
|
summary: Gets one list
|
||||||
tags:
|
tags:
|
||||||
- team
|
- list
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
|
|
Loading…
Reference in New Issue