-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
feat(api): Add comprehensive REST API for Project Boards #36008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SupenBysz
wants to merge
4
commits into
go-gitea:main
Choose a base branch
from
SupenBysz:feature/project-board-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,564
−1
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
3538141
feat(api): add comprehensive REST API for Project Boards
SupenBysz 5bf4c88
Merge branch 'main' into feature/project-board-api
SupenBysz f2e8f6d
Merge branch 'main' into feature/project-board-api
SupenBysz ced5258
Merge branch 'main' into feature/project-board-api
SupenBysz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| // Copyright 2025 The Gitea Authors. All rights reserved. | ||
| // SPDX-License-Identifier: MIT | ||
|
|
||
| package structs | ||
|
|
||
| import ( | ||
| "time" | ||
| ) | ||
|
|
||
| // Project represents a project | ||
| // swagger:model | ||
| type Project struct { | ||
| // Unique identifier of the project | ||
| ID int64 `json:"id"` | ||
| // Project title | ||
| Title string `json:"title"` | ||
| // Project description | ||
| Description string `json:"description"` | ||
| // Owner ID (for organization or user projects) | ||
| OwnerID int64 `json:"owner_id,omitempty"` | ||
| // Repository ID (for repository projects) | ||
| RepoID int64 `json:"repo_id,omitempty"` | ||
| // Creator ID | ||
| CreatorID int64 `json:"creator_id"` | ||
| // Whether the project is closed | ||
| IsClosed bool `json:"is_closed"` | ||
| // Template type: 0=none, 1=basic_kanban, 2=bug_triage | ||
| TemplateType int `json:"template_type"` | ||
| // Card type: 0=text_only, 1=images_and_text | ||
| CardType int `json:"card_type"` | ||
| // Project type: 1=individual, 2=repository, 3=organization | ||
| Type int `json:"type"` | ||
| // Number of open issues | ||
| NumOpenIssues int64 `json:"num_open_issues,omitempty"` | ||
| // Number of closed issues | ||
| NumClosedIssues int64 `json:"num_closed_issues,omitempty"` | ||
| // Total number of issues | ||
| NumIssues int64 `json:"num_issues,omitempty"` | ||
| // Created time | ||
| // swagger:strfmt date-time | ||
| Created time.Time `json:"created"` | ||
| // Updated time | ||
| // swagger:strfmt date-time | ||
| Updated time.Time `json:"updated"` | ||
| // Closed time | ||
| // swagger:strfmt date-time | ||
| ClosedDate *time.Time `json:"closed_date,omitempty"` | ||
| // Project URL | ||
| URL string `json:"url,omitempty"` | ||
| } | ||
|
|
||
| // CreateProjectOption represents options for creating a project | ||
| // swagger:model | ||
| type CreateProjectOption struct { | ||
| // required: true | ||
| Title string `json:"title" binding:"Required"` | ||
| // Project description | ||
| Description string `json:"description"` | ||
| // Template type: 0=none, 1=basic_kanban, 2=bug_triage | ||
| TemplateType int `json:"template_type"` | ||
| // Card type: 0=text_only, 1=images_and_text | ||
| CardType int `json:"card_type"` | ||
| } | ||
|
|
||
| // EditProjectOption represents options for editing a project | ||
| // swagger:model | ||
| type EditProjectOption struct { | ||
| // Project title | ||
| Title *string `json:"title,omitempty"` | ||
| // Project description | ||
| Description *string `json:"description,omitempty"` | ||
| // Card type: 0=text_only, 1=images_and_text | ||
| CardType *int `json:"card_type,omitempty"` | ||
| // Whether the project is closed | ||
| IsClosed *bool `json:"is_closed,omitempty"` | ||
| } | ||
|
|
||
| // ProjectColumn represents a project column (board) | ||
| // swagger:model | ||
| type ProjectColumn struct { | ||
| // Unique identifier of the column | ||
| ID int64 `json:"id"` | ||
| // Column title | ||
| Title string `json:"title"` | ||
| // Whether this is the default column | ||
| Default bool `json:"default"` | ||
| // Sorting order | ||
| Sorting int `json:"sorting"` | ||
| // Column color (hex format) | ||
| Color string `json:"color,omitempty"` | ||
| // Project ID | ||
| ProjectID int64 `json:"project_id"` | ||
| // Creator ID | ||
| CreatorID int64 `json:"creator_id"` | ||
| // Number of issues in this column | ||
| NumIssues int64 `json:"num_issues,omitempty"` | ||
| // Created time | ||
| // swagger:strfmt date-time | ||
| Created time.Time `json:"created"` | ||
| // Updated time | ||
| // swagger:strfmt date-time | ||
| Updated time.Time `json:"updated"` | ||
| } | ||
|
|
||
| // CreateProjectColumnOption represents options for creating a project column | ||
| // swagger:model | ||
| type CreateProjectColumnOption struct { | ||
| // required: true | ||
| Title string `json:"title" binding:"Required"` | ||
| // Column color (hex format, e.g., #FF0000) | ||
| Color string `json:"color,omitempty"` | ||
| } | ||
|
|
||
| // EditProjectColumnOption represents options for editing a project column | ||
| // swagger:model | ||
| type EditProjectColumnOption struct { | ||
| // Column title | ||
| Title *string `json:"title,omitempty"` | ||
| // Column color (hex format) | ||
| Color *string `json:"color,omitempty"` | ||
| // Sorting order | ||
| Sorting *int `json:"sorting,omitempty"` | ||
| } | ||
|
|
||
| // MoveProjectColumnOption represents options for moving a project column | ||
| // swagger:model | ||
| type MoveProjectColumnOption struct { | ||
| // Position to move the column to (0-based index) | ||
| // required: true | ||
| Position int `json:"position" binding:"Required"` | ||
| } | ||
|
|
||
| // AddIssueToProjectColumnOption represents options for adding an issue to a project column | ||
| // swagger:model | ||
| type AddIssueToProjectColumnOption struct { | ||
| // Issue ID to add to the column | ||
| // required: true | ||
| IssueID int64 `json:"issue_id" binding:"Required"` | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So that the function name should be
AddOrUpdatexxxx?