feat: common code for back functions are now in handlers/common.go

This commit is contained in:
Iron_Felix 2025-11-01 21:17:42 +03:00
parent 6ed47b667c
commit 6d538ed154
2 changed files with 29 additions and 11 deletions

View file

@ -0,0 +1,19 @@
package handlers
import (
sqlc "nyanimedb/sql"
"strconv"
)
type Server struct {
db *sqlc.Queries
}
func NewServer(db *sqlc.Queries) Server {
return Server{db: db}
}
func parseInt64(s string) (int32, error) {
i, err := strconv.ParseInt(s, 10, 64)
return int32(i), err
}