feat: add categories admin UI with CRUD
Wire up categories service, add CategoriesHandler with full CRUD, create index/edit templates, register routes in server.go, and add Categories nav link. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3c80f63a55
commit
ffa86b12e9
6 changed files with 198 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ import (
|
|||
"lmika.dev/lmika/weiro/providers/db"
|
||||
"lmika.dev/lmika/weiro/providers/uploadfiles"
|
||||
"lmika.dev/lmika/weiro/services/auth"
|
||||
"lmika.dev/lmika/weiro/services/categories"
|
||||
"lmika.dev/lmika/weiro/services/posts"
|
||||
"lmika.dev/lmika/weiro/services/publisher"
|
||||
"lmika.dev/lmika/weiro/services/sites"
|
||||
|
|
@ -21,6 +22,7 @@ type Services struct {
|
|||
Posts *posts.Service
|
||||
Sites *sites.Service
|
||||
Uploads *uploads.Service
|
||||
Categories *categories.Service
|
||||
}
|
||||
|
||||
func New(cfg config.Config) (*Services, error) {
|
||||
|
|
@ -37,6 +39,7 @@ func New(cfg config.Config) (*Services, error) {
|
|||
postService := posts.New(dbp, publisherQueue)
|
||||
siteService := sites.New(dbp)
|
||||
uploadService := uploads.New(dbp, ufp, filepath.Join(cfg.ScratchDir, "uploads", "pending"))
|
||||
categoriesService := categories.New(dbp, publisherQueue)
|
||||
|
||||
return &Services{
|
||||
DB: dbp,
|
||||
|
|
@ -46,6 +49,7 @@ func New(cfg config.Config) (*Services, error) {
|
|||
Posts: postService,
|
||||
Sites: siteService,
|
||||
Uploads: uploadService,
|
||||
Categories: categoriesService,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue