Skip to content

Smart-Pot/Post-Service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Post struct

    {
        "id": string,
        "userId": string,
        "plant": string,
        "envData":
        {
            "humidity": string,
            "temperature": string,
            "light": string,
        },
        "images": string[],
        "date": string
    }

Get single post

  • method: GET
  • path: /post/{postId}
  • returns:
    {
        "Posts": []post, //use first element of array
        "Success": integer, // 1 for success, 0 for failure
        "Message": string
    }

Get user's all posts

  • method: GET
  • path: /post/user/{userID}
  • returns:
    {
        "Posts": []post,
        "Success": integer, // 1 for success, 0 for failure
        "Message": string
    }

Create

  • path: /post/new

  • method: POST

  • parameters:

    • Header:

      Name Description Type
      x-auth-token authentication token of the user String
        {
            "userId": string,
            "plant": string,
            "envData":
            {
                "humidity": string,
                "temperature": string,
                "light": string,
            },
            "images": string[],
        }
  • returns:

    {
        "Posts": []post, // Will return NULL
        "Success": integer, // 1 for success, 0 for failure
        "Message": string
    }

Delete

  • path: /post/{postId}

  • method: DELETE

  • params:

    • Header:

      Name Description Type
      x-auth-token authentication token of the user String
  • returns:

    {
        "Posts": []post, // Will return NULL
        "Success": integer, // 1 for success, 0 for failure
        "Message": string
    }

Vote

  • path: /post/vote

  • method: POST

  • params:

    • Header:

      Name Description Type
      x-auth-token authentication token of the user String
  • returns:

    {
        "Posts": []post,
        "success": integer,
        "message" : string
    }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published