Closed tomatophobia closed 2 years ago
https://java.ihoney.pe.kr/428 webjars를 이용하여 클라이언트 의존성을 서버에서 명시적으로 관리하기
https://adminlte.io AdminLTE 라는 부트스트랩으로 관리자페이지 포맷 빠르게 만들기가 있는 것 같은데 그거 사용하기로 했음. (diamond에서 사용했음. webjars에 프리셋이 있음)
PR 범위가 너무 커서 #41 유저스토리 프론트 앤드 구성까지만으로 범위 줄임
https://com-lihaoyi.github.io/scalatags
생각보다 공식 문서에 내가 모르는 기능도 많긴 한 듯
엔드포인트 테스트 만들기 테이퍼 문서 https://tapir.softwaremill.com/en/latest/testing.html
읽어보니까 Akka http 인터프린터를 기반으로 한 BackendStub을 사용하고 있었음.
ZIO에 맞는 것을 생성하려니까 sttp에서 만든 MonadError 타입클래스 인스턴스가 필요했음.
cats MonadError인줄 알고 zio.interop.catz를 사용했지만 서로 달랐음.
테이퍼가 아닌 sttp 문서에서 BackendStub 부분에서 찾음 https://sttp.softwaremill.com/en/latest/testing.html 해당 문서에서 내가 사용하는 백엔드 인터프리터별 스텁 만드는 법이 나옴
sttp client의 백앤드로 Java 11+ HttpClient, async-http-client, armeria를 선택할 수 있었는데 armeria가 멋있어보여서 그걸 선택함
multipartBody가 필요해서 결국 streamBody 만들다가 말았음.
val registerTransactionHistory: Endpoint[Stream[Throwable, Byte], String, Unit, ZioStreams] =
endpoint.post
.in("transaction-history")
.in(
streamBody(ZioStreams)(
Schema.schemaForFile,
CodecFormat.MultipartFormData(),
Some(Charset.forName("EUC-KR"))
)
)
.errorOut(stringBody)
.tag(ApiDocTag.transactionHistory)
.summary("Register transaction history file")
고객이 직접 일일이 거래내역을 하나씩 입력하지 않고 전체 파일을 입력하는 방식을 택하면서 여러 이슈가 같이 해결 가능해짐. 또한 프론트부터 DB까지 전체 사이클을 도는 첫 번째 이슈가 될 것으로 보임