@@ -3,6 +3,7 @@ package svc | |||||
import ( | import ( | ||||
"applet/app/cfg" | "applet/app/cfg" | ||||
"applet/app/db" | "applet/app/db" | ||||
"applet/app/utils/cache" | |||||
"code.fnuoos.com/go_rely_warehouse/zyos_go_es.git/es" | "code.fnuoos.com/go_rely_warehouse/zyos_go_es.git/es" | ||||
"testing" | "testing" | ||||
) | ) | ||||
@@ -20,6 +21,7 @@ func TestEggEnergyAutoUpdateUserAccess(t *testing.T) { | |||||
Path: "tmp/%s.log", | Path: "tmp/%s.log", | ||||
} | } | ||||
db.InitDB(&dbcfg) | db.InitDB(&dbcfg) | ||||
cache.NewRedis("127.0.0.1:6379") | |||||
es.Init("http://123.57.140.192:9200/", "elastic", "fnuo123") | es.Init("http://123.57.140.192:9200/", "elastic", "fnuo123") | ||||
EggEnergyAutoUpdateUserAccess(db.Db) | EggEnergyAutoUpdateUserAccess(db.Db) | ||||
} | } |
@@ -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 | |||||
} | |||||
} | |||||
} |
@@ -33,7 +33,7 @@ require ( | |||||
) | ) | ||||
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/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_es.git v1.0.1-0.20241118083738-0f22da9ba0be | ||||
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 | code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 | ||||