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

폐업 추정 장소 크롤링 구현 #391

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

jyoo0515
Copy link
Member

@jyoo0515 jyoo0515 commented Sep 20, 2024

Checklist

  • 일단 Candidate(폐업 추정되는 곳) 만드는 부분까지 작업하고, 이걸 admin 에서 보여주고 accept 했을 때 closed 상태로 바꾸는 것은 분리해서 작업하겠습니다
예시 Response
{
  "result": {
    "header": {
      "columns": [
        {
          "rowNum": "번호",
          "opnSfTeamCode": "개방자치단체코드",
          "mgtNo": "관리번호",
          "opnSvcId": "개방서비스ID",
          "updateGbn": "데이터갱신구분",
          "updateDt": "데이터갱신일자",
          "opnSvcNm": "개방서비스명",
          "bplcNm": "사업장명",
          "sitePostNo": "지번우편번호",
          "siteWhlAddr": "지번주소",
          "rdnPostNo": "도로명우편번호",
          "rdnWhlAddr": "도로명주소",
          "siteArea": "소재지면적",
          "apvPermYmd": "인허가일자",
          "apvCancelYmd": "인허가취소일자",
          "dcbYmd": "폐업일자",
          "clgStdt": "휴업시작일자",
          "clgEnddt": "휴업종료일자",
          "ropnYmd": "재개업일자",
          "trdStateGbn": "영업상태코드",
          "trdStateNm": "영업상태명",
          "dtlStateGbn": "상세영업상태코드",
          "dtlStateNm": "상세영업상태명",
          "x": "좌표정보(X)",
          "y": "좌표정보(Y)",
          "lastModTs": "최종수정일자",
          "uptaeNm": "업태구분명",
          "siteTel": "전화번호"
        }
      ],
      "paging": {
        "pageIndex": 1,
        "totalCount": 152,
        "pageSize": 10
      },
      "process": {
        "code": "00",
        "message": "정상 처리되었습니다."
      }
    },
    "body": {
      "rows": [
        {
          "row": [
            {
              "rowNum": 1,
              "opnSfTeamCode": 5470000,
              "mgtNo": "5470000-101-2024-00050",
              "opnSvcId": "07_24_04_P",
              "updateGbn": "I",
              "updateDt": "2024-09-20 00:12:50",
              "opnSvcNm": "일반음식점",
              "bplcNm": "신원의송영농조합법인",
              "sitePostNo": "670-805",
              "siteWhlAddr": "경상남도 거창군 거창읍 양평리 1160 스포츠파크 축제메인무대 앞 좌.우측 주차장(2024년 거창한마당대축제 - 녹색곳간 '향토음식관') ",
              "rdnPostNo": 50126,
              "rdnWhlAddr": "경상남도 거창군 거창읍 심소정길 39-36, 스포츠파크 축제메인무대 앞 좌.우측 주차장(2024년 거창한마당대축제 - 녹색곳간 '향토음식관')",
              "siteArea": "",
              "apvPermYmd": "2024-09-16",
              "apvCancelYmd": "",
              "dcbYmd": "",
              "clgStdt": "",
              "clgEnddt": "",
              "ropnYmd": "",
              "trdStateGbn": "01",
              "trdStateNm": "영업/정상",
              "dtlStateGbn": "01",
              "dtlStateNm": "영업",
              "x": "283920.055491687    ",
              "y": "244179.928393413    ",
              "lastModTs": "2024-09-16 15:28:18",
              "uptaeNm": "한식",
              "siteTel": ""
            },
            {
              "rowNum": 2,
              "opnSfTeamCode": 5470000,
              "mgtNo": "5470000-101-2024-00047",
              "opnSvcId": "07_24_04_P",
              "updateGbn": "I",
              "updateDt": "2024-09-20 00:12:50",
              "opnSvcNm": "일반음식점",
              "bplcNm": "주상면새마을협의회",
              "sitePostNo": "670-805",
              "siteWhlAddr": "경상남도 거창군 거창읍 양평리 1160 거창스포츠파크 국민체육센터 앞(2024년 거창한마당대축제 - 녹색곳간 '향토음식관' ",
              "rdnPostNo": 50126,
              "rdnWhlAddr": "경상남도 거창군 거창읍 심소정길 39-36, 거창스포츠파크 국민체육센터 앞(2024년 거창한마당대축제 - 녹색곳간 '향토음식관'",
              "siteArea": "",
              "apvPermYmd": "2024-09-15",
              "apvCancelYmd": "",
              "dcbYmd": "",
              "clgStdt": "",
              "clgEnddt": "",
              "ropnYmd": "",
              "trdStateGbn": "01",
              "trdStateNm": "영업/정상",
              "dtlStateGbn": "01",
              "dtlStateNm": "영업",
              "x": "283920.055491687    ",
              "y": "244179.928393413    ",
              "lastModTs": "2024-09-15 17:40:31",
              "uptaeNm": "한식",
              "siteTel": ""
            },
            {
              "rowNum": 3,
              "opnSfTeamCode": 5470000,
              "mgtNo": "5470000-101-2024-00048",
              "opnSvcId": "07_24_04_P",
              "updateGbn": "I",
              "updateDt": "2024-09-20 00:12:50",
              "opnSvcNm": "일반음식점",
              "bplcNm": "고향을생각하는주부들의모임(고주모)",
              "sitePostNo": "670-805",
              "siteWhlAddr": "경상남도 거창군 거창읍 양평리 1160 스포츠파크 축제메인무대 앞 좌.우측 주차장(2024년 거창한마당대축제 - 녹색곳간 '향토음식관') ",
              "rdnPostNo": 50126,
              "rdnWhlAddr": "경상남도 거창군 거창읍 심소정길 39-36, 스포츠파크 축제메인무대 앞 좌.우측 주차장(2024년 거창한마당대축제 - 녹색곳간 '향토음식관')",
              "siteArea": "",
              "apvPermYmd": "2024-09-15",
              "apvCancelYmd": "",
              "dcbYmd": "",
              "clgStdt": "",
              "clgEnddt": "",
              "ropnYmd": "",
              "trdStateGbn": "01",
              "trdStateNm": "영업/정상",
              "dtlStateGbn": "01",
              "dtlStateNm": "영업",
              "x": "283920.055491687    ",
              "y": "244179.928393413    ",
              "lastModTs": "2024-09-15 17:56:14",
              "uptaeNm": "한식",
              "siteTel": ""
            },
            {
              "rowNum": 4,
              "opnSfTeamCode": 5470000,
              "mgtNo": "5470000-101-2024-00049",
              "opnSvcId": "07_24_04_P",
              "updateGbn": "I",
              "updateDt": "2024-09-20 00:12:50",
              "opnSvcNm": "일반음식점",
              "bplcNm": "가북면새마을부녀회",
              "sitePostNo": "670-805",
              "siteWhlAddr": "경상남도 거창군 거창읍 양평리 1160 스포츠파크 축제메인무대 앞 좌.우측 주차장(2024년 거창한마당대축제 - 녹색곳간 '향토음식관') ",
              "rdnPostNo": 50126,
              "rdnWhlAddr": "경상남도 거창군 거창읍 심소정길 39-36, 스포츠파크 축제메인무대 앞 좌.우측 주차장(2024년 거창한마당대축제 - 녹색곳간 '향토음식관')",
              "siteArea": "",
              "apvPermYmd": "2024-09-15",
              "apvCancelYmd": "",
              "dcbYmd": "",
              "clgStdt": "",
              "clgEnddt": "",
              "ropnYmd": "",
              "trdStateGbn": "01",
              "trdStateNm": "영업/정상",
              "dtlStateGbn": "01",
              "dtlStateNm": "영업",
              "x": "283920.055491687    ",
              "y": "244179.928393413    ",
              "lastModTs": "2024-09-15 18:49:20",
              "uptaeNm": "한식",
              "siteTel": ""
            },
            {
              "rowNum": 5,
              "opnSfTeamCode": 4420000,
              "mgtNo": "4420000-101-2024-00025",
              "opnSvcId": "07_24_04_P",
              "updateGbn": "U",
              "updateDt": "2024-09-20 02:40:00",
              "opnSvcNm": "일반음식점",
              "bplcNm": "사노(sano)",
              "sitePostNo": "376-806",
              "siteWhlAddr": "충청북도 보은군 보은읍 이평리 175-1 ",
              "rdnPostNo": "",
              "rdnWhlAddr": "",
              "siteArea": "",
              "apvPermYmd": "2024-09-13",
              "apvCancelYmd": "",
              "dcbYmd": "2024-09-14",
              "clgStdt": "",
              "clgEnddt": "",
              "ropnYmd": "",
              "trdStateGbn": "03",
              "trdStateNm": "폐업",
              "dtlStateGbn": "02",
              "dtlStateNm": "폐업",
              "x": "264741.909810365    ",
              "y": "331943.437739862    ",
              "lastModTs": "2024-09-15 04:15:10",
              "uptaeNm": "기타",
              "siteTel": ""
            },
            {
              "rowNum": 6,
              "opnSfTeamCode": 5100000,
              "mgtNo": "5100000-101-2024-00087",
              "opnSvcId": "07_24_04_P",
              "updateGbn": "U",
              "updateDt": "2024-09-20 02:40:00",
              "opnSvcNm": "일반음식점",
              "bplcNm": "승혜밥집",
              "sitePostNo": "770-030",
              "siteWhlAddr": "경상북도 영천시 문외동 317 영천강변공원 공중화장실(1) ",
              "rdnPostNo": 38853,
              "rdnWhlAddr": "경상북도 영천시 최무선로 364, 영천강변공원 일원 (문외동)",
              "siteArea": "250.00",
              "apvPermYmd": "2024-09-13",
              "apvCancelYmd": "",
              "dcbYmd": "2024-09-17",
              "clgStdt": "",
              "clgEnddt": "",
              "ropnYmd": "",
              "trdStateGbn": "03",
              "trdStateNm": "폐업",
              "dtlStateGbn": "02",
              "dtlStateNm": "폐업",
              "x": "374605.717499352    ",
              "y": "276042.425405072    ",
              "lastModTs": "2024-09-18 04:15:08",
              "uptaeNm": "한식",
              "siteTel": ""
            },
            {
              "rowNum": 7,
              "opnSfTeamCode": 3520000,
              "mgtNo": "3520000-101-2024-00451",
              "opnSvcId": "07_24_04_P",
              "updateGbn": "U",
              "updateDt": "2024-09-20 02:40:00",
              "opnSvcNm": "일반음식점",
              "bplcNm": "사회적협동조합 엠커뮤니티 커피파레트",
              "sitePostNo": "406-081",
              "siteWhlAddr": "인천광역시 연수구 송도동 24-6 송도트라이볼 C구역호",
              "rdnPostNo": 22004,
              "rdnWhlAddr": "인천광역시 연수구 인천타워대로 250, 송도트라이볼 C구역호 (송도동)",
              "siteArea": "8.00",
              "apvPermYmd": "2024-09-13",
              "apvCancelYmd": "",
              "dcbYmd": "2024-09-14",
              "clgStdt": "",
              "clgEnddt": "",
              "ropnYmd": "",
              "trdStateGbn": "03",
              "trdStateNm": "폐업",
              "dtlStateGbn": "02",
              "dtlStateNm": "폐업",
              "x": "167613.5634108      ",
              "y": "432489.511937042    ",
              "lastModTs": "2024-09-15 04:15:09",
              "uptaeNm": "기타",
              "siteTel": ""
            },
            {
              "rowNum": 8,
              "opnSfTeamCode": 4711000,
              "mgtNo": "4711000-101-2024-00107",
              "opnSvcId": "07_24_04_P",
              "updateGbn": "U",
              "updateDt": "2024-09-20 02:40:00",
              "opnSvcNm": "일반음식점",
              "bplcNm": "페리카나김제점",
              "sitePostNo": "",
              "siteWhlAddr": "전북특별자치도 김제시 교동 39 ",
              "rdnPostNo": 54387,
              "rdnWhlAddr": "전북특별자치도 김제시 향교길 89-3 (교동)",
              "siteArea": "3.30",
              "apvPermYmd": "2024-09-12",
              "apvCancelYmd": "",
              "dcbYmd": "2024-09-14",
              "clgStdt": "",
              "clgEnddt": "",
              "ropnYmd": "",
              "trdStateGbn": "03",
              "trdStateNm": "폐업",
              "dtlStateGbn": "02",
              "dtlStateNm": "폐업",
              "x": "189032.47882596     ",
              "y": "255610.967046079    ",
              "lastModTs": "2024-09-15 04:15:07",
              "uptaeNm": "호프/통닭",
              "siteTel": ""
            },
            {
              "rowNum": 9,
              "opnSfTeamCode": 3210000,
              "mgtNo": "3210000-104-2024-00330",
              "opnSvcId": "07_24_05_P",
              "updateGbn": "U",
              "updateDt": "2024-09-20 02:40:00",
              "opnSvcNm": "휴게음식점",
              "bplcNm": "리은푸드",
              "sitePostNo": "137-713",
              "siteWhlAddr": "서울특별시 서초구 반포동 19-3 신세계백화점 강남점 지하1층 식품행사장 ",
              "rdnPostNo": "06546",
              "rdnWhlAddr": "서울특별시 서초구 신반포로 176, 신세계백화점 강남점 지하1층 식품행사장 (반포동)",
              "siteArea": "",
              "apvPermYmd": "2024-09-12",
              "apvCancelYmd": "",
              "dcbYmd": "2024-09-15",
              "clgStdt": "",
              "clgEnddt": "",
              "ropnYmd": "",
              "trdStateGbn": "03",
              "trdStateNm": "폐업",
              "dtlStateGbn": "02",
              "dtlStateNm": "폐업",
              "x": "200250.447804795    ",
              "y": "444683.220506107    ",
              "lastModTs": "2024-09-16 04:15:10",
              "uptaeNm": "백화점",
              "siteTel": ""
            },
            {
              "rowNum": 10,
              "opnSfTeamCode": 4010000,
              "mgtNo": "4010000-101-2024-00586",
              "opnSvcId": "07_24_04_P",
              "updateGbn": "U",
              "updateDt": "2024-09-20 02:40:00",
              "opnSvcNm": "일반음식점",
              "bplcNm": "리치버번",
              "sitePostNo": "",
              "siteWhlAddr": "경기도 시흥시 배곧동 187 배곧생명공원 관리사무소 ",
              "rdnPostNo": 15010,
              "rdnWhlAddr": "경기도 시흥시 배곧2로 25, 배곧생명공원 (배곧동)",
              "siteArea": "3.30",
              "apvPermYmd": "2024-09-12",
              "apvCancelYmd": "",
              "dcbYmd": "2024-09-14",
              "clgStdt": "",
              "clgEnddt": "",
              "ropnYmd": "",
              "trdStateGbn": "03",
              "trdStateNm": "폐업",
              "dtlStateGbn": "02",
              "dtlStateNm": "폐업",
              "x": "175317.330082169    ",
              "y": "430013.968987125    ",
              "lastModTs": "2024-09-15 04:15:09",
              "uptaeNm": "기타",
              "siteTel": ""
            }
          ]
        }
      ]
    }
  }
}
  • 충분한 양의 자동화 테스트를 작성했는가?
    • 계단정복지도 서비스는 사이드 프로젝트로 진행되는 만큼 충분한 QA 없이 배포되는 경우가 많습니다. 따라서 자동화 테스트를 꼼꼼하게 작성하는 것이 서비스 품질을 유지하는 데 매우 중요합니다.

