mirror of
https://github.com/KeymonSoft/jRDC-Multi.git
synced 2026-04-17 21:06:24 +00:00
- VERSION 5.08.31
- Se corrigio que no avisaba cuando el query no requeria parametros y si se enviaban (en el JSONHandler)
This commit is contained in:
@@ -125,7 +125,7 @@ Sub Handle(req As ServletRequest, resp As ServletResponse)
|
|||||||
Dim rs As ResultSet
|
Dim rs As ResultSet
|
||||||
|
|
||||||
' Si el comando SQL contiene placeholders ('?'), significa que espera parámetros.
|
' Si el comando SQL contiene placeholders ('?'), significa que espera parámetros.
|
||||||
If sqlCommand.Contains("?") Then
|
If sqlCommand.Contains("?") or orderedParams.Size > 0 Then
|
||||||
' =================================================================
|
' =================================================================
|
||||||
' === VALIDACIÓN DE CONTEO DE PARÁMETROS ==========================
|
' === VALIDACIÓN DE CONTEO DE PARÁMETROS ==========================
|
||||||
' =================================================================
|
' =================================================================
|
||||||
@@ -134,6 +134,9 @@ Sub Handle(req As ServletRequest, resp As ServletResponse)
|
|||||||
' Obtiene cuántos parámetros se recibieron.
|
' Obtiene cuántos parámetros se recibieron.
|
||||||
Dim receivedParams As Int = orderedParams.Size
|
Dim receivedParams As Int = orderedParams.Size
|
||||||
' Compara si la cantidad de parámetros esperados y recibidos es diferente.
|
' Compara si la cantidad de parámetros esperados y recibidos es diferente.
|
||||||
|
|
||||||
|
Log($"expectedParams: ${expectedParams}, receivedParams: ${receivedParams}"$)
|
||||||
|
|
||||||
If expectedParams <> receivedParams Then
|
If expectedParams <> receivedParams Then
|
||||||
' Si no coinciden, envía un error 400 detallado.
|
' Si no coinciden, envía un error 400 detallado.
|
||||||
SendErrorResponse(resp, 400, $"Número de parametros equivocado para '${queryName}'. Se esperaban ${expectedParams} y se recibieron ${receivedParams}."$)
|
SendErrorResponse(resp, 400, $"Número de parametros equivocado para '${queryName}'. Se esperaban ${expectedParams} y se recibieron ${receivedParams}."$)
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ Private Sub ExecuteQuery(DB As String, con As SQL, in As InputStream, resp As S
|
|||||||
Dim params As List = ReadList(in)
|
Dim params As List = ReadList(in)
|
||||||
' Obtiene la sentencia SQL.
|
' Obtiene la sentencia SQL.
|
||||||
Dim theSql As String = Connector.GetCommand(DB, queryName)
|
Dim theSql As String = Connector.GetCommand(DB, queryName)
|
||||||
Log(444 & "|" & theSql)
|
' Log(444 & "|" & theSql)
|
||||||
|
|
||||||
' <<< INICIO NUEVA VALIDACIÓN: VERIFICAR SI EL COMANDO EXISTE (V1) >>>
|
' <<< INICIO NUEVA VALIDACIÓN: VERIFICAR SI EL COMANDO EXISTE (V1) >>>
|
||||||
If theSql = Null Or theSql ="null" Or theSql.Trim = "" Then
|
If theSql = Null Or theSql ="null" Or theSql.Trim = "" Then
|
||||||
|
|||||||
19
Manager.bas
19
Manager.bas
@@ -16,13 +16,14 @@ End Sub
|
|||||||
|
|
||||||
Sub Handle(req As ServletRequest, resp As ServletResponse)
|
Sub Handle(req As ServletRequest, resp As ServletResponse)
|
||||||
Dim Command As String = req.GetParameter("command")
|
Dim Command As String = req.GetParameter("command")
|
||||||
|
If Command = "" Then Command = "ping"
|
||||||
Log($"Command: ${Command}"$)
|
Log($"Command: ${Command}"$)
|
||||||
resp.ContentType = "text/html"
|
resp.ContentType = "text/html"
|
||||||
If Command = "reload" Then 'Reload config.properties
|
If Command = "reload" Then 'Reload config.properties
|
||||||
' rdcc.Initialize
|
' rdcc.Initialize
|
||||||
Private estaDB As String = ""
|
Private estaDB As String = ""
|
||||||
' Log(Main.listaDeCP)
|
' Log(Main.listaDeCP)
|
||||||
resp.Write($"<a href="/test">Test</a> | <a href="/manager?command=reload">Reload</a> | <br/>"$)
|
resp.Write($"<a href="/test">Test</a> | <a href="/manager?command=reload">Reload</a> | <a href="/manager?command=rpm2">Reiniciar</a> | <a href="/manager?command=reviveBow">Revive Bow</a> | </br></br>"$)
|
||||||
For i = 0 To Main.listaDeCP.Size - 1
|
For i = 0 To Main.listaDeCP.Size - 1
|
||||||
Main.Connectors.Get(Main.listaDeCP.get(i)).As(RDCConnector).Initialize(Main.listaDeCP.get(i))
|
Main.Connectors.Get(Main.listaDeCP.get(i)).As(RDCConnector).Initialize(Main.listaDeCP.get(i))
|
||||||
If Main.listaDeCP.get(i) <> "DB1" Then estaDB = "." & Main.listaDeCP.get(i) Else estaDB = ""
|
If Main.listaDeCP.get(i) <> "DB1" Then estaDB = "." & Main.listaDeCP.get(i) Else estaDB = ""
|
||||||
@@ -42,7 +43,7 @@ Sub Handle(req As ServletRequest, resp As ServletResponse)
|
|||||||
' shl.WorkingDirectory = GlobalParameters.WorkingDirectory
|
' shl.WorkingDirectory = GlobalParameters.WorkingDirectory
|
||||||
' shl.Run(-1)
|
' shl.Run(-1)
|
||||||
else If Command = "rsx" Then 'Reiniciamos el servidor DBReq
|
else If Command = "rsx" Then 'Reiniciamos el servidor DBReq
|
||||||
resp.Write($"<a href="/test">Test</a> | <a href="/manager?command=reload">Reload</a> | <br/>"$)
|
resp.Write($"<a href="/test">Test</a> | <a href="/manager?command=reload">Reload</a> | <a href="/manager?command=rpm2">Reiniciar</a> | <a href="/manager?command=reviveBow">Revive Bow</a> | </br></br>"$)
|
||||||
Log($"Ejecutamos ${File.DirApp}\start.bat"$)
|
Log($"Ejecutamos ${File.DirApp}\start.bat"$)
|
||||||
resp.Write($"Ejecutamos ${File.DirApp}\start.bat"$)
|
resp.Write($"Ejecutamos ${File.DirApp}\start.bat"$)
|
||||||
Public shl As Shell
|
Public shl As Shell
|
||||||
@@ -50,13 +51,22 @@ Sub Handle(req As ServletRequest, resp As ServletResponse)
|
|||||||
shl.WorkingDirectory = File.DirApp
|
shl.WorkingDirectory = File.DirApp
|
||||||
shl.Run(-1)
|
shl.Run(-1)
|
||||||
else If Command = "rpm2" Then 'Reiniciamos el proceso DBReq en PM2
|
else If Command = "rpm2" Then 'Reiniciamos el proceso DBReq en PM2
|
||||||
resp.Write($"<a href="/test">Test</a> | <a href="/manager?command=reload">Reload</a> | <br/>"$)
|
resp.Write($"<a href="/test">Test</a> | <a href="/manager?command=reload">Reload</a> | <a href="/manager?command=rpm2">Reiniciar</a> | <a href="/manager?command=reviveBow">Revive Bow</a> | </br></br>"$)
|
||||||
Log($"Ejecutamos ${File.DirApp}\reiniciaProcesoPM2.bat"$)
|
Log($"Ejecutamos ${File.DirApp}\reiniciaProcesoPM2.bat"$)
|
||||||
resp.Write($"Ejecutamos ${File.DirApp}\reiniciaProcesoPM2.bat"$)
|
resp.Write($"Ejecutamos ${File.DirApp}\reiniciaProcesoPM2.bat"$)
|
||||||
Public shl As Shell
|
Public shl As Shell
|
||||||
shl.Initialize("shl","cmd",Array("/c",File.DirApp & "\reiniciaProcesoPM2.bat " & Main.srvr.Port))
|
shl.Initialize("shl","cmd",Array("/c",File.DirApp & "\reiniciaProcesoPM2.bat " & Main.srvr.Port))
|
||||||
shl.WorkingDirectory = File.DirApp
|
shl.WorkingDirectory = File.DirApp
|
||||||
shl.Run(-1)
|
shl.Run(-1)
|
||||||
|
else If Command = "reviveBow" Then 'Reiniciamos el proceso DBReq en PM2
|
||||||
|
resp.Write($"<a href="/test">Test</a> | <a href="/manager?command=reload">Reload</a> | <a href="/manager?command=rpm2">Reiniciar</a> | <a href="/manager?command=reviveBow">Revive Bow</a> | </br></br>"$)
|
||||||
|
Log($"Ejecutamos ${File.DirApp}\reiniciaProcesoBow.bat"$)
|
||||||
|
resp.Write($"Ejecutamos ${File.DirApp}\reiniciaProcesoBow.bat<br><br>"$)
|
||||||
|
resp.Write($"!!!BOW REINICIANDO!!!"$)
|
||||||
|
Public shl As Shell
|
||||||
|
shl.Initialize("shl","cmd",Array("/c",File.DirApp & "\reiniciaProcesoBow.bat " & Main.srvr.Port))
|
||||||
|
shl.WorkingDirectory = File.DirApp
|
||||||
|
shl.Run(-1)
|
||||||
else If Command = "paused" Then
|
else If Command = "paused" Then
|
||||||
GlobalParameters.IsPaused = 1
|
GlobalParameters.IsPaused = 1
|
||||||
else If Command = "continue" Then
|
else If Command = "continue" Then
|
||||||
@@ -124,6 +134,9 @@ Sub Handle(req As ServletRequest, resp As ServletResponse)
|
|||||||
j.ToString
|
j.ToString
|
||||||
resp.Write(j.ToString)
|
resp.Write(j.ToString)
|
||||||
End If
|
End If
|
||||||
|
else if Command = "ping" Then
|
||||||
|
resp.Write($"<a href="/test">Test</a> | <a href="/manager?command=reload">Reload</a> | <a href="/manager?command=rpm2">Reiniciar</a> | <a href="/manager?command=reviveBow">Revive Bow</a> | </br></br>"$)
|
||||||
|
resp.Write($"Pong"$)
|
||||||
End If
|
End If
|
||||||
If GlobalParameters.mpLogs.IsInitialized Then GlobalParameters.mpLogs.Put(Command, "Manager : " & Command & " - Time : " & DateTime.Time(DateTime.Now))
|
If GlobalParameters.mpLogs.IsInitialized Then GlobalParameters.mpLogs.Put(Command, "Manager : " & Command & " - Time : " & DateTime.Time(DateTime.Now))
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ End Sub
|
|||||||
Sub Handle(req As ServletRequest, resp As ServletResponse)
|
Sub Handle(req As ServletRequest, resp As ServletResponse)
|
||||||
Log("TEST")
|
Log("TEST")
|
||||||
resp.ContentType = "text/html"
|
resp.ContentType = "text/html"
|
||||||
resp.Write($"<a href="/test">Test</a> | <a href="/manager?command=reload">Reload</a> | <br/>"$)
|
resp.Write($"<a href="/test">Test</a> | <a href="/manager?command=reload">Reload</a> | <a href="/manager?command=rpm2">Reiniciar</a> | <a href="/manager?command=reviveBow">Revive Bow</a> | </br></br>"$)
|
||||||
resp.Write($"RemoteServer is running on port <strong>${Main.srvr.Port}</strong> ($DateTime{DateTime.Now})<br/>"$)
|
resp.Write($"RemoteServer is running on port <strong>${Main.srvr.Port}</strong> ($DateTime{DateTime.Now})<br/>"$)
|
||||||
Try
|
Try
|
||||||
' Dim con As SQL = Main.rdcConnectorDB1.GetConnection("")
|
' Dim con As SQL = Main.rdcConnectorDB1.GetConnection("")
|
||||||
|
|||||||
@@ -34,6 +34,6 @@ ModuleClosedNodes6=
|
|||||||
ModuleClosedNodes7=
|
ModuleClosedNodes7=
|
||||||
ModuleClosedNodes8=
|
ModuleClosedNodes8=
|
||||||
ModuleClosedNodes9=
|
ModuleClosedNodes9=
|
||||||
NavigationStack=DBHandlerGenerico,SendPlainTextError,603,0,DBHandlerGenerico,Initialize,27,0,DB1JsonHandler,Class_Globals,6,0,DB1JsonHandler,Initialize,13,0,DBHandlerGenerico,Class_Globals,15,0,DB1JsonHandler,Handle,197,6,DB1JsonHandler,SendSuccessResponse,238,0,DB1JsonHandler,SendErrorResponse,255,0,Main,AppStart,76,0
|
NavigationStack=DBHandlerGenerico,ExecuteQuery,374,0,DB1JsonHandler,SendSuccessResponse,238,0,DB1JsonHandler,SendErrorResponse,255,0,Main,AppStart,76,0,RDCConnector,GetConnection,105,0,RDCConnector,LoadConfigMap,81,0,RDCConnector,GetCommand,98,0,RDCConnector,LoadSQLCommands,110,0,Manager,Initialize,9,0,Manager,Handle,124,6,DB1JsonHandler,Handle,121,6,DBHandlerGenerico,Handle,53,0
|
||||||
SelectedBuild=0
|
SelectedBuild=0
|
||||||
VisibleModules=6,2,10
|
VisibleModules=6,2,10,8,9,11
|
||||||
|
|||||||
Reference in New Issue
Block a user