diff --git a/internal/response/pagination.go b/internal/response/pagination.go index e46f3cd..ad903ea 100644 --- a/internal/response/pagination.go +++ b/internal/response/pagination.go @@ -23,13 +23,13 @@ type Pagination struct { // PaginatedResponse is the standard structure for all paginated API responses. type PaginatedResponse struct { - Items interface{} `json:"items"` - Pagination Pagination `json:"pagination"` + Items any `json:"items"` + Pagination Pagination `json:"pagination"` } // Paginate performs pagination on a GORM query and returns a standardized response. // It takes a Gin context, a GORM query builder, and a destination slice for the results. -func Paginate(c *gin.Context, query *gorm.DB, dest interface{}) (*PaginatedResponse, error) { +func Paginate(c *gin.Context, query *gorm.DB, dest any) (*PaginatedResponse, error) { // 1. Get page and page size from query parameters page, err := strconv.Atoi(c.DefaultQuery("page", "1")) if err != nil || page < 1 { diff --git a/internal/services/key_cron_service.go b/internal/services/key_cron_service.go index f69ce9d..5fd094e 100644 --- a/internal/services/key_cron_service.go +++ b/internal/services/key_cron_service.go @@ -190,7 +190,7 @@ func (s *KeyCronService) batchUpdateKeyStatus(keys []models.APIKey) { err := s.DB.Transaction(func(tx *gorm.DB) error { for _, key := range keys { - updates := map[string]interface{}{ + updates := map[string]any{ "status": key.Status, "error_reason": key.ErrorReason, }