{"id":19993278,"url":"https://github.com/developframework/chinese-administrative-region","last_synced_at":"2026-01-12T11:28:03.979Z","repository":{"id":94595238,"uuid":"134647563","full_name":"developframework/chinese-administrative-region","owner":"developframework","description":"中国行政区数据提供器","archived":false,"fork":false,"pushed_at":"2018-05-24T13:31:03.000Z","size":107,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-05T18:48:31.677Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developframework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-24T02:00:27.000Z","updated_at":"2024-10-19T13:27:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"d7f2604f-3c4b-4313-80e6-8f018898577f","html_url":"https://github.com/developframework/chinese-administrative-region","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/developframework/chinese-administrative-region","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developframework%2Fchinese-administrative-region","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developframework%2Fchinese-administrative-region/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developframework%2Fchinese-administrative-region/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developframework%2Fchinese-administrative-region/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developframework","download_url":"https://codeload.github.com/developframework/chinese-administrative-region/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developframework%2Fchinese-administrative-region/sbom","scorecard":{"id":337177,"data":{"date":"2025-08-11","repo":{"name":"github.com/developframework/chinese-administrative-region","commit":"de657d3eae258856864854307badee601366d5a8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/3 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-vmq6-5m68-f53m","Warn: Project is vulnerable to: GHSA-668q-qrv7-99fm","Warn: Project is vulnerable to: GHSA-6v67-2wr5-gvf4","Warn: Project is vulnerable to: GHSA-pr98-23f8-jwxv"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T04:58:46.945Z","repository_id":94595238,"created_at":"2025-08-18T04:58:46.945Z","updated_at":"2025-08-18T04:58:46.945Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:58:46.209Z","status":"ssl_error","status_checked_at":"2026-01-12T10:58:42.742Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T04:52:33.903Z","updated_at":"2026-01-12T11:28:03.974Z","avatar_url":"https://github.com/developframework.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"## 中国行政区数据\n\n数据来源： GB/T2260\n\n### 数据提供器\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.developframework\u003c/groupId\u003e\n    \u003cartifactId\u003echinese-administrative-region-data\u003c/artifactId\u003e\n    \u003cversion\u003e${project.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n```java\nChinaRegionProvider chinaRegionProvider = new ChinaRegionProvider();\n\n// 获得中国地区信息\nChina china = chinaRegionProvider.getChina();\n// 获得所有省份地区信息\nList\u003cProvince\u003e allProvinces = china.getAllProvinces();\n\n// 获得所有市级地区信息\nList\u003cCity\u003e allCities = china.getAllCities();\n\n// 获得所有县级地区信息\nList\u003cCounty\u003e allCounties = china.getAllCounties();\n\n// 获得某个省级地区信息\nOptional\u003cProvince\u003e provinceOptional = china.getProvinceByName(\"浙江省\");\nif (provinceOptional.isPresent()) {\n    Province zheJiangProvince = provinceOptional.get();\n\n    // 获得地区代码\n    String code = zheJiangProvince.getCode();\n\n    // 获得地区名称\n    String name = zheJiangProvince.getName();\n\n    // 获得某个市级地区信息\n    Optional\u003cCity\u003e cityOptional = zheJiangProvince.getCityByName(\"杭州市\");\n\n    // 可以一直往下取县级城市\n}\n```\n\n### 数据输出工具\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.developframework\u003c/groupId\u003e\n    \u003cartifactId\u003echinese-administrative-region-output\u003c/artifactId\u003e\n    \u003cversion\u003e${project.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n#### 控制台打印\n\n```java\n// 地区\nRegion region = provinceOptional.get();\n\n// 是否需要打印地区代码\nboolean needCode = true;\nConsoleOutput.print(region, needCode);\n\n// 可以使用lambda缩写，默认为打印地区代码\nprovinceOptional.ifPresent(ConsoleOutput::print);\n```\n\n结果：\n\n```\n浙江省 (330000)\n\t 杭州市 (330100)\n\t\t 市辖区 (330101)\n\t\t 上城区 (330102)\n\t\t 下城区 (330103)\n\t\t 江干区 (330104)\n\t\t 拱墅区 (330105)\n\t\t 西湖区 (330106)\n\t\t 滨江区 (330108)\n\t\t 萧山区 (330109)\n\t\t 余杭区 (330110)\n\t\t 富阳区 (330111)\n\t\t 临安区 (330112)\n\t\t 桐庐县 (330122)\n\t\t 淳安县 (330127)\n\t\t 建德市 (330182)\n（忽略余下内容）\n```\n\n#### 生成SQL INSERT语句\n\n```java\nOptional\u003cProvince\u003e provinceOptional = china.getProvinceByName(\"浙江省\");\nfinal SQLInsertOutput.SQLInsertOption option = new SQLInsertOutput.SQLInsertOption();\noption.setDatabase(\"test\");\noption.setTable(\"chinese_region\");\noption.setNameField(\"region_name\");\noption.setCodeField(\"region_code\");\nprovinceOptional\n        .flatMap(province -\u003e Optional.of(SQLInsertOutput.insertSql(province, option)))\n        .ifPresent(list -\u003e list.forEach(System.out::println));\n```\n\n结果：\n\n```sql\nINSERT INTO `test`.`chinese_region`(`region_name`, `region_code`) VALUES('浙江省', '330000');\nINSERT INTO `test`.`chinese_region`(`region_name`, `region_code`) VALUES('杭州市', '330100');\nINSERT INTO `test`.`chinese_region`(`region_name`, `region_code`) VALUES('市辖区', '330101');\nINSERT INTO `test`.`chinese_region`(`region_name`, `region_code`) VALUES('上城区', '330102');\nINSERT INTO `test`.`chinese_region`(`region_name`, `region_code`) VALUES('下城区', '330103');\nINSERT INTO `test`.`chinese_region`(`region_name`, `region_code`) VALUES('江干区', '330104');\nINSERT INTO `test`.`chinese_region`(`region_name`, `region_code`) VALUES('拱墅区', '330105');\nINSERT INTO `test`.`chinese_region`(`region_name`, `region_code`) VALUES('西湖区', '330106');\nINSERT INTO `test`.`chinese_region`(`region_name`, `region_code`) VALUES('滨江区', '330108');\nINSERT INTO `test`.`chinese_region`(`region_name`, `region_code`) VALUES('萧山区', '330109');\nINSERT INTO `test`.`chinese_region`(`region_name`, `region_code`) VALUES('余杭区', '330110');\nINSERT INTO `test`.`chinese_region`(`region_name`, `region_code`) VALUES('富阳区', '330111');\nINSERT INTO `test`.`chinese_region`(`region_name`, `region_code`) VALUES('临安区', '330112');\nINSERT INTO `test`.`chinese_region`(`region_name`, `region_code`) VALUES('桐庐县', '330122');\nINSERT INTO `test`.`chinese_region`(`region_name`, `region_code`) VALUES('淳安县', '330127');\nINSERT INTO `test`.`chinese_region`(`region_name`, `region_code`) VALUES('建德市', '330182');\n\n-- 忽略余下内容\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopframework%2Fchinese-administrative-region","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelopframework%2Fchinese-administrative-region","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopframework%2Fchinese-administrative-region/lists"}