Testing /api/locust/v01/SendWarning
This commit is contained in:
2
pom.xml
2
pom.xml
@ -57,7 +57,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.postgresql</groupId>
|
<groupId>org.postgresql</groupId>
|
||||||
<artifactId>postgresql</artifactId>
|
<artifactId>postgresql</artifactId>
|
||||||
<version>42.7.3</version>
|
<version>42.7.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.json</groupId>
|
<groupId>org.json</groupId>
|
||||||
|
|||||||
@ -2333,7 +2333,7 @@ public class AcceptJSON implements ServletContextAware {
|
|||||||
json = e.getJson();
|
json = e.getJson();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
String uuid = UUID.randomUUID().toString();
|
String uuid = UUID.randomUUID().toString();
|
||||||
logger.error(MarkerFactory.getMarker(uuid), e.getMessage(), e);
|
logger.error(MarkerFactory.getMarker(uuid), ex.getMessage(), ex);
|
||||||
json = Tools.createJSONError(10000,"Internal_Server_Error", (String)null, uuid);
|
json = Tools.createJSONError(10000,"Internal_Server_Error", (String)null, uuid);
|
||||||
}
|
}
|
||||||
return json.toString();
|
return json.toString();
|
||||||
|
|||||||
@ -123,7 +123,7 @@ public class SendWarning {
|
|||||||
t.user_uid,
|
t.user_uid,
|
||||||
t.lat,
|
t.lat,
|
||||||
t.lon,
|
t.lon,
|
||||||
u.email,
|
'irigm@mail.ru' as email, --u.email,
|
||||||
l.short_name,
|
l.short_name,
|
||||||
t.temperature_air,
|
t.temperature_air,
|
||||||
t.warn_air,
|
t.warn_air,
|
||||||
|
|||||||
@ -5,8 +5,11 @@ import io.jsonwebtoken.Jws;
|
|||||||
import io.jsonwebtoken.Jwts;
|
import io.jsonwebtoken.Jwts;
|
||||||
import jakarta.servlet.ServletContext;
|
import jakarta.servlet.ServletContext;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.ccalm.main.AcceptJSON;
|
||||||
import org.ccalm.main.engine.EngineController;
|
import org.ccalm.main.engine.EngineController;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.slf4j.MarkerFactory;
|
import org.slf4j.MarkerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
@ -30,7 +33,7 @@ import java.util.UUID;
|
|||||||
@Controller
|
@Controller
|
||||||
public class LoginController implements ServletContextAware {
|
public class LoginController implements ServletContextAware {
|
||||||
|
|
||||||
private static final org.apache.logging.log4j.Logger logger = LogManager.getLogger(EngineController.class);
|
private static final Logger logger = LoggerFactory.getLogger(LoginController.class);
|
||||||
|
|
||||||
private javax.servlet.ServletContext context;
|
private javax.servlet.ServletContext context;
|
||||||
private final NamedParameterJdbcTemplate jdbcTemplate;
|
private final NamedParameterJdbcTemplate jdbcTemplate;
|
||||||
|
|||||||
@ -21,9 +21,9 @@ import java.util.UUID;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class Tools {
|
public class LTools {
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(Tools.class);
|
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(LTools.class);
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
public static JSONObject createJSONError(int code, String message, String setting, String marker) {
|
public static JSONObject createJSONError(int code, String message, String setting, String marker) {
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
|
|||||||
@ -26,6 +26,7 @@ public class EmailUtility {
|
|||||||
String subject, String message) throws AddressException,
|
String subject, String message) throws AddressException,
|
||||||
MessagingException
|
MessagingException
|
||||||
{
|
{
|
||||||
|
|
||||||
// sets SMTP server properties
|
// sets SMTP server properties
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user