@jyoo0515 jyoo0515 requested a review from a team as a code owner September 20, 2024 09:27
Comment on lines +11 to +20
private val crsFactory = CRSFactory()
private val transformFactory = CoordinateTransformFactory()

private val sourceCrs = crsFactory.createFromParameters(sourceCrsType.wellKnownName, sourceCrsType.proj)
private val targetCrs = crsFactory.createFromParameters(targetCrsType.wellKnownName, targetCrsType.proj)
private val transformer = transformFactory.createTransform(sourceCrs, targetCrs)

fun toLocation(x: Double, y: Double): Location {
val sourceCoordinate = ProjCoordinate(x, y)
val transformedCoordinate = transformer.transform(sourceCoordinate, ProjCoordinate())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

흔히 알려진 JTS + MathTransform 으로 변환하면 너무 생뚱맞은 좌표가 나와서 proj4j 라는 라이브러리 사용

Copy link

🔥🔥🔥 Backend CI Failed. github action link 🔥🔥🔥

Copy link

🔥🔥🔥 Backend CI Failed. github action link 🔥🔥🔥

Copy link
Contributor

@Zeniuus Zeniuus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[CHECK] 달린 것만 한 번 확인해주세요! 감사합니당

Comment on lines +18 to +23
@PrePersist
fun prePersist() {
val now = SccClock.instant()
createdAt = now
updatedAt = now
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CreationTimestamp @UpdateTimestamp` 쓰면 어떤가요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그 어노테이션이 spring-data-jpa 라이브러리에 포함된 애들인데 stdlib 모듈에는 그게 없어서.. jakarta.persistence 에 있는 어노테이션을 사용했습니다
그냥 spring-data-jpa 를 dependency 로 가져올까요? ㅋㅋㅋ 저는 뭔가 이거 하나 때문에 그거까지 가져와야 하나 싶어서

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

엥 하이버네이트에 포함된 거 아닌가요?

Copy link
Member Author

@jyoo0515 jyoo0515 Oct 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 넹 hibernate 네요. 그 라이브러리를 stdlib 모듈이 들고 있지 않아서요
여기 저기서 들고 가서 사용하는 stdlib 모듈에 새로운 라이브러리 의존성을 최대한 피할 수 있으면 피하고 싶었던건데 CreationTimestamp 쓰는게 조금 더 깔끔할 것 같기도 하고요..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants