feat/modules: 更新模块引用并添加 Redis 配置
- 更新 go.work 文件,添加 modules 引用 - 修改 logic/main.go,增加 Redis 模式监听 - 更新 login/main.go,引入 modules 模块 - 修改 manifest/config/config.yaml,添加 Redis 配置信息
This commit is contained in:
35
modules/blazing/model/demo_goods.go
Normal file
35
modules/blazing/model/demo_goods.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
)
|
||||
|
||||
const TableNameDemoGoods = "demo_goods"
|
||||
|
||||
// DemoGoods mapped from table <demo_goods>
|
||||
type DemoGoods struct {
|
||||
*cool.Model
|
||||
Name string `gorm:"not null" json:"name"`
|
||||
}
|
||||
|
||||
// TableName DemoGoods's table name
|
||||
func (*DemoGoods) TableName() string {
|
||||
return TableNameDemoGoods
|
||||
}
|
||||
|
||||
// GroupName DemoGoods's table group
|
||||
func (*DemoGoods) GroupName() string {
|
||||
return "default"
|
||||
}
|
||||
|
||||
// NewDemoGoods create a new DemoGoods
|
||||
func NewDemoGoods() *DemoGoods {
|
||||
return &DemoGoods{
|
||||
Model: cool.NewModel(),
|
||||
}
|
||||
}
|
||||
|
||||
// init 创建表
|
||||
func init() {
|
||||
cool.CreateTable(&DemoGoods{})
|
||||
}
|
||||
35
modules/blazing/model/demo_sample.go
Normal file
35
modules/blazing/model/demo_sample.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
)
|
||||
|
||||
const TableNameDemoSample = "demo_sample"
|
||||
|
||||
// DemoSample mapped from table <demo_sample>
|
||||
type DemoSample struct {
|
||||
*cool.Model
|
||||
// Name string `gorm:"column:name;not null;comment:名称" json:"name"`
|
||||
}
|
||||
|
||||
// TableName DemoSample's table name
|
||||
func (*DemoSample) TableName() string {
|
||||
return TableNameDemoSample
|
||||
}
|
||||
|
||||
// GroupName DemoSample's table group
|
||||
func (*DemoSample) GroupName() string {
|
||||
return "default"
|
||||
}
|
||||
|
||||
// NewDemoSample create a new DemoSample
|
||||
func NewDemoSample() *DemoSample {
|
||||
return &DemoSample{
|
||||
Model: cool.NewModel(),
|
||||
}
|
||||
}
|
||||
|
||||
// init 创建表
|
||||
func init() {
|
||||
cool.CreateTable(&DemoSample{})
|
||||
}
|
||||
Reference in New Issue
Block a user