package huoshan import ( "apigo.cc/gojs" _ "embed" "github.com/ssgo/config" "github.com/ssgo/log" "github.com/ssgo/u" ) //go:embed huoshan.ts var huoshanTS string type Conf struct { AKey string SKey string } var conf = Conf{} var confAes = u.NewAes([]byte("?GQ$0K0GgLdO=f+~L68PLm$uhKr4'=tV"), []byte("VFs7@sK61cj^f?HZ")) var keysIsSet = false func SetSSKey(key, iv []byte) { if !keysIsSet { confAes = u.NewAes(key, iv) keysIsSet = true } } func init() { obj := gojs.Map{ "name": "huoshan", "image": RequireImage(), } config.LoadConfig("huoshan", &conf) conf.AKey = confAes.DecryptUrlBase64ToString(conf.AKey) conf.SKey = confAes.DecryptUrlBase64ToString(conf.SKey) log.DefaultLogger.Info("Conf", "", conf) gojs.Register("apigo.cc/ai/huoshan", gojs.Module{ Object: obj, TsCode: huoshanTS, Example: "", }) }