feat: analysis user auth and ws

This commit is contained in:
zzw
2026-10-15 09:23:07 +08:00
parent 6fa185003d
commit a65b6d2803
102 changed files with 4966 additions and 786 deletions
@@ -0,0 +1,26 @@
package handler
import (
"net/http"
"lone-services/services/ws/internal/logic"
"lone-services/services/ws/internal/svc"
"lone-services/services/ws/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
)
func ConnectHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.ConnectReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := logic.NewConnectLogic(r.Context(), svcCtx)
if err := l.Connect(w, r, &req); err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
}
}
}
+24
View File
@@ -0,0 +1,24 @@
// Code generated by goctl. DO NOT EDIT.
// goctl 1.10.1
package handler
import (
"net/http"
"lone-services/services/ws/internal/svc"
"github.com/zeromicro/go-zero/rest"
)
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodGet,
Path: "/ws",
Handler: ConnectHandler(serverCtx),
},
},
)
}