mirror of
https://github.com/trafficlunar/api.git
synced 2026-06-27 22:24:08 +00:00
feat: add getting visitor counter
This commit is contained in:
parent
0f2d805df2
commit
bd31a363df
4 changed files with 58 additions and 0 deletions
18
internal/handler/visitor.go
Normal file
18
internal/handler/visitor.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package handler
|
||||
|
||||
import (
|
||||
"backend/internal/service"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func HandleGetVisitorCounter(w http.ResponseWriter, r *http.Request) {
|
||||
data := service.GetVisitorCounter()
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(data)
|
||||
}
|
||||
|
||||
func HandlePatchVisitorCounter(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write([]byte("hello world"))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue