backend: add bookmark CRUD with public list endpoint
New bookmarks feature: domain model, repository, service and handler supporting list/create/update/delete. Public endpoint exposes the admin user's bookmarks for the homepage navigation grid; authenticated endpoints scope by user. Dev Dockerfile drops air for plain `go run` and uses goproxy.cn to avoid build failures on the deploy host. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
16
backend/internal/domain/bookmark.go
Normal file
16
backend/internal/domain/bookmark.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package domain
|
||||
|
||||
import "time"
|
||||
|
||||
type Bookmark struct {
|
||||
ID uint `gorm:"primarykey" json:"id"`
|
||||
UserID uint `gorm:"not null;index" json:"userId"`
|
||||
Title string `gorm:"not null" json:"title"`
|
||||
URL string `gorm:"not null" json:"url"`
|
||||
Description string `json:"description"`
|
||||
Icon string `json:"icon"`
|
||||
Category string `gorm:"default:'默认'" json:"category"`
|
||||
SortOrder int `gorm:"default:0" json:"sortOrder"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
Reference in New Issue
Block a user