e43359d566
Backport of project board API endpoints to the 1.25.5 release branch. Adds full CRUD for projects, columns, and issue cards. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
103 lines
2.9 KiB
Go
103 lines
2.9 KiB
Go
// Copyright 2026 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package structs
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// Project represents a project
|
|
// swagger:model
|
|
type Project struct {
|
|
ID int64 `json:"id"`
|
|
Title string `json:"title"`
|
|
Description string `json:"description"`
|
|
OwnerID int64 `json:"owner_id,omitempty"`
|
|
RepoID int64 `json:"repo_id,omitempty"`
|
|
CreatorID int64 `json:"creator_id"`
|
|
IsClosed bool `json:"is_closed"`
|
|
// swagger:strfmt date-time
|
|
Created time.Time `json:"created_at"`
|
|
// swagger:strfmt date-time
|
|
Updated time.Time `json:"updated_at"`
|
|
// swagger:strfmt date-time
|
|
Closed *time.Time `json:"closed_at,omitempty"`
|
|
}
|
|
|
|
// CreateProjectOption options for creating a project
|
|
// swagger:model
|
|
type CreateProjectOption struct {
|
|
// required: true
|
|
Title string `json:"title" binding:"Required"`
|
|
// Description of the project
|
|
Description string `json:"description"`
|
|
// BoardType: 0=none, 1=basic kanban, 2=bug triage
|
|
BoardType uint8 `json:"board_type"`
|
|
// CardType: 0=text only, 1=images and text
|
|
CardType uint8 `json:"card_type"`
|
|
}
|
|
|
|
// EditProjectOption options for editing a project
|
|
// swagger:model
|
|
type EditProjectOption struct {
|
|
Title *string `json:"title"`
|
|
Description *string `json:"description"`
|
|
}
|
|
|
|
// ProjectColumn represents a project column (board)
|
|
// swagger:model
|
|
type ProjectColumn struct {
|
|
ID int64 `json:"id"`
|
|
Title string `json:"title"`
|
|
Sorting int8 `json:"sorting"`
|
|
Color string `json:"color"`
|
|
ProjectID int64 `json:"project_id"`
|
|
Default bool `json:"default"`
|
|
// swagger:strfmt date-time
|
|
Created time.Time `json:"created_at"`
|
|
// swagger:strfmt date-time
|
|
Updated time.Time `json:"updated_at"`
|
|
}
|
|
|
|
// CreateProjectColumnOption options for creating a project column
|
|
// swagger:model
|
|
type CreateProjectColumnOption struct {
|
|
// required: true
|
|
Title string `json:"title" binding:"Required"`
|
|
Color string `json:"color"`
|
|
}
|
|
|
|
// EditProjectColumnOption options for editing a project column
|
|
// swagger:model
|
|
type EditProjectColumnOption struct {
|
|
Title *string `json:"title"`
|
|
Color *string `json:"color"`
|
|
Sorting *int8 `json:"sorting"`
|
|
}
|
|
|
|
// ProjectColumnIssue represents an issue on a project column
|
|
// swagger:model
|
|
type ProjectColumnIssue struct {
|
|
ID int64 `json:"id"`
|
|
IssueID int64 `json:"issue_id"`
|
|
ProjectID int64 `json:"project_id"`
|
|
ColumnID int64 `json:"column_id"`
|
|
Sorting int64 `json:"sorting"`
|
|
}
|
|
|
|
// AddProjectColumnIssueOption options for adding an issue to a project column
|
|
// swagger:model
|
|
type AddProjectColumnIssueOption struct {
|
|
// required: true
|
|
IssueID int64 `json:"issue_id" binding:"Required"`
|
|
}
|
|
|
|
// MoveProjectColumnIssueOption options for moving an issue between columns
|
|
// swagger:model
|
|
type MoveProjectColumnIssueOption struct {
|
|
// required: true
|
|
ColumnID int64 `json:"column_id" binding:"Required"`
|
|
Sorting int64 `json:"sorting"`
|
|
}
|