alfianyusufabdullah / discussion-server-spring-boot

Work in Progress :construction:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

API Discussions Spec

Added new discussion

  • Method: POST
  • Endpoint: api/discussion
  • Header:
    • Content-type: application/json
    • Accept: application/json
  • Request:
{
   "creator_username": "String",
   "title": "String",
   "question": "String"
}
  • Response:
{
    "status": "Int",
    "message": "String",
    "data": {
         "id_discussion": "String",
         "creator_username": "String",
         "created_at": "Date",
         "title": "String",
         "question": "String"
    }
}

Getting all discussion

  • Method: GET
  • Endpoint: api/discussion
  • Header:
    • Accept: application/json
  • Response Success:
{
    "status": "Int",
    "message": "String",
    "data": {
         "total": "Int",
         "page": "Int",
         "discussions": [
                  {
                      "id_discussion": "String",
                      "creator_username": "String",
                      "created_at": "Date",
                      "title": "String",
                      "question": "String",
                      "reply": "Int"
                  },
                  {
                      "id_discussion": "String",
                      "creator_username": "String",
                      "created_at": "Date",
                      "title": "String",
                      "question": "String",
                      "reply": "Int"                          
                  }
              ]
    }
}
  • Response Empty:
{
    "status": "Int",
    "message": "String"
}

Reply Discussion

  • Method: POST
  • Endpoint: api/comment
  • Header:
    • Content-type: application/json
    • Accept: application/json
  • Request:
{
   "id_parent": "String",
   "creator_username": "String",
   "comment": "String"
}
  • Response:
{
    "status": "Int",
    "message": "String",
    "data": {
         "id_parent": "String",
         "id_comment": "String",
         "creator_username": "String",
         "created_at": "Date",
         "title": "String",
         "comment": "String"
    }
}

About

Work in Progress :construction:


Languages

Language:Kotlin 100.0%