Dependencies:
- Spring Boot DevTools
- Lombok
- Spring Data JPA
- Spring Data JDBC
- PostgreSQL Driver
spring.datasource.url=${your_db_url}
spring.datasource.username=${your_username}
spring.datasource.password=${your_password}
Spring Boot Projesi olan "company-employee" Spring Boot Maven ile geliştirilmiştir. Şirketinize eleman ekleyip, silip, güncelleyebilirsiniz. Şirketinizdeki elemanları, şu ana kadar tüm kaydolmuş elemanları, tüm şirketleride çekebilirsiniz.
COMPANY EMPLOYEE API'S
Swagger Url: http://127.0.0.1:8080/swagger-ui.html/
POST api/v1/company/create
{ "companyName": "enoca", "employees": null, "id": 5 }
POST api/v1/employees/create
{ "id": 2, "fullName": "Kadir Taban", "email": "[email protected]", "age": 21, "company": { "companyName": "enoca", "id": 5 } }
GET api/v1/company/receiveAll
[ { "companyName": "enoca", "employees": [ { "id": 3, "fullName": "Kadir Taban", "email": "[email protected]", "age": 0 } ], "id": 5 }, { "companyName": "companytest", "employees": [ { "id": 4, "fullName": "test", "email": "[email protected]", "age": 0 } ], "id": 6 } ]
GET api/v1/company/receive/employee/5
// query with company_id
[ { "id": 3, "fullName": "Kadir Taban", "email": "[email protected]", "age": 21, "company": { "companyName": "enoca", "id": 5 } }, { "id": 6, "fullName": "test", "email": "[email protected]", "age": 20, "company": { "companyName": "enoca", "id": 5 } } ]
GET api/v1/employees/receive
[ { "id": 3, "fullName": "Kadir Taban", "email": "[email protected]", "age": 21, "company": { "companyName": "enoca", "id": 5 } }, { "id": 4, "fullName": "test", "email": "[email protected]", "age": 20, "company": { "companyName": "companytest", "id": 6 } }, { "id": 6, "fullName": "test", "email": "[email protected]", "age": 20, "company": { "companyName": "enoca", "id": 5 } } ]
GET api/v1/employees/receive/6
{ "id": 6, "fullName": "test", "email": "[email protected]", "age": 20, "company": { "companyName": "enoca", "id": 5 } }
PUT api/v1/company/update/6
{ "companyName": "updateName", "employees": [ { "id": 4, "fullName": "test", "email": "[email protected]", "age": 0 } ], "id": 6 }
PUT api/v1/employees/update/3
{ "id": 3, "fullName": "update", "email": "update", "age": 0, "company": { "companyName": "enoca", "id": 5 } }
DELETE api/v1/company/delete/7
deneme has deleted succesfully
DELETE api/v1/employees/delete/7
deneme left her/him company.