feat: add Number Connect game with ABC spatial optimization and auto-pagination
Build and Push Docker Image / build (push) Successful in 3m45s

This commit is contained in:
2026-03-01 00:48:52 -08:00
parent 35cd040122
commit c3d0dee806
5 changed files with 293 additions and 67 deletions
+15
View File
@@ -29,9 +29,24 @@ func (t *learnNumberTool) Init() error {
func (t *learnNumberTool) RegisterRoutes(r *gin.RouterGroup) {
r.POST("/counting", t.handleCounting)
r.POST("/writing", t.handleWriting)
r.GET("/categories", t.handleCategories)
}
func (t *learnNumberTool) handleWriting(c *gin.Context) {
var req logic.WritingRequest
if err := c.ShouldBindJSON(&req); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
pdfBytes, err := logic.GenerateWritingPDF(req)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
c.Data(http.StatusOK, "application/pdf", pdfBytes)
}
func (t *learnNumberTool) handleCategories(c *gin.Context) {
// 返回分类信息供前端预览
c.JSON(http.StatusOK, data.IconCategories)