feat: support basic user system

This commit is contained in:
xkm
2026-04-07 21:21:18 +08:00
parent deaa14f9f6
commit 1aecb4424c
22 changed files with 654 additions and 65 deletions

View File

@@ -4,9 +4,11 @@ import (
"context"
"database/sql"
"log"
"log/slog"
"net/http"
"os"
"gitea.starryskymeow.cn/B309/datamarket/internal/config"
"gitea.starryskymeow.cn/B309/datamarket/internal/repository"
"gitea.starryskymeow.cn/B309/datamarket/internal/router"
"gitea.starryskymeow.cn/B309/datamarket/internal/service"
@@ -59,8 +61,13 @@ func main() {
}
queries := repository.New(pool)
appService := service.New(queries)
r := router.New(appService)
cfg, err := config.New(queries)
if err != nil {
slog.Error("Error loading config")
log.Fatal(err)
}
appService := service.New(queries, cfg)
r := router.New(appService, cfg)
addr := os.Getenv("SERVER_ADDR")