Documentation ¶
Index ¶
- Constants
- Variables
- func CamelCase(columnName string) (tagContent string)
- func ConnectDB(dsn string) (db *gorm.DB)
- func CopyFile(srcFile string, dstFile string, isReplace bool)
- func FileExist(path string) bool
- func GenerateApis(config *GenConfig, model *DbModel)
- func GenerateAutomigrate(config *GenConfig, models []*DbModel)
- func GenerateBizCode(config *GenConfig, model *DbModel)
- func GenerateDalCodes(conn *gorm.DB, config *GenConfig)
- func GenerateDataSources(config *GenConfig)
- func GenerateFolders(conf *GenConfig)
- func GetTemplate(key string) string
- func ReadFile(file string) string
- func StartGen(configFile string)
- func StartGenConfig(config *GenConfig)
- func WriteFile(fileName string, content string)
- type DbModel
- type DbModelFieldAndColumn
- type GenConfig
- type GenConfigDataSource
- type GenConfigField
- type GenConfigGen
- type GenConfigGenApi
- type GenConfigGenBiz
- type GenConfigGenDal
- type GenConfigGenDataSource
- type GenConfigGenRuoyiVue3
- type GenConfigGenRuoyiVueMenu
- type GenConfigGenVueElementAdmin
- type GenConfigMysql
- type GenConfigRunDml
- type GenConfigTable
- type RuoyiVue3GenType
- func (v *RuoyiVue3GenType) GenApiJs(config *GenConfig, model *DbModel)
- func (v *RuoyiVue3GenType) GenChildMenusSql(config *GenConfig, models []*DbModel)
- func (v *RuoyiVue3GenType) GenTopMenusSql(config *GenConfig)
- func (v *RuoyiVue3GenType) GenVueViews(config *GenConfig, model *DbModel)
- func (v *RuoyiVue3GenType) GenerateRuoyiVue3Codes(config *GenConfig, model *DbModel)
- func (v *RuoyiVue3GenType) GenerateVueRouter(config *GenConfig, models []*DbModel)
- type VueElementAdminGenType
- func (v *VueElementAdminGenType) GenVueClientApis(config *GenConfig, model *DbModel)
- func (v *VueElementAdminGenType) GenVueViews(config *GenConfig, model *DbModel)
- func (v *VueElementAdminGenType) GenerateVueCodes(config *GenConfig, model *DbModel)
- func (v *VueElementAdminGenType) GenerateVueRouter(config *GenConfig, models []*DbModel)
Constants ¶
View Source
const ( TemplateResponseModelKey = "responseModel" TemplateDatasourceKey = "datasource" TemplateBizKey = "biz" TemplateBizDeletedKey = "bizDeleted" TemplateApiKey = "api" TemplateApirouterKey = "apirouter" TemplateApirouterDeletedKey = "apiRouterDeleted" TemplateApiQueryAllKey = "apiQueryAll" TemplateApiQueryByConditionKey = "apiQueryByCondition" TemplateApiCreateBatchKey = "apiCreateBatch" TemplateApiCreateKey = "apiCreate" TemplateApiUpdateBatchKey = "apiUpdateBatch" TemplateApiUpdateKey = "apiUpdate" TemplateApiRemoveKey = "apiRemove" TemplateApiDeletedKey = "apiDeleted" TemplateVueElementAdminApiKey = "vueElementAdminApi" TemplateVueElementAdminApiDeletedColumnKey = "vueElementAdminApiDeletedColumn" TemplateVueElementAdminViewKey = "vueElementAdminView" TemplateVueElementAdminRouterKey = "vueElementAdminRouter" TemplateRuoyiVue3ApiKey = "ruoniVue3Api" TemplateRuoyiVue3ApiDeletedColumnKey = "ruoniVue3ApiDeletedColumn" TemplateRuoyiVue3ViewKey = "ruoniVue3View" TemplateRuoyiVue3MenuKey = "ruoniVue3Menu" )
Variables ¶
View Source
var (
DataSourceTemplateContent = ""
)
View Source
var (
RuoyiVue3Gen = &RuoyiVue3GenType{}
)
View Source
var ( TemplateFiles map[string]string = map[string]string{ TemplateResponseModelKey: app.RUNTIME_PATH + "/template/model/response/model_list_response.template", TemplateDatasourceKey: app.RUNTIME_PATH + "/template/dal/datasources.template", TemplateBizKey: app.RUNTIME_PATH + "/template/biz/biz.template", TemplateBizDeletedKey: app.RUNTIME_PATH + "/template/biz/biz_deleted_column.template", TemplateApiKey: app.RUNTIME_PATH + "/template/api/api.template", TemplateApirouterKey: app.RUNTIME_PATH + "/template/api/api_router.template", TemplateApirouterDeletedKey: app.RUNTIME_PATH + "/template/api/api_router_deleted.template", TemplateApiQueryAllKey: app.RUNTIME_PATH + "/template/api/api_query_all.template", TemplateApiQueryByConditionKey: app.RUNTIME_PATH + "/template/api/api_query_by_condition.template", TemplateApiCreateBatchKey: app.RUNTIME_PATH + "/template/api/api_create_batch.template", TemplateApiCreateKey: app.RUNTIME_PATH + "/template/api/api_create.template", TemplateApiUpdateBatchKey: app.RUNTIME_PATH + "/template/api/api_update_batch.template", TemplateApiUpdateKey: app.RUNTIME_PATH + "/template/api/api_update.template", TemplateApiRemoveKey: app.RUNTIME_PATH + "/template/api/api_remove.template", TemplateApiDeletedKey: app.RUNTIME_PATH + "/template/api/api_deleted_column.template", TemplateVueElementAdminApiKey: app.RUNTIME_PATH + "/template/vue_element_admin/vue_api.template", TemplateVueElementAdminApiDeletedColumnKey: app.RUNTIME_PATH + "/template/vue_element_admin/vue_api_deleted_column.template", TemplateVueElementAdminViewKey: app.RUNTIME_PATH + "/template/vue_element_admin/vue_view.template", TemplateVueElementAdminRouterKey: app.RUNTIME_PATH + "/template/vue_element_admin/vue_router.template", TemplateRuoyiVue3ApiKey: app.RUNTIME_PATH + "/template/ruoyi_vue3/api.js.template", TemplateRuoyiVue3ApiDeletedColumnKey: app.RUNTIME_PATH + "/template/ruoyi_vue3/api_deleted_column.template", TemplateRuoyiVue3ViewKey: app.RUNTIME_PATH + "/template/ruoyi_vue3/index.vue.template", TemplateRuoyiVue3MenuKey: app.RUNTIME_PATH + "/template/ruoyi_vue3/menu.sql.template", } )
View Source
var (
VueElementAdminGen = &VueElementAdminGenType{}
)
Functions ¶
func GenerateApis ¶
func GenerateAutomigrate ¶
func GenerateBizCode ¶
func GenerateDalCodes ¶
func GenerateDataSources ¶
func GenerateDataSources(config *GenConfig)
func GenerateFolders ¶
func GenerateFolders(conf *GenConfig)
func GetTemplate ¶
func StartGenConfig ¶
func StartGenConfig(config *GenConfig)
Types ¶
type DbModel ¶
type DbModel struct { StructName string TableName string PrivatePropertyName string PrimaryKeyPropertyName string PathName string Fields []*DbModelFieldAndColumn }
func (*DbModel) HasDeletedColumn ¶
type DbModelFieldAndColumn ¶
type GenConfig ¶
type GenConfig struct { MySql *GenConfigMysql `yaml:"mysql"` Gen *GenConfigGen `yaml:"gen"` }
type GenConfigDataSource ¶
type GenConfigField ¶
type GenConfigGen ¶
type GenConfigGen struct { DmlFolder string `yaml:"dmlFolder"` RunDml *GenConfigRunDml `yaml:"runDml"` GenRuoyiVue3 *GenConfigGenRuoyiVue3 `yaml:"genRuoyiVue3"` GenVueElementAdmin *GenConfigGenVueElementAdmin `yaml:"genVueElementAdmin"` GenApi *GenConfigGenApi `yaml:"genApi"` GenBiz *GenConfigGenBiz `yaml:"genBiz"` GenDataSource *GenConfigGenDataSource `yaml:"genDataSource"` GenDal *GenConfigGenDal `yaml:"genDal"` DataSources []*GenConfigDataSource `yaml:"dataSources"` GenTables []*GenConfigTable `yaml:"genTables"` OutputRoot string `yaml:"outputRoot"` PackageRoot string `yaml:"packageRoot"` }
type GenConfigGenApi ¶
type GenConfigGenApi struct { Enable bool `yaml:"enable"` OverWrite bool `yaml:"overWrite"` ApiGroup string `yaml:"apiGroup"` GenApis []string `yaml:"genApis"` ExcludeModelFieldsForQueryParameters []string `yaml:"excludeModelFieldsForQueryParameters"` ExcludeModelFieldsForResponse []string `yaml:"excludeModelFieldsForResponse"` }
type GenConfigGenBiz ¶
type GenConfigGenDal ¶
type GenConfigGenDataSource ¶
type GenConfigGenRuoyiVue3 ¶ added in v0.0.3
type GenConfigGenRuoyiVue3 struct { Enable bool `yaml:"enable"` ProjectRoot string `yaml:"projectRoot"` TopMenus []*GenConfigGenRuoyiVueMenu `yaml:"topMenus"` }
type GenConfigGenRuoyiVueMenu ¶ added in v0.0.3
type GenConfigGenRuoyiVueMenu struct { Name string `yaml:"name"` Path string `yaml:"path"` Icon string `yaml:"icon"` OrderNum string `yaml:"orderNum"` ChildMenus []*GenConfigGenRuoyiVueMenu `yaml:"childMenus"` }
type GenConfigGenVueElementAdmin ¶ added in v0.0.3
type GenConfigMysql ¶
type GenConfigRunDml ¶
type GenConfigRunDml struct {
Enable bool `yaml:"enable"`
}
type GenConfigTable ¶
type RuoyiVue3GenType ¶ added in v0.0.3
type RuoyiVue3GenType struct { }
func (*RuoyiVue3GenType) GenApiJs ¶ added in v0.0.3
func (v *RuoyiVue3GenType) GenApiJs(config *GenConfig, model *DbModel)
func (*RuoyiVue3GenType) GenChildMenusSql ¶ added in v0.0.3
func (v *RuoyiVue3GenType) GenChildMenusSql(config *GenConfig, models []*DbModel)
func (*RuoyiVue3GenType) GenTopMenusSql ¶ added in v0.0.3
func (v *RuoyiVue3GenType) GenTopMenusSql(config *GenConfig)
func (*RuoyiVue3GenType) GenVueViews ¶ added in v0.0.3
func (v *RuoyiVue3GenType) GenVueViews(config *GenConfig, model *DbModel)
func (*RuoyiVue3GenType) GenerateRuoyiVue3Codes ¶ added in v0.0.3
func (v *RuoyiVue3GenType) GenerateRuoyiVue3Codes(config *GenConfig, model *DbModel)
func (*RuoyiVue3GenType) GenerateVueRouter ¶ added in v0.0.3
func (v *RuoyiVue3GenType) GenerateVueRouter(config *GenConfig, models []*DbModel)
type VueElementAdminGenType ¶ added in v0.0.3
type VueElementAdminGenType struct { }
func (*VueElementAdminGenType) GenVueClientApis ¶ added in v0.0.3
func (v *VueElementAdminGenType) GenVueClientApis(config *GenConfig, model *DbModel)
func (*VueElementAdminGenType) GenVueViews ¶ added in v0.0.3
func (v *VueElementAdminGenType) GenVueViews(config *GenConfig, model *DbModel)
func (*VueElementAdminGenType) GenerateVueCodes ¶ added in v0.0.3
func (v *VueElementAdminGenType) GenerateVueCodes(config *GenConfig, model *DbModel)
func (*VueElementAdminGenType) GenerateVueRouter ¶ added in v0.0.3
func (v *VueElementAdminGenType) GenerateVueRouter(config *GenConfig, models []*DbModel)
Click to show internal directories.
Click to hide internal directories.