[优化] 优化代码

This commit is contained in:
ryan
2026-05-31 14:53:04 +08:00
parent 449d0a5c5b
commit 57616626fd
4 changed files with 42 additions and 158 deletions
+1 -7
View File
@@ -1,7 +1,6 @@
package controller
import (
"net/http"
"openflare/service"
"strconv"
@@ -164,12 +163,7 @@ func GetAccessLogIPTrend(c *gin.Context) {
// @Router /api/access-logs/cleanup [post]
func CleanupAccessLogs(c *gin.Context) {
var input service.AccessLogCleanupInput
if err := c.ShouldBindJSON(&input); err != nil {
c.JSON(http.StatusBadRequest, gin.H{
"success": false,
"message": "参数错误",
"error": err.Error(),
})
if !bindJSON(c, &input) {
return
}
result, err := service.CleanupAccessLogs(input)