4.0 KiB
4.0 KiB
STEP 5 — 인터페이스: IExperionOpcClient + IExperionDbService 확장
사전 확인 (작업 전 반드시 수행)
src/Core/Application/Interfaces/IExperionOpcClient.cs파일을 열어 전체 내용을 읽는다.src/Core/Application/Interfaces/IExperionDbService.cs파일을 열어 전체 내용을 읽는다.- 아래 항목을 확인하고 기록한다:
- STEP 4가 완료되어 DTO들이 존재하는가?
IExperionOpcClient에IsConnectedAsync메서드가 이미 있는가?IExperionOpcClient에CreateSessionAsync메서드가 이미 있는가?IExperionDbService에CreateFastSessionAsync메서드가 이미 있는가?IExperionDbService에BatchInsertFastRecordsAsync메서드가 이미 있는가?IExperionDbService에GetExpiredFastSessionsAsync메서드가 이미 있는가?
작업 1 — IExperionOpcClient 확장
파일: src/Core/Application/Interfaces/IExperionOpcClient.cs
인터페이스에 아래 두 메서드를 추가한다:
// fastTable용 메서드
Task<bool> IsConnectedAsync(ApplicationConfiguration cfg);
Task<ISession> CreateSessionAsync(ApplicationConfiguration cfg);
작업 2 — IExperionDbService 확장
파일: src/Core/Application/Interfaces/IExperionDbService.cs
인터페이스에 아래 메서드들을 추가한다:
// ── FastSession ───────────────────────────────────────────────────────────────
Task<FastSession> CreateFastSessionAsync(FastSessionCreateRequest request);
Task UpdateFastSessionStatusAsync(int sessionId, string status);
Task UpdateFastSessionRowCountAsync(int sessionId, int rowCount);
Task UpdateFastSessionPinnedAsync(int sessionId, bool pinned);
Task<FastSession?> GetFastSessionAsync(int sessionId);
Task<IEnumerable<FastSession>> GetFastSessionsAsync();
Task DeleteFastSessionAsync(int sessionId);
Task<IEnumerable<FastSession>> GetExpiredFastSessionsAsync();
// ── FastRecord ────────────────────────────────────────────────────────────────
Task<FastQueryResult> GetFastRecordsAsync(int sessionId, DateTime? from, DateTime? to);
Task BatchInsertFastRecordsAsync(IEnumerable<FastRecord> records);
Task ExportFastRecordsToCsvAsync(int sessionId, Stream stream, DateTime? from, DateTime? to);
// ── 공통 (이미 없는 경우만) ──────────────────────────────────────────────────
Task<string?> GetNodeIdByTagNameAsync(string tagName);
사후 확인 (작업 후 반드시 수행)
- 두 파일을 다시 열어 변경 내용을 읽는다.
- 아래 항목을 하나씩 확인한다:
IExperionOpcClient에IsConnectedAsync(ApplicationConfiguration cfg)존재IExperionOpcClient에CreateSessionAsync(ApplicationConfiguration cfg)존재IExperionDbService에 FastSession 관련 메서드 8개 모두 존재IExperionDbService에 FastRecord 관련 메서드 3개 모두 존재IExperionDbService에GetNodeIdByTagNameAsync존재- 반환 타입이 올바른가? (
Task<FastSession?>nullable 포함)
dotnet build src/Web실행 → 에러 14개 (구현체 미완료, STEP 6~7에서 해결)- 구현체 빌드 에러는 예상된 결과 (인터페이스만 추가한 단계)
⚠️ 주의: 인터페이스만 추가하는 단계이므로 구현체 빌드 에러는 STEP 6~7에서 해결한다.
완료 조건
dotnet build src/Web결과: 에러 14개 (구현체 미완료, STEP 6~7에서 해결)- 두 인터페이스에 지정된 메서드 시그니처 모두 존재