1234567891011121314151617181920212223242526272829303132333435 |
- package cloudserver
- import (
- "crypto/md5"
- "encoding/hex"
- )
- type CloudServerConf struct {
- ServerUrl string
- AppId string
- AppSecret string
- Route string
- }
- var defConf = &CloudServerConf{
- AppId: "fvWmjGCU",
- AppSecret: "054e7df0881eff8328858092f9e8ac0b0f356676",
- ServerUrl: "https://test-admin.pacom.cn",
- Route: "gw4g-cloudserver",
- }
- func (c *CloudServerConf) GenerateSignature() string {
- res := md5V(c.AppId + "-pacom-" + c.AppSecret)
- return res
- }
- func md5V(str string) string {
- h := md5.New()
- h.Write([]byte(str))
- return hex.EncodeToString(h.Sum(nil))
- }
- func GetCloudConfig() interface{} {
- return defConf
- }
|