@@ -0,0 +1,14 @@
+package api
+
+import (
+ "github.com/gin-gonic/gin"
+ "go_zh/pkg/order"
+)
+type CeshiController struct {
+ BaseController
+}
+func (cs CeshiController) GetTime(c *gin.Context) {
+ order.TestConcurrentGeneration()
@@ -43,7 +43,7 @@ func (g *Generator) Generate() string {
}
// 并发测试函数
-func testConcurrentGeneration() {
+func TestConcurrentGeneration() {
fmt.Println("=== 并发测试 ===")
generator := NewOrderGenerator(1)
@@ -0,0 +1,17 @@
+package router
+ "go_zh/api"
+func init() {
+ RegisterRoute(func(engine *gin.Engine) {
+ v1 := engine.Group("/v1")
+ // 用户路由组
+ ceshiGroup := v1.Group("/ceshi")
+ {
+ ceshiGroup.GET("/inviteCode", api.CeshiController{}.GetTime)
+ }
+ })