[email protected] 1 месяц назад
Родитель
Сommit
02811c401b
3 измененных файлов: 9 добавлений и 3 удалений
  1. +2
    -0
      src/main/java/com/ffii/fpsms/config/security/SecurityConfig.java
  2. +1
    -2
      src/main/java/com/ffii/fpsms/modules/monitoring/web/ClientPresenceController.kt
  3. +6
    -1
      src/main/resources/application-db-toa.yml

+ 2
- 0
src/main/java/com/ffii/fpsms/config/security/SecurityConfig.java Просмотреть файл

@@ -91,6 +91,8 @@ public class SecurityConfig {
.hasAnyAuthority("TESTING", "ADMIN", "STOCK") .hasAnyAuthority("TESTING", "ADMIN", "STOCK")
.requestMatchers(HttpMethod.GET, "/product-process/Demo/Process/alerts/fg-qc-putaway") .requestMatchers(HttpMethod.GET, "/product-process/Demo/Process/alerts/fg-qc-putaway")
.hasAuthority("TESTING") .hasAuthority("TESTING")
.requestMatchers(HttpMethod.GET, "/device-presence/ping").authenticated()
.requestMatchers(HttpMethod.POST, "/device-presence/heartbeat").authenticated()
.requestMatchers(HttpMethod.GET, "/device-presence/active") .requestMatchers(HttpMethod.GET, "/device-presence/active")
.hasAnyAuthority("TESTING", "ADMIN") .hasAnyAuthority("TESTING", "ADMIN")
.requestMatchers(HttpMethod.GET, "/device-presence/history") .requestMatchers(HttpMethod.GET, "/device-presence/history")


+ 1
- 2
src/main/java/com/ffii/fpsms/modules/monitoring/web/ClientPresenceController.kt Просмотреть файл

@@ -3,7 +3,6 @@ package com.ffii.fpsms.modules.monitoring.web
import com.ffii.core.exception.BadRequestException import com.ffii.core.exception.BadRequestException
import com.ffii.fpsms.modules.common.SecurityUtils import com.ffii.fpsms.modules.common.SecurityUtils
import com.ffii.fpsms.modules.monitoring.service.ClientPresenceService import com.ffii.fpsms.modules.monitoring.service.ClientPresenceService
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
import org.springframework.http.ResponseEntity import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.PostMapping
@@ -16,9 +15,9 @@ import java.time.LocalDate
import java.time.LocalDateTime import java.time.LocalDateTime
import java.time.format.DateTimeParseException import java.time.format.DateTimeParseException


/** Always registered so client heartbeats work whenever the frontend reporter is enabled. */
@RestController @RestController
@RequestMapping("/device-presence") @RequestMapping("/device-presence")
@ConditionalOnProperty(prefix = "fpsms.monitoring", name = ["enabled"], havingValue = "true")
class ClientPresenceController( class ClientPresenceController(
private val clientPresenceService: ClientPresenceService, private val clientPresenceService: ClientPresenceService,
) { ) {


+ 6
- 1
src/main/resources/application-db-toa.yml Просмотреть файл

@@ -2,4 +2,9 @@ spring:
datasource: datasource:
jdbc-url: jdbc:mysql://10.100.0.81:3006/fpsmsdb?useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8 jdbc-url: jdbc:mysql://10.100.0.81:3006/fpsmsdb?useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8
username: root username: root
password: secret
password: secret

# TOA deployments: enable heartbeat scanners + printer checks (same as prod).
fpsms:
monitoring:
enabled: true

Загрузка…
Отмена
Сохранить