package main import ( "fmt" "service/codecreate/consts" "service/codecreate/generator" ) func main() { genSource := &generator.GenSource{ EntityName: "Zone", ModuleName: "zone", EntityCNName: "空间", ErrCodeSeq: "33", } generator.CreateFileDirectory(genSource) genSource.InPath = consts.EntityInPath genSource.OutPath = fmt.Sprintf("%v%v%v.go", consts.RootPath, consts.EntityOutPath, genSource.ModuleName) generator.GenerateEntity(genSource) genSource.InPath = consts.IdGeneratorInPath genSource.OutPath = fmt.Sprintf("%v%v%v_idgenerator.go", consts.RootPath, consts.IdgeneratorOutPath, genSource.ModuleName) generator.GenerateModule(genSource) genSource.InPath = consts.MongoInPath genSource.OutPath = fmt.Sprintf("%v%v%v_mongo.go", consts.RootPath, consts.MongoOutPath, genSource.ModuleName) generator.GenerateModule(genSource) genSource.InPath = consts.ProtoInPath genSource.OutPath = fmt.Sprintf("%v%v%v/proto/%v_op.go", consts.RootPath, consts.ProtoOutPath, genSource.ModuleName, genSource.ModuleName) generator.GenerateModule(genSource) genSource.InPath = consts.ServiceInPath genSource.OutPath = fmt.Sprintf("%v%v%v.go", consts.RootPath, consts.ServiceOutPath, genSource.ModuleName) generator.GenerateModule(genSource) genSource.InPath = consts.ServiceCenterInPath genSource.OutPath = fmt.Sprintf("%v%v%v_service_center.go", consts.RootPath, consts.ServiceCenterOutPath, genSource.ModuleName) generator.GenerateModule(genSource) genSource.InPath = consts.ErrCodeInPath genSource.OutPath = fmt.Sprintf("%v%v%v_errcode.go", consts.RootPath, consts.ErrcodeOutPath, genSource.ModuleName) generator.GenerateModule(genSource) genSource.InPath = consts.ControllerInPath genSource.OutPath = fmt.Sprintf("%v%v%v_op.go", consts.RootPath, consts.ControllerOutPath, genSource.ModuleName) generator.GenerateModule(genSource) genSource.InPath = consts.ControllerCenterInPath genSource.OutPath = fmt.Sprintf("%v%v%v_controller_center.go", consts.RootPath, consts.ControllerCenterOutPath, genSource.ModuleName) generator.GenerateModule(genSource) }