feat: tag routes

This commit is contained in:
ericprd
2025-03-01 20:00:54 +08:00
parent 613379c8a5
commit acd80480dd
19 changed files with 336 additions and 8 deletions
+11
View File
@@ -0,0 +1,11 @@
package database
import "time"
type Category struct {
ID string `gorm:"primaryKey;not null" json:"id"`
Code string `gorm:"not null" json:"code"`
Name string `gorm:"not null" json:"name"`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
}
+2
View File
@@ -43,5 +43,7 @@ func (db *DB) Migrate() error {
&SubscribePlan{},
&Subscribe{},
&User{},
&Tag{},
&Category{},
)
}
@@ -4,7 +4,7 @@ import (
"time"
)
type Tags struct {
type Tag struct {
ID string `gorm:"primaryKey;not null" json:"id"`
Code string `gorm:"not null" json:"code"`
Name string `gorm:"not null" json:"name"`