This commit is contained in:
2026-06-19 10:49:13 +08:00
parent 82f759586a
commit d71a23fa57
13 changed files with 696 additions and 39 deletions

View File

@@ -34,6 +34,7 @@ type QueryWhitelistEntryResponse struct {
APICodes []string `json:"api_codes"`
Status string `json:"status"`
Remark string `json:"remark"`
OperationIP string `json:"operation_ip,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
@@ -51,6 +52,19 @@ type QueryWhitelistImportLegacyResponse struct {
Total int `json:"total"`
}
// QueryWhitelistPublicEncryptedRequest 公开接口外层请求data 为 AES 密文)
type QueryWhitelistPublicEncryptedRequest struct {
Data string `json:"data" binding:"required"`
}
// QueryWhitelistPublicPayload 公开接口解密后的业务参数(不含 key/access_id身份由请求头 + 解密成功证明)
type QueryWhitelistPublicPayload struct {
Name string `json:"name"`
IDCard string `json:"id_card"`
APICodes []string `json:"api_codes"`
Remark string `json:"remark"`
}
func NewQueryWhitelistEntryResponse(entry *entities.QueryWhitelistEntry) QueryWhitelistEntryResponse {
apiCodes := []string(entry.APICodes)
if apiCodes == nil {
@@ -65,6 +79,7 @@ func NewQueryWhitelistEntryResponse(entry *entities.QueryWhitelistEntry) QueryWh
APICodes: apiCodes,
Status: entry.Status,
Remark: entry.Remark,
OperationIP: entry.OperationIP,
CreatedAt: entry.CreatedAt,
UpdatedAt: entry.UpdatedAt,
}