Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12월 개발일지 #579

Closed
veluxer62 opened this issue Dec 2, 2021 · 18 comments · Fixed by #597
Closed

12월 개발일지 #579

veluxer62 opened this issue Dec 2, 2021 · 18 comments · Fixed by #597
Labels
Retrospective write retrospective

Comments

@veluxer62
Copy link
Owner

No description provided.

@veluxer62 veluxer62 added the Retrospective write retrospective label Dec 2, 2021
@veluxer62
Copy link
Owner Author

ES의 Mutimatch 쿼리에서 field에 ^를 주면 socre 점수를 조절할 수 있다.(Field boosting) 스코어별 정렬 시 사용하면 좋음

GET /_search
{
  "query": {
    "multi_match" : {
      "query" : "this is a test",
      "fields" : [ "subject^3", "message" ] 
    }
  }
}

subject는 3 점의 스코어를 곱하지만 message는 곱하지 않는다.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html#field-boost

@veluxer62
Copy link
Owner Author

Jackson 클레스 레벨에서 카멜케이스와 스네이크 케이스 자동 변환 설정

@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy::class)

@veluxer62
Copy link
Owner Author

Resouce파일에서 내용 가져오는 코드중 그나마 젤 깔끔한 방법

val resource = ClassPathResource("elasticsearch/settings/cart_product_settings.json")
val content = IOUtils.toString(resource.inputStream, StandardCharsets.UTF_8)

@veluxer62
Copy link
Owner Author

변수명 짓기

https://curioustore.com/#!/

@veluxer62
Copy link
Owner Author

T3 micro maria db 최대 connection 개수가 31개 밖에 안주네;;

image

@veluxer62
Copy link
Owner Author

circle ci badge

https://circleci.com/docs/2.0/status-badges/

@veluxer62
Copy link
Owner Author

이런게 잇네

https://github.com/EndBug/add-and-commit

@veluxer62
Copy link
Owner Author

Jacoco badge generator는 githubaction에서 안됨, 아마 사설레포는 엔터프라이즈에서 가능한듯
https://github.com/cicirello/jacoco-badge-generator

이게 잇네
https://github.com/dawnwords/jacoco-badge-gradle-plugin

@veluxer62
Copy link
Owner Author

@veluxer62
Copy link
Owner Author

mockk 는 아직 constructor verify 지원안해주네 ㅠㅠㅠ

mockk/mockk#163

@veluxer62
Copy link
Owner Author

@veluxer62
Copy link
Owner Author

아 ㅠㅠ private property mocking이 필요한데 버그때매 안되네 ㅠ

mockk/mockk#263

@veluxer62
Copy link
Owner Author

veluxer62 commented Dec 19, 2021

왜 안되냐 ㅡㅡ

https://mockk.io/#private-functions-mocking--dynamic-calls

원인을 찾음 private 프로퍼티는 setter와 getter를 만들지 않음 그래서 getProperty를 쓰면 응답하지 않는거임
그래서 만약 테스트 하고 싶으면 protected로 해야함.

동료가 바이트 코드 까서 확인한 내용임

@veluxer62
Copy link
Owner Author

@veluxer62
Copy link
Owner Author

cloneable의 clone 함수는 기본적으로 protected 함수이다. 외부에서 사용하도록 하려면 public으로 정의해야 한다.

@veluxer62
Copy link
Owner Author

veluxer62 commented Dec 20, 2021

CORS 설정 에러 발생시 후행 슬래시를 넣어보자

https://stackoverflow.com/questions/42168773/how-to-resolve-preflight-is-invalid-redirect-or-redirect-is-not-allowed-for

이는 API가 아래와 같이 후행 슬레시가 적혀 있어서 발생한 문젠데 웹에서 후행슬레시를 넣지 않고 요청한다면 자동으로 리다이렉트를 시켜주는것처럼 보인다.

참고로 CORS의 기본 method 허용은 GET, POST이다 그래서 redirect시 사용하는 OPTION은 동작하지 않는다.

image

@veluxer62
Copy link
Owner Author

circleci에서 pull request 에만 ci가 동작하도록 하기 위해서는 아래 와 같이 설정을 해줘야 한다

image

@veluxer62
Copy link
Owner Author

prune option enable

git config --global fetch.prune true

veluxer62 added a commit that referenced this issue Jan 15, 2022
veluxer62 added a commit that referenced this issue Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Retrospective write retrospective
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant