feat: 合并服务端程序代码至主分支

This commit is contained in:
539943419 committed 2024-12-19 22:32:27 +08:00
1 parent 47590ec0db
commit d6816925ed
19 files changed
+672 -4

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
package api
import (
"net/http"
"strconv"
"github.com/gin-gonic/gin"
"miao-directory/fsOperateEventCenter"
)
func QueryHandler(fsOperateEventCenter *fsOperateEventCenter.FsOperateEventCenter) gin.HandlerFunc {
return func(c *gin.Context) {
idStr := c.Query("id")
id, err := strconv.ParseInt(idStr, 10, 32)
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": "Invalid id"})
return
}
event := fsOperateEventCenter.Query(int32(id))
c.JSON(http.StatusOK, event)
}
}