This commit is contained in:
2025-06-17 11:16:24 +08:00
parent 6c3b4ec367
commit 759863f1aa
24 changed files with 103 additions and 92 deletions

View File

@@ -10,19 +10,19 @@ import (
"management/internal/pkg/render"
)
type App struct {
type app struct {
render render.Renderer
auditLogService v1.AuditLogService
}
func NewApp(render render.Renderer, auditLogService v1.AuditLogService) *App {
return &App{
func newApp(render render.Renderer, auditLogService v1.AuditLogService) *app {
return &app{
render: render,
auditLogService: auditLogService,
}
}
func (a *App) list(w http.ResponseWriter, r *http.Request) {
func (a *app) list(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case http.MethodGet:
ctx := r.Context()

View File

@@ -16,7 +16,7 @@ type Config struct {
}
func Routes(r chi.Router, cfg Config) {
app := NewApp(cfg.Render, cfg.AuditLogService)
app := newApp(cfg.Render, cfg.AuditLogService)
r.Route("/audit_log", func(r chi.Router) {
r.Get("/list", app.list)