README
This is todo list project for practicing how to write go.
There are four APIs, and db is file now.
curl http://localhost:7070/todo-list/get?username=user1
curl -X POST http://localhost:7070/todo-list/create?username=user1&task=hi
curl -X POST http://localhost:7070/todo-list/delete?username=user1&task=hi
curl http://localhost:7070/users
TODO
- Change file schema, add create time for task.
- Add API to edit task name and remove task.
- Change response data structure.
- Add unit test.
- Add API to query user.
- Add API to create new user.
- Connect google calendar or google tasks.
Make sure the code and folder structure follow up the following advises.
- https://github.com/llitfkitfk/go-best-practice
- Ptt-official-app/Ptt-backend#16
- https://ronmi.github.io/post/go/effectivego/
- https://openhome.cc/Gossip/Go/index.html
- https://golang.org/doc/effective_go#control-structures
- Go Example Chinese: https://gobyexample-cn.github.io/
- Go Example Englisg: https://gobyexample.com/
- Go FAQ: https://golang.org/doc/faq
Data Structure
This is a very simple structure.
{
"user1": {
"sequence": 1,
"todo": [
{
"id": 1,
"name": "eat1",
"create_at": 1618491050221
}
],
"create_at": 1618491050221
}
}