2024-10-02 17:35:29 +08:00
|
|
|
package huoshan
|
|
|
|
|
|
|
|
import (
|
2024-10-13 11:55:28 +08:00
|
|
|
"apigo.cc/gojs"
|
2024-10-02 17:35:29 +08:00
|
|
|
_ "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{
|
2024-10-13 11:55:28 +08:00
|
|
|
"name": "huoshan",
|
2024-10-02 17:35:29 +08:00
|
|
|
"image": RequireImage(),
|
|
|
|
}
|
|
|
|
config.LoadConfig("huoshan", &conf)
|
|
|
|
conf.AKey = confAes.DecryptUrlBase64ToString(conf.AKey)
|
|
|
|
conf.SKey = confAes.DecryptUrlBase64ToString(conf.SKey)
|
|
|
|
log.DefaultLogger.Info("Conf", "", conf)
|
2024-10-13 11:55:28 +08:00
|
|
|
gojs.Register("apigo.cc/ai/huoshan", gojs.Module{
|
2024-10-02 17:35:29 +08:00
|
|
|
Object: obj,
|
|
|
|
TsCode: huoshanTS,
|
|
|
|
Example: "",
|
|
|
|
})
|
|
|
|
}
|