支持图源切换

This commit is contained in:
2026-06-06 01:49:05 +08:00
parent 0f9cb3eae5
commit 71282f4e4f
11 changed files with 358 additions and 7 deletions
+12
View File
@@ -27,6 +27,18 @@ func registerMapSourceRoutes(r gin.IRouter, store *store) {
}
c.JSON(http.StatusOK, gin.H{"item": publicMapTileSourceDTO(*row)})
})
r.GET("/map-source/enabled", func(c *gin.Context) {
rows, err := store.ListEnabledMapTileSources()
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
items := make([]gin.H, 0, len(rows))
for _, row := range rows {
items = append(items, publicMapTileSourceDTO(row))
}
c.JSON(http.StatusOK, gin.H{"items": items})
})
}
func registerAdminMapSourceRoutes(r gin.IRouter, store *store) {