package svc import ( "GtDataStore/app/model" "github.com/zeromicro/go-zero/core/stores/sqlx" ) type modelList struct { ProjectConfig model.DcProjectConfigModel DcEventBind model.DcEventBindModel DcEventRule model.DcEventRuleModel DcEventList model.DcEventListModel DcItemData model.DcItemDataModel DcWorkingUf model.DcWorkingUfModel DcDeviceBind model.DcDeviceBindModel } func initModel(svc *ServiceContext) { mysql := sqlx.NewMysql(svc.Config.DtDataStoreDB.DataSource) svc.DcEventRule = model.NewDcEventRuleModel(mysql) svc.DcEventList = model.NewDcEventListModel(mysql) svc.DcEventBind = model.NewDcEventBindModel(mysql) svc.DcItemData = model.NewDcItemDataModel(mysql) svc.DcWorkingUf = model.NewDcWorkingUfModel(mysql) svc.DcDeviceBind = model.NewDcDeviceBindModel(mysql) svc.ProjectConfig = model.NewDcProjectConfigModel(mysql) }