https://github.com/ashrawan/spring-boot-discussionforum-restapi
https://github.com/ashrawan/spring-boot-discussionforum-restapi
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ashrawan/spring-boot-discussionforum-restapi
- Owner: ashrawan
- Created: 2018-03-25T18:50:41.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-03T12:21:36.000Z (over 7 years ago)
- Last Synced: 2025-01-05T09:44:20.994Z (10 months ago)
- Language: Java
- Size: 64.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Discussion Forum Rest API
###### Spring -> Web, JPA, MySQLTo get the code:
-------------------
Clone the repository:$ git clone https://github.com/ashrawan/Spring-Boot-DiscussionForum-RestAPI.git
To run the application:
-------------------
From the command line with Maven: (Make sure Maven is downloaded and added in Environment variable)$ mvn spring-boot:run
Or Using Spring Tool SuiteRun As: Spring Boot App
Web Application is deployed at: http://localhost:8080
To Check the application:
-------------------
Create Database: **"forum_db"**Edit **"src/main/resources/application.properties"** as per need
check: http://localhost:8080/api/user/all
Output: []
//Everything is fine
@RestController:
-------------------
###### @RequestMapping("/api")
* User
* ForumPost
* CommentPostman (example):
-------------------
http://localhost:8080/api/user/new //Request method = POSTpostman -> Body -> raw -> JSON(application/json)
```
{
"username": "superman",
"firstName": "sup",
"lastName": "man",
"email": null,
"password": null,
"userType": null,
"status": "Active"
}
```-------------------
http://localhost:8080/api/forumPost/new //Request method = POSTpostman -> Body -> raw -> JSON(application/json)
```
{
"title": "This post is about the superman returns",
"user" : { "id" : "2"},
"category": "General",
"description": "ohh ohh ohh blah blah blah",
"status": "Active"
}
```
-------------------
http://localhost:8080/api/comment/new //Request method = POSTpostman -> Body -> raw -> JSON(application/json)
```
{
"forum":{"id": "7"},
"message": "I like this post",
"user": {"id":"2"}
}
```