feat:完善用户项目模块数据模型
This commit is contained in:
26
app/common/init2.go
Normal file
26
app/common/init2.go
Normal file
@ -0,0 +1,26 @@
|
||||
package common
|
||||
|
||||
type Model struct {
|
||||
TableName string
|
||||
}
|
||||
|
||||
type Option func(model *Model)
|
||||
|
||||
func withModel(tableName string) Option {
|
||||
return func(model *Model) {
|
||||
model.TableName = tableName
|
||||
}
|
||||
}
|
||||
|
||||
func NewModel(option ...Option) *Model {
|
||||
out := new(Model)
|
||||
|
||||
for _, v := range option {
|
||||
v(out)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func Test() {
|
||||
NewModel(withModel(""))
|
||||
}
|
Reference in New Issue
Block a user