Testing /api/locust/v01/SendWarning

This commit is contained in:
2025-06-30 07:27:44 +05:00
parent 7d8ab90e49
commit 36783d2de7
6 changed files with 10 additions and 6 deletions

View File

@ -57,7 +57,7 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.7.3</version>
<version>42.7.7</version>
</dependency>
<dependency>
<groupId>org.json</groupId>

View File

@ -2333,7 +2333,7 @@ public class AcceptJSON implements ServletContextAware {
json = e.getJson();
} catch (Exception ex) {
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);
}
return json.toString();

View File

@ -123,7 +123,7 @@ public class SendWarning {
t.user_uid,
t.lat,
t.lon,
u.email,
'irigm@mail.ru' as email, --u.email,
l.short_name,
t.temperature_air,
t.warn_air,

View File

@ -5,8 +5,11 @@ import io.jsonwebtoken.Jws;
import io.jsonwebtoken.Jwts;
import jakarta.servlet.ServletContext;
import org.apache.logging.log4j.LogManager;
import org.ccalm.main.AcceptJSON;
import org.ccalm.main.engine.EngineController;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MarkerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -30,7 +33,7 @@ import java.util.UUID;
@Controller
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 final NamedParameterJdbcTemplate jdbcTemplate;

View File

@ -21,9 +21,9 @@ import java.util.UUID;
import java.util.regex.Matcher;
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) {
JSONObject json = new JSONObject();

View File

@ -26,6 +26,7 @@ public class EmailUtility {
String subject, String message) throws AddressException,
MessagingException
{
// sets SMTP server properties
Properties properties = new Properties();