This is Golang API to create todo list for user. This app use Gin and Gorm framework.
Base URL = 8.219.130.79 Server = AlibabaCloud Database Service = Neon
- User Endpoint
1.1 Sign Up
1.2 Login
1.3 Get All Todos
1.4 Get User By ID
1.5 Update User
1.6 Delete User - Todo Endpoint
2.1 Create Todo
2.2 Get All Todos By User ID
2.3 Get All Todos By User ID
2.4 Update Todo
2.5 Delete Todo
See Details
-
URL:
/user/register
-
Method:
POST
-
Description: Create a new user.
-
Request Body:
{ "name": "Your name", "pass": "Your password" }
See Details
-
URL:
/login
-
Method:
GET
-
Description: logged in to api.
-
Request Body:
{ "name": "Your name", "pass": "Your password" }
See Details
- URL:
/logout
- Method:
GET
- Description: logged out user from api.
- Request Body: -
See Details
- URL:
/user/all
- Method:
GET
- Description: Get all users data from database.
- Request Body: -
See Details
- URL:
/user/:id
- Method:
GET
- Description: Get user data by id.
- Request Body: -
See Details
-
URL:
/user
-
Method:
PUT
-
Description: Update the currently logged in user.
-
Request Body:
{ "name": "Your name", "pass": "Your password" }
See Details
- URL:
/user
- Method:
DELETE
- Description: Delete currently logged in user.
- Request Body: -
See Details
-
URL:
/todo
-
Method:
POST
-
Description: Create a new todo to currently logged user.
-
Request Body:
{ "todo": "Your todo", }
See Details
- URL:
/todo/all
- Method:
GET
- Description: Get all todos from database.
- Request Body: -
See Details
- URL:
/todo
- Method:
GET
- Description: Get all todos by by user id.
- Request Body: -
See Details
-
URL:
/todo
-
Method:
PUT
-
Description: Edit your todo parameter, like check and uncheck.
-
Request Body:
{ "todo": "Your todo", "isDone": true or false }
See Details
- URL:
/todo
- Method:
DELETE
- Description: Delete currently user's todo using todo ID.
- Request Body: -