{"id":20469933,"url":"https://github.com/budali/weixin_cloud","last_synced_at":"2026-03-10T04:05:20.757Z","repository":{"id":113834227,"uuid":"528658045","full_name":"budaLi/weixin_cloud","owner":"budaLi","description":null,"archived":false,"fork":false,"pushed_at":"2022-08-25T01:55:09.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-05T13:25:48.267Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/budaLi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-08-25T01:54:55.000Z","updated_at":"2022-08-25T01:55:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0cf19cf-ae78-492a-832f-4ad131d7c24a","html_url":"https://github.com/budaLi/weixin_cloud","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/budaLi/weixin_cloud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budaLi%2Fweixin_cloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budaLi%2Fweixin_cloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budaLi%2Fweixin_cloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budaLi%2Fweixin_cloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/budaLi","download_url":"https://codeload.github.com/budaLi/weixin_cloud/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budaLi%2Fweixin_cloud/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30324185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T01:36:58.598Z","status":"online","status_checked_at":"2026-03-10T02:00:06.579Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-15T14:10:57.677Z","updated_at":"2026-03-10T04:05:20.738Z","avatar_url":"https://github.com/budaLi.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wxcloudrun-flask\n[![GitHub license](https://img.shields.io/github/license/WeixinCloud/wxcloudrun-express)](https://github.com/WeixinCloud/wxcloudrun-express)\n![GitHub package.json dependency version (prod)](https://img.shields.io/badge/python-3.7.3-green)\n\n微信云托管 python Flask 框架模版，实现简单的计数器读写接口，使用云托管 MySQL 读写、记录计数值。\n\n![](https://qcloudimg.tencent-cloud.cn/raw/be22992d297d1b9a1a5365e606276781.png)\n\n\n## 快速开始\n前往 [微信云托管快速开始页面](https://developers.weixin.qq.com/miniprogram/dev/wxcloudrun/src/basic/guide.html)，选择相应语言的模板，根据引导完成部署。\n\n## 本地调试\n下载代码在本地调试，请参考[微信云托管本地调试指南](https://developers.weixin.qq.com/miniprogram/dev/wxcloudrun/src/guide/debug/)\n\n## 实时开发\n代码变动时，不需要重新构建和启动容器，即可查看变动后的效果。请参考[微信云托管实时开发指南](https://developers.weixin.qq.com/miniprogram/dev/wxcloudrun/src/guide/debug/dev.html)\n\n## Dockerfile最佳实践\n请参考[如何提高项目构建效率](https://developers.weixin.qq.com/miniprogram/dev/wxcloudrun/src/scene/build/speed.html)\n\n## 目录结构说明\n\n~~~\n.\n├── Dockerfile dockerfile       dockerfile\n├── README.md README.md         README.md文件\n├── container.config.json       模板部署「服务设置」初始化配置（二开请忽略）\n├── requirements.txt            依赖包文件\n├── config.py                   项目的总配置文件  里面包含数据库 web应用 日志等各种配置\n├── run.py                      flask项目管理文件 与项目进行交互的命令行工具集的入口\n└── wxcloudrun                  app目录\n    ├── __init__.py             python项目必带  模块化思想\n    ├── dao.py                  数据库访问模块\n    ├── model.py                数据库对应的模型\n    ├── response.py             响应结构构造\n    ├── templates               模版目录,包含主页index.html文件\n    └── views.py                执行响应的代码所在模块  代码逻辑处理主要地点  项目大部分代码在此编写\n~~~\n\n\n\n## 服务 API 文档\n\n### `GET /api/count`\n\n获取当前计数\n\n#### 请求参数\n\n无\n\n#### 响应结果\n\n- `code`：错误码\n- `data`：当前计数值\n\n##### 响应结果示例\n\n```json\n{\n  \"code\": 0,\n  \"data\": 42\n}\n```\n\n#### 调用示例\n\n```\ncurl https://\u003c云托管服务域名\u003e/api/count\n```\n\n\n\n### `POST /api/count`\n\n更新计数，自增或者清零\n\n#### 请求参数\n\n- `action`：`string` 类型，枚举值\n  - 等于 `\"inc\"` 时，表示计数加一\n  - 等于 `\"clear\"` 时，表示计数重置（清零）\n\n##### 请求参数示例\n\n```\n{\n  \"action\": \"inc\"\n}\n```\n\n#### 响应结果\n\n- `code`：错误码\n- `data`：当前计数值\n\n##### 响应结果示例\n\n```json\n{\n  \"code\": 0,\n  \"data\": 42\n}\n```\n\n#### 调用示例\n\n```\ncurl -X POST -H 'content-type: application/json' -d '{\"action\": \"inc\"}' https://\u003c云托管服务域名\u003e/api/count\n```\n\n## 使用注意\n如果不是通过微信云托管控制台部署模板代码，而是自行复制/下载模板代码后，手动新建一个服务并部署，需要在「服务设置」中补全以下环境变量，才可正常使用，否则会引发无法连接数据库，进而导致部署失败。\n- MYSQL_ADDRESS\n- MYSQL_PASSWORD\n- MYSQL_USERNAME\n以上三个变量的值请按实际情况填写。如果使用云托管内MySQL，可以在控制台MySQL页面获取相关信息。\n\n\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbudali%2Fweixin_cloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbudali%2Fweixin_cloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbudali%2Fweixin_cloud/lists"}