迁移并重构项目,优化了执行流程

This commit is contained in:
2025-10-31 15:43:25 +08:00
commit 35bcd62ad5
29 changed files with 1312 additions and 0 deletions

View File

@ -0,0 +1,42 @@
package SafeLine
import (
"encoding/json"
)
type UpdateReq struct {
Acme struct {
Domains []string `json:"domains"`
Email string `json:"email"`
} `json:"acme"`
Id int `json:"id"`
Manual struct {
Crt string `json:"crt"`
Key string `json:"key"`
} `json:"manual"`
Type int `json:"type"`
}
func (updateReq *UpdateReq) Create(Certificate, PrivateKey []byte, domains []string, email string, id, Type int) {
updateReq.Acme.Domains = domains
updateReq.Acme.Email = email
updateReq.Manual.Crt = string(Certificate)
updateReq.Manual.Key = string(PrivateKey)
updateReq.Id = id
updateReq.Type = Type
}
func (updateReq *UpdateReq) Marshal() []byte {
data, _ := json.Marshal(updateReq)
return data
}
type UpdateResp struct {
Data int `json:"data"`
Err interface{} `json:"err"`
Msg string `json:"msg"`
}
func (updateResp *UpdateResp) Unmarshal(data []byte) {
_ = json.Unmarshal(data, &updateResp)
}