3.7 KiB
3.7 KiB
STEP 4 — 인터페이스: DTO + IExperionFastService 추가
사전 확인 (작업 전 반드시 수행)
src/Core/Application/Interfaces/IExperionServices.cs파일을 열어 전체 내용을 읽는다.- 아래 항목을 확인하고 기록한다:
- STEP 1이 완료되어
FastSession,FastRecord클래스가 존재하는가? IExperionFastService인터페이스가 이미 존재하는가? → 있으면 이 STEP 건너뜀FastSessionInforecord가 이미 존재하는가?FastSessionStartRequestrecord가 이미 존재하는가?FastSessionCreateRequestrecord가 이미 존재하는가?FastQueryResultrecord가 이미 존재하는가?
- STEP 1이 완료되어
작업 내용
파일: src/Core/Application/Interfaces/IExperionServices.cs
파일 하단에 아래 내용을 추가한다.
DTO Records
// ── fastTable DTOs ────────────────────────────────────────────────────────────
public record FastSessionInfo(
int Id,
string Name,
DateTime StartedAt,
DateTime? EndedAt,
string Status,
int SamplingMs,
int DurationSec,
string[] TagList,
int RowCount,
int? RetentionDays,
bool Pinned
);
public record FastSessionStartRequest(
string Name,
int SamplingMs,
int DurationSec,
string[] TagList,
int? RetentionDays = null
);
public record FastSessionCreateRequest(
string Name,
int SamplingMs,
int DurationSec,
string[] TagList,
int? RetentionDays = null
);
public record FastQueryResult(
int SessionId,
DateTime From,
DateTime To,
string[] TagNames,
IEnumerable<FastRecord> Items,
int TotalCount
);
public record PinRequest(bool Pinned);
IExperionFastService 인터페이스
public interface IExperionFastService
{
Task<FastSessionInfo> StartSessionAsync(FastSessionStartRequest request);
Task StopSessionAsync(int sessionId);
Task DeleteSessionAsync(int sessionId);
Task PinSessionAsync(int sessionId, bool pinned);
Task<FastSessionInfo?> GetSessionAsync(int sessionId);
Task<IEnumerable<FastSessionInfo>> GetSessionsAsync();
Task<FastQueryResult> GetRecordsAsync(int sessionId, DateTime? from, DateTime? to, string format = "long");
Task ExportCsvAsync(int sessionId, Stream stream, DateTime? from = null, DateTime? to = null);
}
사후 확인 (작업 후 반드시 수행)
IExperionServices.cs파일을 다시 열어 추가된 내용을 읽는다.- 아래 항목을 하나씩 확인한다:
FastSessionInforecord 존재 (11개 필드)FastSessionStartRequestrecord 존재FastSessionCreateRequestrecord 존재 (StartRequest와 별도로)FastQueryResultrecord 존재PinRequestrecord 존재IExperionFastService인터페이스 존재 (메서드 8개)ExportCsvAsync의Stream파라미터가 올바른가?
dotnet build src/Web실행 → 에러 0개, 경고는 기존 9개 (TextToSqlController, ExperionOpcClient, ExperionRealtimeService) 확인- 문제가 있으면 수정 후 다시 빌드 확인
완료 조건
dotnet build src/Web결과: 에러 0, 경고 9개 (기존)- DTO 5종 (
FastSessionInfo,FastSessionStartRequest,FastSessionCreateRequest,FastQueryResult,PinRequest), 인터페이스 1개 (IExperionFastService) 모두 존재