add app wgt

This commit is contained in:
2025-03-14 13:53:48 +08:00
parent 0e6cb95499
commit 7e333b47f2
7 changed files with 108 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
package app
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tydata-server/app/user/cmd/api/internal/logic/app"
"tydata-server/app/user/cmd/api/internal/svc"
"tydata-server/common/result"
"tydata-server/pkg/lzkit/validator"
)
func GetAppVersionHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
l := app.NewGetAppVersionLogic(r.Context(), svcCtx)
resp, err := l.GetAppVersion()
result.HttpResult(r, w, resp, err)
}
}

View File

@@ -5,6 +5,7 @@ import (
"net/http"
agent "tydata-server/app/user/cmd/api/internal/handler/agent"
app "tydata-server/app/user/cmd/api/internal/handler/app"
auth "tydata-server/app/user/cmd/api/internal/handler/auth"
notification "tydata-server/app/user/cmd/api/internal/handler/notification"
pay "tydata-server/app/user/cmd/api/internal/handler/pay"
@@ -100,6 +101,17 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
rest.WithPrefix("/api/v1/agent"),
)
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodGet,
Path: "/app/version",
Handler: app.GetAppVersionHandler(serverCtx),
},
},
rest.WithPrefix("/api/v1"),
)
server.AddRoutes(
[]rest.Route{
{