feat: add format utility function and improve loader method

This commit is contained in:
JuanZoran
2023-01-08 15:07:12 +08:00
parent 2f6520940a
commit 5a424c66bb
17 changed files with 486 additions and 139 deletions

3
go/go.mod Normal file
View File

@@ -0,0 +1,3 @@
module query_online
go 1.19

50
go/query_online.go Normal file
View File

@@ -0,0 +1,50 @@
package query_youcao
import (
"net/url"
"time"
)
const (
youdao = "https://openapi.youdao.com/api"
appKey = "1858465a8708c121"
appPasswd = "fG0sitfk16nJOlIlycnLPYZn1optxUxL"
)
type data struct {
q string
from string
to string
// appKey string
salt string
sign string
signType string
curtime string
}
func input(word string) string {
var input string
len := len(word)
if len > 20 {
input = word[:10] + string(rune(len)) + word[len-10:]
} else {
input = word
}
return input
}
func salt(_ string) string {
// TODO : hash salt
var salt string
return salt
}
func to_value(d data) url.Values {
// return value
}
func Query(word string) {
}