service/codecreate/codecreate.go

57 lines
2.1 KiB
Go
Raw Normal View History

2023-12-21 22:17:40 +08:00
package main
import (
"fmt"
"service/codecreate/consts"
"service/codecreate/generator"
)
func main() {
genSource := &generator.GenSource{
2024-08-30 16:34:00 +08:00
EntityName: "Notification",
ModuleName: "notification",
EntityCNName: "系统通知表",
2024-09-02 13:04:12 +08:00
ErrCodeSeq: "46",
2023-12-21 22:17:40 +08:00
}
2023-12-23 22:03:53 +08:00
generator.CreateFileDirectory(genSource)
2023-12-21 22:17:40 +08:00
genSource.InPath = consts.EntityInPath
genSource.OutPath = fmt.Sprintf("%v%v%v.go", consts.RootPath, consts.EntityOutPath, genSource.ModuleName)
generator.GenerateEntity(genSource)
2023-12-21 22:17:40 +08:00
genSource.InPath = consts.IdGeneratorInPath
genSource.OutPath = fmt.Sprintf("%v%v%v_idgenerator.go", consts.RootPath, consts.IdgeneratorOutPath, genSource.ModuleName)
generator.GenerateModule(genSource)
2023-12-21 22:17:40 +08:00
genSource.InPath = consts.MongoInPath
genSource.OutPath = fmt.Sprintf("%v%v%v_mongo.go", consts.RootPath, consts.MongoOutPath, genSource.ModuleName)
generator.GenerateModule(genSource)
2023-12-21 22:17:40 +08:00
2023-12-23 22:03:53 +08:00
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)
2023-12-21 22:17:40 +08:00
genSource.InPath = consts.ServiceInPath
genSource.OutPath = fmt.Sprintf("%v%v%v.go", consts.RootPath, consts.ServiceOutPath, genSource.ModuleName)
generator.GenerateModule(genSource)
2023-12-21 22:17:40 +08:00
genSource.InPath = consts.ServiceCenterInPath
genSource.OutPath = fmt.Sprintf("%v%v%v_service_center.go", consts.RootPath, consts.ServiceCenterOutPath, genSource.ModuleName)
generator.GenerateModule(genSource)
2023-12-21 22:17:40 +08:00
genSource.InPath = consts.ErrCodeInPath
genSource.OutPath = fmt.Sprintf("%v%v%v_errcode.go", consts.RootPath, consts.ErrcodeOutPath, genSource.ModuleName)
generator.GenerateModule(genSource)
2023-12-21 22:17:40 +08:00
genSource.InPath = consts.ControllerInPath
genSource.OutPath = fmt.Sprintf("%v%v%v_op.go", consts.RootPath, consts.ControllerOutPath, genSource.ModuleName)
generator.GenerateModule(genSource)
2023-12-21 22:17:40 +08:00
genSource.InPath = consts.ControllerCenterInPath
genSource.OutPath = fmt.Sprintf("%v%v%v_controller_center.go", consts.RootPath, consts.ControllerCenterOutPath, genSource.ModuleName)
generator.GenerateModule(genSource)
2023-12-21 22:17:40 +08:00
}