mirror of
https://gitee.com/pnoker/iot-dc3.git
synced 2026-11-03 03:32:08 +08:00
docs(common-public): simplify verbose class-level Javadocs to concise one-liners
Remove redundant <p> paragraphs that restate the class name. Keep @author/@version/@since tags consistent across all classes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
committed by
Copilot
co-authored by
Claude Opus 4.7
parent
eff7d4b3b1
commit
4a17fcd7fc
+4
@@ -24,6 +24,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
* <p>
|
||||
* HTTP port 8600, context path /agentic. No gRPC server — this service is a pure consumer
|
||||
* of other center services.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class AgenticApplication {
|
||||
|
||||
+4
@@ -26,6 +26,10 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
* <p>
|
||||
* Activated when {@code dc3.agentic.enabled=true} (default). Scans all components under
|
||||
* {@code io.github.pnoker.common.agentic}.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@ConditionalOnProperty(name = "dc3.agentic.enabled", havingValue = "true", matchIfMissing = true)
|
||||
|
||||
+4
@@ -25,6 +25,10 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
*
|
||||
* <p>
|
||||
* Prefix: {@code dc3.agentic}
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -32,6 +32,10 @@ import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* Configures the Spring AI ChatClient with tool registration and chat memory.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Configuration
|
||||
@EnableConfigurationProperties(AgenticProperties.class)
|
||||
|
||||
+4
@@ -18,6 +18,10 @@ package io.github.pnoker.common.agentic.constant;
|
||||
|
||||
/**
|
||||
* Agentic service constants.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
public class AgenticConstant {
|
||||
|
||||
|
||||
+4
@@ -45,6 +45,10 @@ import java.util.UUID;
|
||||
* <p>
|
||||
* Exposes {@code POST /v1/chat/completions} with both streaming (SSE) and non-streaming
|
||||
* (JSON) response modes, following the OpenAI API format.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
|
||||
+5
@@ -29,6 +29,11 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping(AgenticConstant.SESSION_URL_PREFIX)
|
||||
|
||||
+6
@@ -19,6 +19,12 @@ package io.github.pnoker.common.agentic.dal;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import io.github.pnoker.common.agentic.entity.model.SessionDO;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
public interface SessionManager extends IService<SessionDO> {
|
||||
|
||||
}
|
||||
|
||||
+5
@@ -22,6 +22,11 @@ import io.github.pnoker.common.agentic.entity.model.SessionDO;
|
||||
import io.github.pnoker.common.agentic.mapper.SessionMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Service
|
||||
public class SessionManagerImpl extends ServiceImpl<SessionMapper, SessionDO> implements SessionManager {
|
||||
|
||||
|
||||
+5
@@ -21,6 +21,11 @@ import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
|
||||
+5
@@ -26,6 +26,11 @@ import org.mapstruct.Mapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Mapper(componentModel = "spring", uses = {MapStructUtil.class})
|
||||
public interface SessionBuilder {
|
||||
|
||||
|
||||
+5
@@ -25,6 +25,11 @@ import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
|
||||
+5
@@ -22,6 +22,11 @@ import lombok.*;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
|
||||
+3
@@ -26,8 +26,11 @@ import java.util.List;
|
||||
/**
|
||||
* OpenAI-compatible chat completion request body.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @see <a href="https://platform.openai.com/docs/api-reference/chat/create">OpenAI API
|
||||
* Reference</a>
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -23,6 +23,10 @@ import lombok.Setter;
|
||||
|
||||
/**
|
||||
* A single message in the OpenAI-compatible chat completion request.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+3
@@ -25,8 +25,11 @@ import java.util.List;
|
||||
/**
|
||||
* A single SSE chunk in the OpenAI streaming chat completion response.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @see <a href="https://platform.openai.com/docs/api-reference/chat/streaming">OpenAI
|
||||
* Streaming</a>
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+3
@@ -24,8 +24,11 @@ import java.util.List;
|
||||
/**
|
||||
* OpenAI-compatible non-streaming chat completion response.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @see <a href="https://platform.openai.com/docs/api-reference/chat/object">OpenAI Chat
|
||||
* Object</a>
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+5
@@ -22,6 +22,11 @@ import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
|
||||
+6
@@ -19,6 +19,12 @@ package io.github.pnoker.common.agentic.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.github.pnoker.common.agentic.entity.model.SessionDO;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
public interface SessionMapper extends BaseMapper<SessionDO> {
|
||||
|
||||
}
|
||||
|
||||
+6
@@ -20,6 +20,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.github.pnoker.common.agentic.entity.bo.SessionBO;
|
||||
import io.github.pnoker.common.agentic.entity.query.SessionQuery;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
public interface SessionService {
|
||||
|
||||
/**
|
||||
|
||||
+5
@@ -34,6 +34,11 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SessionServiceImpl implements SessionService {
|
||||
|
||||
+4
@@ -29,6 +29,10 @@ import java.util.List;
|
||||
* Each skill provides a scoped set of tools, a system prompt addition, and few-shot
|
||||
* examples that guide the LLM behavior for a particular domain (e.g. device queries, data
|
||||
* monitoring, device control).
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -34,6 +34,10 @@ import java.util.Map;
|
||||
* Scans the classpath for skill definition YAML files ({@code classpath*:skills/*.yml})
|
||||
* at application startup, parses each file into a {@link SkillDefinition}, and registers
|
||||
* enabled skills into the {@link SkillRegistry}.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
|
||||
+4
@@ -23,6 +23,10 @@ import java.util.*;
|
||||
/**
|
||||
* Central registry that holds all {@link SkillDefinition} instances loaded at startup.
|
||||
* Supports lookup by name and enumeration of all registered skills.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Component
|
||||
public class SkillRegistry {
|
||||
|
||||
+4
@@ -34,6 +34,10 @@ import java.util.Objects;
|
||||
* <p>
|
||||
* These tools allow the model to query tenant, user, and login information by calling the
|
||||
* existing facade interfaces (routed via gRPC or local depending on dc3.facade.mode).
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
|
||||
+4
@@ -32,6 +32,10 @@ import java.util.List;
|
||||
* Delegates to the facade layer ({@link PointValueFacade} and
|
||||
* {@link PointValueCommandFacade}) so that calls follow the project's local/gRPC
|
||||
* dual-mode convention.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
|
||||
+4
@@ -41,6 +41,10 @@ import java.util.stream.Collectors;
|
||||
* <p>
|
||||
* These tools allow the model to query devices, drivers, and points (metrics) through the
|
||||
* existing facade interfaces.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
|
||||
+1
@@ -31,6 +31,7 @@ import java.util.Optional;
|
||||
* falls back to the legacy {@code rangeHours} integer.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.3
|
||||
*/
|
||||
@Getter
|
||||
|
||||
+1
@@ -31,6 +31,7 @@ import java.util.List;
|
||||
* </p>
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.2
|
||||
*/
|
||||
public interface DashboardService {
|
||||
|
||||
+1
@@ -25,6 +25,7 @@ import io.github.pnoker.common.data.entity.vo.dashboard.SystemHealthVO;
|
||||
* online).
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.2
|
||||
*/
|
||||
public interface SystemHealthService {
|
||||
|
||||
+1
@@ -41,6 +41,7 @@ import static io.github.pnoker.common.data.constant.DashboardLimits.*;
|
||||
|
||||
/**
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.2
|
||||
*/
|
||||
@Slf4j
|
||||
|
||||
+1
@@ -54,6 +54,7 @@ import java.util.concurrent.CompletableFuture;
|
||||
* </p>
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.2
|
||||
*/
|
||||
@Slf4j
|
||||
|
||||
+1
@@ -61,6 +61,7 @@ import java.util.concurrent.TimeoutException;
|
||||
* </p>
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.2
|
||||
*/
|
||||
@Slf4j
|
||||
|
||||
Vendored
+4
@@ -41,6 +41,10 @@ import java.util.concurrent.TimeUnit;
|
||||
* because its TTL elapsed — e.g. the driver / device status keys use this to synthesise
|
||||
* OFFLINE alarm rows without a scanning thread.
|
||||
* </p>
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
|
||||
+4
@@ -38,6 +38,10 @@ import java.util.stream.Collectors;
|
||||
* the data service JVM. Misses fall through to the underlying time-series repository,
|
||||
* exactly as the Redis version did.
|
||||
* </p>
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Service
|
||||
public class PointValueLocalCacheService {
|
||||
|
||||
+1
@@ -30,6 +30,7 @@ package io.github.pnoker.common.data.constant;
|
||||
* </p>
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.4
|
||||
*/
|
||||
public final class DashboardLimits {
|
||||
|
||||
+1
@@ -51,6 +51,7 @@ import java.util.Map;
|
||||
* </ul>
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.2
|
||||
*/
|
||||
@Slf4j
|
||||
|
||||
+4
@@ -23,6 +23,10 @@ import lombok.ToString;
|
||||
|
||||
/**
|
||||
* (dow, hour, count) heatmap cell.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -23,6 +23,10 @@ import lombok.ToString;
|
||||
|
||||
/**
|
||||
* Four-age-bucket counts + total unconfirmed.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -24,6 +24,10 @@ import lombok.ToString;
|
||||
/**
|
||||
* Tenant-wide (total, unconfirmed) counters — the service layer combines this with
|
||||
* separate per-source and today-only queries to populate the full AlertStatsVO.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -25,6 +25,10 @@ import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* One raw event row from the paged / latest list.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -23,6 +23,10 @@ import lombok.ToString;
|
||||
|
||||
/**
|
||||
* One day's split alert count (device vs driver source).
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -23,6 +23,10 @@ import lombok.ToString;
|
||||
|
||||
/**
|
||||
* Generic (key, count) aggregate row; key is Object to fit JDBC int or varchar.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -23,6 +23,10 @@ import lombok.ToString;
|
||||
|
||||
/**
|
||||
* Co-occurring event pair.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -23,6 +23,10 @@ import lombok.ToString;
|
||||
|
||||
/**
|
||||
* Point declared but without history samples.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -23,6 +23,10 @@ import lombok.ToString;
|
||||
|
||||
/**
|
||||
* (entityId, count) for Top-N queries on the pv history.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -23,6 +23,10 @@ import lombok.ToString;
|
||||
|
||||
/**
|
||||
* (source, sourceId, eventTypeFlag, count) — one flapping (source, type) pair.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -26,6 +26,10 @@ import java.time.LocalDateTime;
|
||||
/**
|
||||
* Hourly bucket from {@code date_trunc('hour', …)} — bucket is the top-of-hour timestamp,
|
||||
* count is the number of events in that hour.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -23,6 +23,10 @@ import lombok.ToString;
|
||||
|
||||
/**
|
||||
* Latency histogram bin + count.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -26,6 +26,10 @@ import java.time.LocalDateTime;
|
||||
/**
|
||||
* Live-feed pv row — all values coerced to text so the union over 7 typed hypertables
|
||||
* stays compatible.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -23,6 +23,10 @@ import lombok.ToString;
|
||||
|
||||
/**
|
||||
* Per-day ack-latency percentile row.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -23,6 +23,10 @@ import lombok.ToString;
|
||||
|
||||
/**
|
||||
* (profileId, deviceId, alarmCount) for per-profile peer deviation.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -23,6 +23,10 @@ import lombok.ToString;
|
||||
|
||||
/**
|
||||
* Per-service driver + device rollup.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -25,6 +25,10 @@ import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* One config-change edit timestamp.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -25,6 +25,10 @@ import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* A (device, point) pair that's been silent since lastSeen.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -23,6 +23,10 @@ import lombok.ToString;
|
||||
|
||||
/**
|
||||
* (source, sourceId, count) — one rank entry.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -23,6 +23,10 @@ import lombok.ToString;
|
||||
|
||||
/**
|
||||
* (source, total, unconfirmed) — per-source alert counts.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -27,6 +27,10 @@ import java.time.LocalDateTime;
|
||||
* One time-bucketed count row. Bucket comes from Postgres {@code time_bucket()} which
|
||||
* returns TIMESTAMPTZ; JDBC maps it to LocalDateTime directly so no service-side parsing
|
||||
* is needed.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+1
@@ -30,6 +30,7 @@ import java.io.Serializable;
|
||||
* handwrite {@code Integer.parseInt(b.get("..").toString())} for every entry.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.4
|
||||
*/
|
||||
@Getter
|
||||
|
||||
+1
@@ -30,6 +30,7 @@ import java.io.Serializable;
|
||||
* 0=Sunday..6=Saturday; {@code hour} is 0..23.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.2
|
||||
*/
|
||||
@Getter
|
||||
|
||||
+4
@@ -28,6 +28,10 @@ import java.io.Serializable;
|
||||
/**
|
||||
* Count of still-unconfirmed alarms bucketed by how long they've been sitting. The 24h+
|
||||
* bucket is the SLA breach indicator.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+1
@@ -30,6 +30,7 @@ import java.io.Serializable;
|
||||
* a fully-padded 7 × 24 grid.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.3
|
||||
*/
|
||||
@Getter
|
||||
|
||||
+1
@@ -31,6 +31,7 @@ import java.time.LocalDateTime;
|
||||
* point_id) or {@code driver}.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.2
|
||||
*/
|
||||
@Getter
|
||||
|
||||
+1
@@ -30,6 +30,7 @@ import java.util.List;
|
||||
* Aggregate alert counters for the home page alert card.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.2
|
||||
*/
|
||||
@Getter
|
||||
|
||||
+1
@@ -29,6 +29,7 @@ import java.io.Serializable;
|
||||
* Top event source by alarm count.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.3
|
||||
*/
|
||||
@Getter
|
||||
|
||||
+1
@@ -29,6 +29,7 @@ import java.io.Serializable;
|
||||
* Daily event count for a single day, split by device and driver source.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.3
|
||||
*/
|
||||
@Getter
|
||||
|
||||
+1
@@ -31,6 +31,7 @@ import java.io.Serializable;
|
||||
* {@code driver-alarm}, {@code device-offline}, {@code device-alarm}).
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.3
|
||||
*/
|
||||
@Getter
|
||||
|
||||
+4
@@ -30,6 +30,10 @@ import java.time.LocalDateTime;
|
||||
* One config-change event — a driver/device/profile row whose operate_time differs from
|
||||
* create_time (i.e. someone edited it). Overlaid on the alarm trend chart so spikes can
|
||||
* be attributed to recent changes.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -29,6 +29,10 @@ import java.io.Serializable;
|
||||
* Two events that fired within a small time window of each other, enough times to suggest
|
||||
* a cascading-failure relationship. Frontend renders these as a network graph (A—B edge
|
||||
* weighted by coCount).
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -31,6 +31,10 @@ import java.util.List;
|
||||
* Config-vs-reality coverage report — points declared in dc3_point that never produced
|
||||
* any point_value row. {@code missingPoints / totalPoints} is the gap ratio;
|
||||
* {@code items} is the (capped) list of offending ids so the UI can drill in.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -29,6 +29,10 @@ import java.io.Serializable;
|
||||
* A (source, eventType) pair that fired repeatedly in the window — i.e. is "flapping".
|
||||
* Different from Storm which is pure per-source volume; Flap narrows the signal to one
|
||||
* event-type so operators can tell whether the same condition keeps re-tripping.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+1
@@ -31,6 +31,7 @@ import java.io.Serializable;
|
||||
* 3=1-5s, 4=5-30s, 5=>=30s.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.2
|
||||
*/
|
||||
@Getter
|
||||
|
||||
+1
@@ -29,6 +29,7 @@ import java.time.LocalDateTime;
|
||||
* every typed hypertable.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.2
|
||||
*/
|
||||
@Getter
|
||||
|
||||
+4
@@ -29,6 +29,10 @@ import java.io.Serializable;
|
||||
* One day's MTTA (mean time to acknowledge) statistic, computed as (operate_time -
|
||||
* create_time) on confirm_flag=1 events. Event table has an UPDATE trigger that stamps
|
||||
* operate_time on confirm, so the diff is the ack latency.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -28,6 +28,10 @@ import java.io.Serializable;
|
||||
/**
|
||||
* A device whose alarm rate deviates sharply from its profile peers. The ratio field is
|
||||
* alarmCount / peerMedian; service filters to ratio >= 3.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -30,6 +30,10 @@ import java.io.Serializable;
|
||||
* they serve, how much sample volume they carried in the window. Phase-1 health signal is
|
||||
* just enable% + device count + sample volume; true heartbeat/latency signals get layered
|
||||
* in later.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+4
@@ -30,6 +30,10 @@ import java.time.LocalDateTime;
|
||||
* A (device, point) pair that was active within the baseline window but has gone silent
|
||||
* for at least {@code silentMinutes}. The absence of data is itself a signal — sensors
|
||||
* don't self-report "I'm offline".
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
+1
@@ -36,6 +36,7 @@ import java.util.Map;
|
||||
* </p>
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.2
|
||||
*/
|
||||
@Getter
|
||||
|
||||
+1
@@ -29,6 +29,7 @@ import java.time.LocalDateTime;
|
||||
* hour).
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.2
|
||||
*/
|
||||
@Getter
|
||||
|
||||
+1
@@ -27,6 +27,7 @@ import java.io.Serializable;
|
||||
* the given time window).
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.2
|
||||
*/
|
||||
@Getter
|
||||
|
||||
+4
@@ -32,6 +32,10 @@ import java.util.List;
|
||||
/**
|
||||
* gRPC server implementation for the PointValue service. Delegates to
|
||||
* {@link PointValueService} and {@link PointValueCommandService}.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
|
||||
+1
@@ -30,6 +30,7 @@ import java.util.List;
|
||||
* mapping.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.2
|
||||
*/
|
||||
@Mapper
|
||||
|
||||
+1
@@ -31,6 +31,7 @@ import java.util.List;
|
||||
* see {@code entity/bo/dashboard/}.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2026.5.2
|
||||
*/
|
||||
@Mapper
|
||||
|
||||
+4
@@ -28,6 +28,10 @@ import org.springframework.core.env.ConfigurableEnvironment;
|
||||
/**
|
||||
* Spring environment post-processor that ensures the {@code driver} profile is always
|
||||
* active before driver beans are initialized.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
|
||||
+4
@@ -38,6 +38,10 @@ import java.util.Map;
|
||||
/**
|
||||
* Spring environment post-processor that derives and injects runtime driver properties
|
||||
* such as node, service, host, and client identifiers.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
|
||||
+4
@@ -34,6 +34,10 @@ import java.util.Map;
|
||||
/**
|
||||
* RabbitMQ configuration that declares the driver-specific metadata and command queues
|
||||
* together with their exchange bindings.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
|
||||
+4
@@ -28,6 +28,10 @@ import org.springframework.grpc.client.GrpcChannelFactory;
|
||||
/**
|
||||
* Spring configuration that creates the blocking gRPC stubs used by the driver SDK to
|
||||
* talk to the manager center.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Configuration
|
||||
public class GrpcStubConfig {
|
||||
|
||||
+4
@@ -21,6 +21,10 @@ import io.github.pnoker.common.entity.dto.DeviceCommandDTO;
|
||||
|
||||
/**
|
||||
* Service contract for executing point read operations.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
public interface DriverReadService {
|
||||
|
||||
|
||||
+4
@@ -40,6 +40,10 @@ import java.util.Objects;
|
||||
/**
|
||||
* Default {@link DriverReadService} implementation that resolves metadata, delegates the
|
||||
* actual read operation to the custom driver, and publishes the resulting point value.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
|
||||
+4
@@ -31,6 +31,10 @@ import org.springframework.stereotype.Service;
|
||||
* Default {@link DriverRegisterService} implementation that builds the registration
|
||||
* payload from {@link io.github.pnoker.common.driver.entity.property.DriverProperties}
|
||||
* and submits it to the manager center.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
|
||||
+4
@@ -35,6 +35,10 @@ import java.util.Objects;
|
||||
/**
|
||||
* Default {@link DriverScheduleService} implementation that validates cron settings and
|
||||
* registers the built-in Quartz jobs required by the driver runtime.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
|
||||
+4
@@ -40,6 +40,10 @@ import java.util.concurrent.TimeUnit;
|
||||
/**
|
||||
* Default {@link DriverSenderService} implementation that publishes driver events, device
|
||||
* events, heartbeats, and point values to RabbitMQ.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
|
||||
+4
@@ -26,6 +26,10 @@ import java.util.Base64;
|
||||
/**
|
||||
* Utility class providing various utility methods for encoding, decoding, and byte
|
||||
* manipulation operations including Base64, BCD, Hex, and ASCII conversions.
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
*/
|
||||
@Slf4j
|
||||
public class CodecUtil {
|
||||
|
||||
+1
@@ -18,6 +18,7 @@
|
||||
package io.github.pnoker.common.constant.common;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
|
||||
+1
@@ -20,6 +20,7 @@ package io.github.pnoker.common.exception;
|
||||
import java.text.MessageFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
|
||||
+1
@@ -20,6 +20,7 @@ package io.github.pnoker.common.exception;
|
||||
import java.text.MessageFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
|
||||
+1
@@ -20,6 +20,7 @@ package io.github.pnoker.common.exception;
|
||||
import java.text.MessageFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
|
||||
+1
@@ -20,6 +20,7 @@ package io.github.pnoker.common.exception;
|
||||
import java.text.MessageFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
|
||||
+1
@@ -20,6 +20,7 @@ package io.github.pnoker.common.exception;
|
||||
import java.text.MessageFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
|
||||
+1
@@ -20,6 +20,7 @@ package io.github.pnoker.common.exception;
|
||||
import java.text.MessageFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author pnoker
|
||||
* @version 2025.9.0
|
||||
* @since 2022.1.0
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user