# wxcloudrun-dotnet **Repository Path**: manlone2020/wxcloudrun-dotnet ## Basic Information - **Project Name**: wxcloudrun-dotnet - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2022-02-08 - **Last Updated**: 2023-06-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # wxcloudrun-dotnet [![GitHub license](https://img.shields.io/github/license/WeixinCloud/wxcloudrun-dotnet)](https://github.com/WeixinCloud/wxcloudrun-dotnet) 微信云托管 .NET Core 框架模版,实现简单的计数器读写接口,使用云托管 MySQL 读写、记录计数值。 ![](https://qcloudimg.tencent-cloud.cn/raw/be22992d297d1b9a1a5365e606276781.png) ## 快速开始 前往 [微信云托管快速开始页面](),选择相应语言的模板,根据引导完成部署。 ## 项目结构说明 ``` . ├── Dockerfile ├── README.md ├── container.config.json ├── aspnetapp ``` - `aspnetapp`:项目入口,实现主要的读写 API - `container.config.json`:云托管部署配置文件 - `Dockerfile`:容器配置文件 ## 服务 API 文档 ### `GET /api/count` 获取当前计数 #### 请求参数 无 #### 响应结果 - `code`:错误码 - `data`:当前计数值 ##### 响应结果示例 ```json { "code": 0, "data": 42 } ``` #### 调用示例 ``` curl https://<云托管服务域名>/api/count ``` ### `POST /api/count` 更新计数,自增或者清零 #### 请求参数 - `action`:`string` 类型,枚举值 - 等于 `"inc"` 时,表示计数加一 - 等于 `"clear"` 时,表示计数重置(清零) ##### 请求参数示例 ``` { "action": "inc" } ``` #### 响应结果 - `code`:错误码 - `data`:当前计数值 ##### 响应结果示例 ```json { "code": 0, "data": 42 } ``` #### 调用示例 ``` curl -X POST -H 'content-type: application/json' -d '{"action": "inc"}' https://<云托管服务域名>/api/count ``` ## License [MIT](./LICENSE)