refactor: rename visitor counter to hit counter

This commit is contained in:
trafficlunar 2025-03-20 22:31:39 +00:00
parent 38b93391a1
commit 32aea2cbd5
4 changed files with 12 additions and 12 deletions

21
internal/handler/hit.go Normal file
View file

@ -0,0 +1,21 @@
package handler
import (
"backend/internal/service"
"encoding/json"
"net/http"
)
func HandleGetHitCounter(w http.ResponseWriter, r *http.Request) {
data := service.GetHitCounter()
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(data)
}
func HandlePatchHitCounter(w http.ResponseWriter, r *http.Request) {
data := service.IncrementHitCounter()
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(data)
}