add: file export for table

This commit is contained in:
2024-08-28 14:35:44 +08:00
parent d9f84fc807
commit c80842087d
6 changed files with 67 additions and 59 deletions

View File

@@ -13,7 +13,7 @@ func DataResp(data any) map[string]any {
return map[string]any{"code": CODE_SUCC, "data": data}
}
func SuccResp() map[string]any {
func SuccMessageResp() map[string]any {
return map[string]any{"code": CODE_SUCC, "message": "success"}
}
@@ -21,6 +21,15 @@ func TotalResp(total int64) map[string]any {
return map[string]any{"code": CODE_SUCC, "total": total}
}
func TotalDataResp(data any, total int64) map[string]any {
func TotalDataResp(data any, total any) map[string]any {
return map[string]any{"code": CODE_SUCC, "data": data, "total": total}
}
func SuccResp(va map[string]any) map[string]any {
resp := make(map[string]any)
resp["code"] = CODE_SUCC
for k, v := range va {
resp[k] = v
}
return resp
}