tomatophobia / allowance-chart

다수의 증권 계좌로 구성된 포트폴리오 관리 서비스
1 stars 0 forks source link

증권거래내역 입력하는 페이지 만들기 (프론트앤드 only) #42

Closed tomatophobia closed 2 years ago

tomatophobia commented 2 years ago

고객이 직접 일일이 거래내역을 하나씩 입력하지 않고 전체 파일을 입력하는 방식을 택하면서 여러 이슈가 같이 해결 가능해짐. 또한 프론트부터 DB까지 전체 사이클을 도는 첫 번째 이슈가 될 것으로 보임

tomatophobia commented 2 years ago

https://java.ihoney.pe.kr/428 webjars를 이용하여 클라이언트 의존성을 서버에서 명시적으로 관리하기

tomatophobia commented 2 years ago

https://adminlte.io AdminLTE 라는 부트스트랩으로 관리자페이지 포맷 빠르게 만들기가 있는 것 같은데 그거 사용하기로 했음. (diamond에서 사용했음. webjars에 프리셋이 있음)

tomatophobia commented 2 years ago

PR 범위가 너무 커서 #41 유저스토리 프론트 앤드 구성까지만으로 범위 줄임

tomatophobia commented 2 years ago

https://com-lihaoyi.github.io/scalatags

생각보다 공식 문서에 내가 모르는 기능도 많긴 한 듯

tomatophobia commented 2 years ago

엔드포인트 테스트 만들기 테이퍼 문서 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 해당 문서에서 내가 사용하는 백엔드 인터프리터별 스텁 만드는 법이 나옴

tomatophobia commented 2 years ago

sttp client의 백앤드로 Java 11+ HttpClient, async-http-client, armeria를 선택할 수 있었는데 armeria가 멋있어보여서 그걸 선택함

tomatophobia commented 2 years ago

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")
tomatophobia commented 2 years ago

post 요청 테스트 하는데 NotImplementedError 발생

tapir github에 검색하니까 issue, pr이 각각 나왔음. 내용을 보니까 내가 에러나는 위치와 똑같은 것 같은데 내가 보는 테이퍼 코드에는 반영이 안되어있음.

확인해보니 충돌 때문에 0.18.3을 쓰고 있는데 위 PR이 반영되기 전 버전임;;