Skip to content

Commit 2c87a5b

Browse files
committed
add plugins folder
1 parent 2b8c512 commit 2c87a5b

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed

models/kanban.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// models/kanban.go
2+
package models
3+
4+
type KanbanBoard struct {
5+
ID int64 `xorm:"pk autoincr"`
6+
RepoID int64 `xorm:"INDEX NOT NULL"`
7+
Title string `xorm:"NOT NULL"`
8+
CreatedAt int64 `xorm:"created"`
9+
UpdatedAt int64 `xorm:"updated"`
10+
}
11+
12+
type KanbanColumn struct {
13+
ID int64 `xorm:"pk autoincr"`
14+
BoardID int64 `xorm:"INDEX NOT NULL"`
15+
Title string `xorm:"NOT NULL"`
16+
Order int `xorm:"NOT NULL DEFAULT 0"`
17+
CreatedAt int64 `xorm:"created"`
18+
UpdatedAt int64 `xorm:"updated"`
19+
}
20+
21+
type KanbanCard struct {
22+
ID int64 `xorm:"pk autoincr"`
23+
ColumnID int64 `xorm:"INDEX NOT NULL"`
24+
IssueID int64 `xorm:"INDEX"`
25+
Title string `xorm:"NOT NULL"`
26+
Description string `xorm:"TEXT"`
27+
Order int `xorm:"NOT NULL DEFAULT 0"`
28+
CreatedAt int64 `xorm:"created"`
29+
UpdatedAt int64 `xorm:"updated"`
30+
}

plugins/kanban/go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module kanban
2+
3+
go 1.24rc3

plugins/kanban/main.go

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package kanban
2+
3+
import (
4+
"code.gitea.io/gitea/modules/log"
5+
"code.gitea.io/gitea/modules/setting"
6+
"code.gitea.io/gitea/routers"
7+
"code.gitea.io/sdk/gitea"
8+
)
9+
10+
// Plugin represents a Gitea plugin
11+
type Plugin struct {
12+
Name string
13+
Description string
14+
Version string
15+
}
16+
17+
// Init initializes the plugin
18+
func (p *Plugin) Init() error {
19+
log.Info("Kanban plugin initialized")
20+
21+
// Register routes
22+
routers.Register("GET", "/api/v1/repos/:username/:reponame/kanban", GetKanbanHandler)
23+
routers.Register("POST", "/api/v1/repos/:username/:reponame/kanban", CreateKanbanHandler)
24+
25+
// Register templates
26+
// Add UI components
27+
28+
return nil
29+
}
30+
31+
func main() {
32+
plugin := &Plugin{
33+
Name: "Kanban Board",
34+
Description: "A Kanban board for Gitea projects",
35+
Version: "1.0.0",
36+
}
37+
38+
gitea.RegisterPlugin(plugin)
39+
}
40+
41+
// Handler functions
42+
func GetKanbanHandler(ctx *context.Context) {
43+
// Implementation
44+
}
45+
46+
func CreateKanbanHandler(ctx *context.Context) {
47+
// Implementation
48+
}

0 commit comments

Comments
 (0)