feat 历史记录

This commit is contained in:
2026-01-14 18:15:36 +08:00
parent 313a93702e
commit 636008b97d
16 changed files with 58 additions and 66 deletions

View File

@@ -3,7 +3,7 @@ package http_gateway
import (
"context"
"git.hlsq.asia/mmorpg/service-common/log"
"git.hlsq.asia/mmorpg/service-common/net/grpc/service"
"git.hlsq.asia/mmorpg/service-common/net/grpc/grpc_client"
"git.hlsq.asia/mmorpg/service-common/net/http/http_resp"
"git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb"
"git.hlsq.asia/mmorpg/service-gateway/internal/handler/http_handler"
@@ -52,16 +52,18 @@ func InitRouter() *gin.Engine {
r.HandleMethodNotAllowed = true
r.NoMethod(func(c *gin.Context) {
http_resp.JsonMethodNotAllowed(c)
c.Abort()
})
r.NoRoute(func(c *gin.Context) {
http_resp.JsonNotFound(c)
c.Abort()
})
initBaseRoute(r.Group("/"))
auth := r.Group("/")
auth.Use(authJwt())
// 网关
initBaseRoute(auth)
// 用户中心
initUserPath(auth)
// 奇怪的知识-服务端
@@ -72,13 +74,13 @@ func InitRouter() *gin.Engine {
func initBaseRoute(r *gin.RouterGroup) {
g := r.Group("/gw")
g.POST("/login", http_handler.Login)
g.POST("/refresh_token", http_handler.RefreshToken)
g.POST("/open/login", http_handler.Login)
g.POST("/open/refresh_token", http_handler.RefreshToken)
}
func initUserPath(r *gin.RouterGroup) {
g := r.Group("/user")
client, err := service.UserNewClientLB()
client, err := grpc_client.UserNewClientLB()
if err != nil {
log.Errorf("get user conn failed: %v", err)
return
@@ -95,7 +97,7 @@ func initUserPath(r *gin.RouterGroup) {
func initQgdzsPath(r *gin.RouterGroup) {
g := r.Group("/qgdzs")
client, err := service.QgdzsNewClientLB()
client, err := grpc_client.QgdzsNewClientLB()
if err != nil {
log.Errorf("get qgdzs conn failed: %v", err)
return