分析优化 channel 接口用时
This commit is contained in:
20
web/handlers/temp.go
Normal file
20
web/handlers/temp.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"platform/pkg/rds"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func Temp(c *fiber.Ctx) error {
|
||||
|
||||
id := c.Query("id")
|
||||
result, err := rds.Client.Get(c.Context(), "channel:"+id).Result()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return c.JSON(fiber.Map{
|
||||
"result": result,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user