// 导入所有配置 package data import ( mhayaDataConfig "github.com/mhaya/components/data-config" "github.com/mhaya/game/game_cluster/internal/types" mhayaMapStructure "github.com/mhaya/extend/mapstructure" ) var ( {{- range .AllSheets}} {{.Name}} = &{{.Name}}{} {{- end}} ) func New() *mhayaDataConfig.Component { dataConfig := mhayaDataConfig.New() dataConfig.Register( {{- range .AllSheets}} {{.Name}}, {{- end}} ) return dataConfig } func DecodeData(input interface{}, output interface{}) error { return mhayaMapStructure.HookDecode( input, output, "json", types.GetDecodeHooks(), ) }