# todo **Repository Path**: Ike-li/todo ## Basic Information - **Project Name**: todo - **Description**: No description available - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-11-08 - **Last Updated**: 2021-05-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #### Todo功能 ##### 1、创建新的todo ---cmd--- ```shell C:\Users\Administrator>curl -v -X POST http://127.0.0.1:5000/todos/1/user01/event01 * Trying 127.0.0.1... * TCP_NODELAY set * Connected to 127.0.0.1 (127.0.0.1) port 5000 (#0) > POST /todos/1/user01/event01 HTTP/1.1 > Host: 127.0.0.1:5000 > User-Agent: curl/7.55.1 > Accept: */* > * HTTP 1.0, assume close after body < HTTP/1.0 201 CREATED < Content-Type: application/json < Content-Length: 9 < Server: Werkzeug/1.0.1 Python/3.6.8 < Date: Tue, 27 Oct 2020 04:18:57 GMT < {"ID":1} * Closing connection 0 ``` ##### 2、删除某条todo ---cmd--- ```shell C:\Users\Administrator>curl -v -X DELETE http://127.0.0.1:5000/todos/1 * Trying 127.0.0.1... * TCP_NODELAY set * Connected to 127.0.0.1 (127.0.0.1) port 5000 (#0) > DELETE /todos/1 HTTP/1.1 > Host: 127.0.0.1:5000 > User-Agent: curl/7.55.1 > Accept: */* > * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Content-Type: application/json < Content-Length: 16 < Server: Werkzeug/1.0.1 Python/3.6.8 < Date: Tue, 27 Oct 2020 04:22:33 GMT < {"result":true} * Closing connection 0 ``` ##### 3、更新某条todo ---cmd--- ```shell C:\Users\Administrator>curl -v -X PUT http://127.0.0.1:5000/todos/event02-1/2 * Trying 127.0.0.1... * TCP_NODELAY set * Connected to 127.0.0.1 (127.0.0.1) port 5000 (#0) > PUT /todos/event02-1/2 HTTP/1.1 > Host: 127.0.0.1:5000 > User-Agent: curl/7.55.1 > Accept: */* > * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Content-Type: application/json < Content-Length: 16 < Server: Werkzeug/1.0.1 Python/3.6.8 < Date: Tue, 27 Oct 2020 04:23:53 GMT < {"result":true} * Closing connection 0 ``` ##### 4、列出所有的todo ---cmd--- ```shell C:\Users\Administrator>curl -v -X GET http://127.0.0.1:5000/todos Note: Unnecessary use of -X or --request, GET is already inferred. * Trying 127.0.0.1... * TCP_NODELAY set * Connected to 127.0.0.1 (127.0.0.1) port 5000 (#0) > GET /todos HTTP/1.1 > Host: 127.0.0.1:5000 > User-Agent: curl/7.55.1 > Accept: */* > * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Content-Type: text/html; charset=utf-8 < Content-Length: 263 < Server: Werkzeug/1.0.1 Python/3.6.8 < Date: Tue, 27 Oct 2020 04:21:19 GMT < [ { "event": "event01", "id": 1, "username": "user01" }, { "event": "event02", "id": 2, "username": "user02" }, { "event": "event03", "id": 3, "username": "user03" } ]* Closing connection 0 ``` #### 要求: **1、Flask作为开发框架** **2、todo数据存储在Cassandra里** **3、遵循RESTfulAPI开发规范** **4、每个api都有对应的测试**,上面有测试结果 **5、使用Docker和docker-compose对应用进行打包和部署**