This commit is contained in:
2025-06-17 11:53:31 +08:00
parent 5c8182cdf9
commit 417d0671de
10 changed files with 87 additions and 114 deletions

View File

@@ -78,6 +78,15 @@ type ResponseList struct {
Data any `json:"data"`
}
func NewResponseList(count int64, data any) ResponseList {
return ResponseList{
Code: 0,
Message: "OK",
Count: count,
Data: data,
}
}
func respond(w http.ResponseWriter, data any) {
v, err := json.Marshal(data)
if err != nil {