3 Star 0 Fork 3

上海炘璞电子科技有限公司/detonator

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
api.lsh.uid.go 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
HJX 提交于 2024-01-05 15:39 +08:00 . 字段更新
package danling
import (
"encoding/base64"
"encoding/json"
"gitee.com/thingple/detonator/rest"
"github.com/lishimeng/go-log"
)
type LshUidProjectInfo struct {
LowVoltageId string `json:"lowVoltageId,omitempty"` // 流水号 50Byte
Uid string `json:"uid,omitempty"` // UID 30Byte
Lgch string `json:"lgch,omitempty"` //企业代号
}
func (c *client) RegisterUid(projects ...LshUidProjectInfo) (code int, err error) {
req := Req{}
req.Xpch = c.xpch
for _, project := range projects {
req.Projects = append(req.Projects, project)
}
var resp Resp
bs, err := json.Marshal(req)
if err != nil {
return
}
//tmp := strings.ReplaceAll(string(bs), " ", "")
log.Info("req:%s", bs)
reqBs, err := TripleDESEncode(bs, c.desKey)
if err != nil {
return
}
reqContent := base64.StdEncoding.EncodeToString(reqBs)
log.Info("req:%s", reqContent)
params := make(map[string]string)
params["param"] = reqContent
code, err = rest.NewRest(c.host).Path("lsh_uid_Servlet", "addLsh_Uid").ResponseJson(&resp).FormUrl(params)
if err != nil {
return
}
return
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/thingple/detonator.git
git@gitee.com:thingple/detonator.git
thingple
detonator
detonator
v0.0.19

搜索帮助