feat:完善用户项目模块数据模型

This commit is contained in:
henry
2021-11-29 14:55:53 +08:00
parent fb5a3d910b
commit 998b78fb23
7 changed files with 304 additions and 1 deletions

26
app/common/init2.go Normal file
View 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(""))
}