diff --git a/app/task/svc/svc_egg_energy_auto_update_user_access_test.go b/app/task/svc/svc_egg_energy_auto_update_user_access_test.go index f1b679d..72d507b 100644 --- a/app/task/svc/svc_egg_energy_auto_update_user_access_test.go +++ b/app/task/svc/svc_egg_energy_auto_update_user_access_test.go @@ -3,6 +3,7 @@ package svc import ( "applet/app/cfg" "applet/app/db" + "applet/app/utils/cache" "code.fnuoos.com/go_rely_warehouse/zyos_go_es.git/es" "testing" ) @@ -20,6 +21,7 @@ func TestEggEnergyAutoUpdateUserAccess(t *testing.T) { Path: "tmp/%s.log", } db.InitDB(&dbcfg) + cache.NewRedis("127.0.0.1:6379") es.Init("http://123.57.140.192:9200/", "elastic", "fnuo123") EggEnergyAutoUpdateUserAccess(db.Db) } diff --git a/app/task/svc/svc_egg_energy_automatic_scoring_test.go b/app/task/svc/svc_egg_energy_automatic_scoring_test.go new file mode 100644 index 0000000..b024e0b --- /dev/null +++ b/app/task/svc/svc_egg_energy_automatic_scoring_test.go @@ -0,0 +1,20 @@ +package svc + +import ( + "code.fnuoos.com/EggPlanet/egg_system_rules.git/md" + "code.fnuoos.com/go_rely_warehouse/zyos_go_es.git/es" + "fmt" + "testing" +) + +func TestCreateEsIndex(t *testing.T) { + es.Init("http://120.55.48.175:9200", "elastic", "fnuo123") + nextWeekIndex := "egg_energy_user_egg_score_202452" + for { + err := es.CreateIndexIfNotExists(nextWeekIndex, md.EggEnergyUserEggScoreEsMapping) + if err != nil { + fmt.Println(err) + return + } + } +} diff --git a/go.mod b/go.mod index 2697fe0..a7215e3 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( ) require ( - code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241226101244-5f1b738cf2bb + code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241227062700-67d240c3bcb3 code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241226101642-a072d33f3449 code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5