Documentation
¶
Overview ¶
Package api wires the gin engine: middleware, route groups, and handler registration. Feature handlers register their own routes via Register* funcs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRouter ¶
func NewRouter(db *gorm.DB, cfg *config.Config, authSvc *service.AuthService, sysCfg *service.SystemConfigService, srv *http.Server) *gin.Engine
NewRouter builds the gin engine with global middleware and a /health probe. Route groups are registered by feature packages via their Register funcs. sysCfg is the single shared SystemConfigService instance; it is reused for the CORS middleware, billing (alipay) and the admin system-config endpoints so that the in-memory cache stays coherent (an admin PUT refreshes every reader). srv is the live *http.Server; the system-config handler hot-applies server read/write timeouts to it on save.
Types ¶
This section is empty.