feat:Code generation configuration item
This commit is contained in:
1 parent
0ac2c2a423
commit
3846a95f12
1 file changed
+17
@@ -0,0 +1,17 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
import "github.com/spf13/viper"
|
||||||
|
|
||||||
|
type Gen struct {
|
||||||
|
DBName string
|
||||||
|
FrontPath string
|
||||||
|
}
|
||||||
|
|
||||||
|
func InitGen(cfg *viper.Viper) *Gen {
|
||||||
|
return &Gen{
|
||||||
|
DBName: cfg.GetString("dbname"),
|
||||||
|
FrontPath: cfg.GetString("frontpath"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var GenConfig = new(Gen)
|
||||||
Reference in new issue
Block a user