mirror of
https://github.com/trafficlunar/api.git
synced 2026-06-27 22:24:08 +00:00
refactor: rename /visitor-counter to /visit-counter
This commit is contained in:
parent
521a634d2e
commit
b62f4cd017
4 changed files with 12 additions and 12 deletions
|
|
@ -10,10 +10,10 @@ import (
|
|||
"backend/internal/model"
|
||||
)
|
||||
|
||||
const path = "./data/visitor.json"
|
||||
const path = "./data/visit.json"
|
||||
|
||||
func GetVisitorCounter() model.VisitorCounter {
|
||||
var data model.VisitorCounter
|
||||
func GetVisitCounter() model.VisitCounter {
|
||||
var data model.VisitCounter
|
||||
|
||||
jsonFile, err := os.Open(path)
|
||||
if err != nil {
|
||||
|
|
@ -37,8 +37,8 @@ func GetVisitorCounter() model.VisitorCounter {
|
|||
return data
|
||||
}
|
||||
|
||||
func IncrementVisitorCounter() model.Success {
|
||||
data := GetVisitorCounter()
|
||||
func IncrementVisitCounter() model.Success {
|
||||
data := GetVisitCounter()
|
||||
data.Counter++
|
||||
|
||||
err := os.MkdirAll(filepath.Dir(path), 0755)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue