Skip to content

errorsolver/Todo-Golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang Todo API

This is Golang API to create todo list for user. This app use Gin and Gorm framework.

Detail API

Base URL = 8.219.130.79 Server = AlibabaCloud Database Service = Neon

Table Of Contents

  1. 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
  2. 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

User Endpoint

Sign Up

See Details
  • URL: /user/register

  • Method: POST

  • Description: Create a new user.

  • Request Body:

    {
        "name": "Your name",
        "pass": "Your password"
    }

Login

See Details
  • URL: /login

  • Method: GET

  • Description: logged in to api.

  • Request Body:

    {
        "name": "Your name",
        "pass": "Your password"
    }

Logout

See Details
  • URL: /logout
  • Method: GET
  • Description: logged out user from api.
  • Request Body: -

Get All Users

See Details
  • URL: /user/all
  • Method: GET
  • Description: Get all users data from database.
  • Request Body: -

Get User By ID

See Details
  • URL: /user/:id
  • Method: GET
  • Description: Get user data by id.
  • Request Body: -

Update User

See Details
  • URL: /user

  • Method: PUT

  • Description: Update the currently logged in user.

  • Request Body:

    {
        "name": "Your name",
        "pass": "Your password"
    }

Delete User

See Details
  • URL: /user
  • Method: DELETE
  • Description: Delete currently logged in user.
  • Request Body: -

Todo Endpoint

Create Todo

See Details
  • URL: /todo

  • Method: POST

  • Description: Create a new todo to currently logged user.

  • Request Body:

    {
        "todo": "Your todo",
    }

Get All Todos

See Details
  • URL: /todo/all
  • Method: GET
  • Description: Get all todos from database.
  • Request Body: -

Get All Todos By User ID

See Details
  • URL: /todo
  • Method: GET
  • Description: Get all todos by by user id.
  • Request Body: -

Update Todo

See Details
  • URL: /todo

  • Method: PUT

  • Description: Edit your todo parameter, like check and uncheck.

  • Request Body:

    {
        "todo": "Your todo",
        "isDone": true or false
    }

Delete Todo

See Details
  • URL: /todo
  • Method: DELETE
  • Description: Delete currently user's todo using todo ID.
  • Request Body: -

About

Todo API (Golang)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages