feat(main): fix url

This commit is contained in:
2025-02-18 15:23:26 +08:00
parent 761796bd35
commit 6a5eab11ea
12 changed files with 616 additions and 53 deletions

View File

@@ -0,0 +1,17 @@
package agent
import (
"net/http"
"qnc-server/app/user/cmd/api/internal/logic/agent"
"qnc-server/app/user/cmd/api/internal/svc"
"qnc-server/common/result"
)
func GetAgentInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
l := agent.NewGetAgentInfoLogic(r.Context(), svcCtx)
resp, err := l.GetAgentInfo()
result.HttpResult(r, w, resp, err)
}
}

View File

@@ -21,16 +21,21 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
[]rest.Route{
{
Method: http.MethodPost,
Path: "/agent/apply",
Path: "/apply",
Handler: agent.ApplyForAgentHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/agent/audit/status",
Path: "/audit/status",
Handler: agent.GetAgentAuditStatusHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/info",
Handler: agent.GetAgentInfoHandler(serverCtx),
},
},
rest.WithPrefix("/api/v1"),
rest.WithPrefix("/api/v1/agent"),
)
server.AddRoutes(