Add postman collections
parent
3e42d2e5aa
commit
518641f610
|
@ -23,7 +23,6 @@ repositories {
|
|||
|
||||
|
||||
dependencies {
|
||||
compile("users")
|
||||
compile("org.springframework.boot:spring-boot-starter-data-rest")
|
||||
compile('org.springframework.boot:spring-boot-starter-data-jpa')
|
||||
runtime('com.h2database:h2')
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
server.port = 9000
|
||||
|
||||
spring.datasource.url = jdbc:mysql://localhost:3306/events
|
||||
spring.datasource.username = root
|
||||
spring.datasource.password = 1DvaTri!
|
||||
|
||||
# Keep the connection alive if idle for a long time (needed in production)
|
||||
spring.datasource.testWhileIdle = true
|
||||
spring.datasource.validationQuery = SELECT 1
|
||||
|
||||
# Show or not log for each sql query
|
||||
spring.jpa.show-sql = true
|
||||
|
||||
# Hibernate ddl auto (create, create-drop, update)
|
||||
spring.jpa.hibernate.ddl-auto = update
|
||||
|
||||
# Naming strategy
|
||||
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
|
||||
|
||||
# Use spring.jpa.properties.* for Hibernate native properties (the prefix is
|
||||
# stripped before adding them to the entity manager)
|
||||
|
||||
# The SQL dialect makes Hibernate generate better SQL for the chosen database
|
||||
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
|
|
@ -19,7 +19,7 @@ public class Media {
|
|||
|
||||
private String contentUrl;
|
||||
private Date creationDate;
|
||||
private String createdById;
|
||||
private long createdById;
|
||||
|
||||
public Media() {
|
||||
}
|
||||
|
@ -48,11 +48,11 @@ public class Media {
|
|||
this.creationDate = creationDate;
|
||||
}
|
||||
|
||||
public String getCreatedById() {
|
||||
public long getCreatedById() {
|
||||
return createdById;
|
||||
}
|
||||
|
||||
public void setCreatedById(String createdById) {
|
||||
public void setCreatedById(long createdById) {
|
||||
this.createdById = createdById;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
server.port = 9000
|
||||
|
||||
spring.datasource.url = jdbc:mysql://localhost:3306/events
|
||||
spring.datasource.username = root
|
||||
spring.datasource.password = 1DvaTri!
|
||||
|
||||
# Keep the connection alive if idle for a long time (needed in production)
|
||||
spring.datasource.testWhileIdle = true
|
||||
spring.datasource.validationQuery = SELECT 1
|
||||
|
||||
# Show or not log for each sql query
|
||||
spring.jpa.show-sql = true
|
||||
|
||||
# Hibernate ddl auto (create, create-drop, update)
|
||||
spring.jpa.hibernate.ddl-auto = update
|
||||
|
||||
# Naming strategy
|
||||
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
|
||||
|
||||
# Use spring.jpa.properties.* for Hibernate native properties (the prefix is
|
||||
# stripped before adding them to the entity manager)
|
||||
|
||||
# The SQL dialect makes Hibernate generate better SQL for the chosen database
|
||||
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
|
||||
#
|
||||
#spring.datasource.url = jdbc:mysql://localhost:3306/events
|
||||
#spring.datasource.username = root
|
||||
#spring.datasource.password = 1DvaTri!
|
||||
#
|
||||
## Keep the connection alive if idle for a long time (needed in production)
|
||||
#spring.datasource.testWhileIdle = true
|
||||
#spring.datasource.validationQuery = SELECT 1
|
||||
#
|
||||
## Show or not log for each sql query
|
||||
#spring.jpa.show-sql = true
|
||||
#
|
||||
## Hibernate ddl auto (create, create-drop, update)
|
||||
#spring.jpa.hibernate.ddl-auto = update
|
||||
#
|
||||
## Naming strategy
|
||||
#spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
|
||||
#
|
||||
## Use spring.jpa.properties.* for Hibernate native properties (the prefix is
|
||||
## stripped before adding them to the entity manager)
|
||||
#
|
||||
## The SQL dialect makes Hibernate generate better SQL for the chosen database
|
||||
#spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"id": "f9241756-1b82-e149-d0d5-9269bf40e003",
|
||||
"name": "Local",
|
||||
"values": [
|
||||
{
|
||||
"key": "url",
|
||||
"type": "text",
|
||||
"value": "localhost",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"key": "usersPort",
|
||||
"type": "text",
|
||||
"value": "8090",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"key": "eventsPort",
|
||||
"type": "text",
|
||||
"value": "9000",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"key": "teamsPort",
|
||||
"type": "text",
|
||||
"value": "9010",
|
||||
"enabled": true
|
||||
}
|
||||
],
|
||||
"timestamp": 1490312377323,
|
||||
"synced": false,
|
||||
"syncedFilename": "",
|
||||
"team": null,
|
||||
"isDeleted": false
|
||||
}
|
|
@ -0,0 +1,479 @@
|
|||
{
|
||||
"variables": [],
|
||||
"info": {
|
||||
"name": "Steleks Backend",
|
||||
"_postman_id": "ef580742-4589-8237-e6de-a870eb8253e9",
|
||||
"description": "",
|
||||
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
|
||||
},
|
||||
"item": [
|
||||
{
|
||||
"name": "Courses",
|
||||
"description": "",
|
||||
"item": [
|
||||
{
|
||||
"name": "Get All Courses",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{usersPort}}/courses",
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": []
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Add Course",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{usersPort}}/courses",
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"courseName\":\"TRECA\"\n}"
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Events",
|
||||
"description": "",
|
||||
"item": [
|
||||
{
|
||||
"name": "Get All",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{eventsPort}}",
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": []
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Add Event",
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": "\nvar jsonData = JSON.parse(responseBody);\nvar arr = jsonData._links.self.href.split(\"/\");\npostman.setEnvironmentVariable(\"eventId\", arr[4]);"
|
||||
}
|
||||
}
|
||||
],
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{eventsPort}}/events",
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"title\":\"Testni\",\n \"shortText\":\"Txt\",\n \"longText\":\"Textcina\"\n}"
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Get Events",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{eventsPort}}/events",
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"title\":\"Testni\",\n \"shortText\":\"Txt\",\n \"longText\":\"Textcina\"\n}"
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Get Event",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{eventsPort}}/events/{{eventId}}",
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"title\":\"Testni\",\n \"shortText\":\"Txt\",\n \"longText\":\"Textcina\"\n}"
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Get Event Medias",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{eventsPort}}/events/{{eventId}}/mediaSet",
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"title\":\"Testni\",\n \"shortText\":\"Txt\",\n \"longText\":\"Textcina\"\n}"
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Add Media To Event",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{eventsPort}}/events/{{eventId}}/mediaSet",
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "text/uri-list",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "http://{{url}}:{{eventsPort}}/medias/1"
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Media",
|
||||
"description": "",
|
||||
"item": [
|
||||
{
|
||||
"name": "Add Media",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{eventsPort}}/medias",
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"contentUrl\":\"http://www.google.com\"\n}"
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Get All Medias",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{eventsPort}}/medias",
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": []
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Membership Types",
|
||||
"description": "",
|
||||
"item": [
|
||||
{
|
||||
"name": "Get All Membership Types",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{usersPort}}/membershipTypes",
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": []
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Add Membership Type",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{usersPort}}/membershipTypes",
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"membershipTypeName\":\"TRECA\"\n}"
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Roles",
|
||||
"description": "",
|
||||
"item": [
|
||||
{
|
||||
"name": "Get All User Roles",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{usersPort}}/userRoles",
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": []
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Add User Role",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{usersPort}}/userRoles",
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"roleName\":\"TRECA\"\n}"
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Users",
|
||||
"description": "",
|
||||
"item": [
|
||||
{
|
||||
"name": "Get Users",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{usersPort}}/users",
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": []
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Add User",
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": "\nvar jsonData = JSON.parse(responseBody);\nvar arr = jsonData._links.self.href.split(\"/\");\npostman.setEnvironmentVariable(\"userId\", arr[4]);"
|
||||
}
|
||||
}
|
||||
],
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{usersPort}}/users",
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"firstName\":\"Testni\",\n \"lastName\":\"User\",\n \"username\":\"Juzernejm\"\n}"
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Add Roles To User",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{usersPort}}/users/{{userId}}/userRoles",
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "text/uri-list",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "http://{{url}}:{{usersPort}}/userRoles/1"
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Get User",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{usersPort}}/users/{{userId}}",
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": []
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Get User Roles",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{usersPort}}/users/{{userId}}/userRoles",
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": []
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Add Courses To User",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{usersPort}}/users/{{userId}}/courses",
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "text/uri-list",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "http://{{url}}:{{usersPort}}/courses/1"
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Get User Courses",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{usersPort}}/users/{{userId}}/courses",
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": []
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Add Membership Types To User",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{usersPort}}/users/{{userId}}/membershipTypes",
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "text/uri-list",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "http://{{url}}:{{usersPort}}/membershipTypes/1"
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Get User Membership Types",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{usersPort}}/users/{{userId}}/membershipTypes",
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": []
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "Get All",
|
||||
"request": {
|
||||
"url": "http://{{url}}:{{usersPort}}",
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": []
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue