{"id":19329511,"url":"https://github.com/which0113/api-sdk","last_synced_at":"2026-01-31T09:03:38.120Z","repository":{"id":215597100,"uuid":"739321787","full_name":"which0113/api-sdk","owner":"which0113","description":"为简化开发者调用 API 的 SDK 依赖","archived":false,"fork":false,"pushed_at":"2024-06-24T06:51:21.000Z","size":50,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-24T10:50:40.039Z","etag":null,"topics":["sdk"],"latest_commit_sha":null,"homepage":"https://www.freefish.love","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/which0113.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":"2024-01-05T09:37:18.000Z","updated_at":"2024-06-24T06:51:25.000Z","dependencies_parsed_at":"2024-01-08T14:05:10.165Z","dependency_job_id":"58a505bb-0f3e-4846-af12-b104315ed515","html_url":"https://github.com/which0113/api-sdk","commit_stats":null,"previous_names":["which0113/api-sdk"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/which0113/api-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/which0113%2Fapi-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/which0113%2Fapi-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/which0113%2Fapi-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/which0113%2Fapi-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/which0113","download_url":"https://codeload.github.com/which0113/api-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/which0113%2Fapi-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28936100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T08:53:31.997Z","status":"ssl_error","status_checked_at":"2026-01-31T08:51:38.521Z","response_time":128,"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":["sdk"],"created_at":"2024-11-10T02:28:40.899Z","updated_at":"2026-01-31T09:03:38.100Z","avatar_url":"https://github.com/which0113.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=https://img.freefish.love/logo.png width=188/\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003e咸鱼-API SDK\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\u003cstrong\u003e咸鱼-API 接口开放平台开发者工具包\u003c/strong\u003e\u003c/p\u003e\n\u003cdiv align=\"center\"\u003e\n\u003ca target=\"_blank\" href=\"https://github.com/which0113/api-backend\"\u003e\n    \u003cimg alt=\"\" src=\"https://github.com/which0113/api-backend/badge/star.svg?theme=gvp\"/\u003e\n\u003c/a\u003e\n    \u003cimg alt=\"Maven\" src=\"https://raster.shields.io/badge/Maven-3.8.1-red.svg\"/\u003e\n\u003ca target=\"_blank\" href=\"https://www.oracle.com/technetwork/java/javase/downloads/index.html\"\u003e\n        \u003cimg alt=\"\" src=\"https://img.shields.io/badge/JDK-1.8+-green.svg\"/\u003e\n\u003c/a\u003e\n    \u003cimg alt=\"SpringBoot\" src=\"https://raster.shields.io/badge/SpringBoot-2.7+-green.svg\"/\u003e\n\u003c/div\u003e\n\n### 目录结构 📝\n\n```text\napisdk\n    ├─client\n    ├─config\n    ├─exception\n    ├─model\n    │  ├─enums\n    │  ├─params\n    │  ├─request\n    │  └─response\n    ├─service\n    │  └─impl\n    └─utils\n```\n\n### 导航 🧭\n\n- **[咸鱼-API 平台 🔗](https://www.freefish.love/)**\n\n### 快速开始 🚀\n\n**要开始使用 API-SDK，您需要按照以下简单进行操作:**\n\n#### 1. 引入依赖坐标\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.which\u003c/groupId\u003e\n  \u003cartifactId\u003eapi-sdk\u003c/artifactId\u003e\n  \u003cversion\u003e0.0.9\u003c/version\u003e\n\u003c/dependency\u003e   \n```\n\n#### 2. 前往[咸鱼-API 平台](https://www.freefish.love/) 获取开发者密钥对\n\n#### 3. 初始化客户端ApiClient对象\n\n- 方法 1 ：主动实例化客户端\n\n  ```java\n  String accessKey = \"你的 accessKey\";\n  String secretKey = \"你的 secretKey\";\n  ApiClient client = new ApiClient(accessKey, secretKey);\n  ```\n\n- 方法 2 ：通过配置文件注入对象\n  - yml\n\n    ```yml\n    # API 配置\n    com:\n      which:\n        client:\n          access-key: 你的 accessKey\n          secret-key: 你的 secretKey\n          # 本地网关地址，可修改为自己的网关，用于本地测试，线上网关地址等，不配置默认平台的网关\n         # host: http://localhost:8090/api\n    ```\n\n  - properties\n\n    ```properties\n    com.which.client.access-key=你的 accessKey\n    com.which.client.secret-key=你的 secretKey\n    ```\n\n#### 4. 使用API服务\n\n```java\n@Resource\nprivate ApiService apiService;\n```\n\n#### 5. 发起请求示例\n\n示例：随机毒鸡汤\n\n- 示例一 ：**通过配置文件 推荐👍**\n\n```java\ntry {\n    PoisonousChickenSoupResponse poisonousChickenSoup = apiService.getPoisonousChickenSoup();\n    System.out.println(\"poisonousChickenSoup = \" + poisonousChickenSoup);\n} catch (ApiException e) {\n    log.error(e.getMessage());\n}\n```\n\n- 示例二 ：主动注入\n\n```java\ntry {\n    ApiClient apiClient = new ApiClient(\"你的 accessKey\", \"你的 secretKey\");\n    PoisonousChickenSoupResponse poisonousChickenSoup = apiService.getPoisonousChickenSoup(apiClient);\n    System.out.println(\"poisonousChickenSoup = \" + poisonousChickenSoup);\n} catch (ApiException e) {\n    log.error(e.getMessage());\n}\n```\n\n响应：\n\n```json\n{\n  \"text\": \"脸大的人一般脾气都超好，因为脸大，翻脸真的很辛苦。\"\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhich0113%2Fapi-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhich0113%2Fapi-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhich0113%2Fapi-sdk/lists"}