- Saved searches
- Use saved searches to filter your results more quickly
- aykononov/java-rest-api
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- Saved searches
- Use saved searches to filter your results more quickly
- java-rest-api
- Here are 17 public repositories matching this topic.
- mariazevedo88 / travels-java-api
- sammwyy / httplib
- VigneshDhakshnamoorthy / KMDV-Java-Framework
- UltiRequiem / java-se-simple-std-http-rest-api
- seij-net / seij-jakarta-ws-rs-hateoas
- yusufsefasezer / jax-rs-example
- dynamicjuhani / JestFramework
- ahacalabria / leitor-biometria-catraca-java
- spinsage / javalin-java-starter-restapi
- NihatQuliyev / upload-multipart-files
- giosil / wcron
- rafaalvesf / buscaCep-JAVA-SPRING
- LEMUBIT / Simple-Java-Spark-Voting-API
- raheemadamboev / demo-people-rest-api
- giosil / multi-rpc
- seycileli / spring-angular-rest-api-h2db-expensetracker
- GabrielFDuarte / Desafio-Bank-Api-MAIDA
- Improve this page
- Add this topic to your repo
- Saved searches
- Use saved searches to filter your results more quickly
- REST API
- Here are 6,692 public repositories matching this topic.
- OpenAPITools / openapi-generator
- swagger-api / swagger-core
- rest-assured / rest-assured
- discord-jda / JDA
- stylefeng / Guns
- apache / linkis
- exadel-inc / CompreFace
- springdoc / springdoc-openapi
- apilayer / restcountries
- confluentinc / kafka-rest
- confluentinc / schema-registry
- jonashackt / spring-boot-vuejs
- strapdata / elassandra
- Discord4J / Discord4J
- noear / solon
- awslabs / aws-serverless-java-container
- MyCollab / mycollab
- Endava / cats
- SoftInstigate / restheart
- DSpace / DSpace
- Related Topics
- Footer
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Spring Boot REST API на Java.
aykononov/java-rest-api
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Spring Boot REST API на Java.
Java SE + Spring Boot + Hibernate + Oracle Database
- Java SE 11 — Платформа Java, стандартная версия 11 Java SE 11 Archive Downloads;
- Spring Boot — инструмент фреймворка Spring для написания приложений с минимальной конфигурацией (имеет встроенный контейнер сервлетов Tomcat по умолчанию);
- Spring Web — включает в себя все настройки Spring MVC и позволяет писать REST API без дополнительных настроек;
- Spring Data JPA — позволяет работать с SQL с помощью Java Persistence API, используя Spring Data и Hibernate;
- Lombok — библиотека для сокращения написания стандартного кода на java (геттеры, сеттеры и т.д.);
- OpenCSV — парсер CSV-файлов;
- Oracle Data Base — используемая БД Oracle Database Express Edition (XE) download;
- Maven — фреймворк для автоматизации сборки проектов на основе описания их структуры в файлах на языке POM (англ. Project Object Model).
Оно умеет создавать (CREATE), читать (READ), изменять (UPDATE) и удалять (DELETE) информацию в БД.
Эндпоинты:
GET http://localhost:8081/listProducts получить все продукты GET http://localhost:8081/getProductById/id= найти продукт по идентификатору GET http://localhost:8081/getProductByName/name= найти продукт по имени POST http://localhost:8081/saveProducts добавляет несколько продуктов POST http://localhost:8081/addProduct добавляет один продукт DELETE http://localhost:8081/deleteProductById/id= удалить продукт по идентификатору DELETE http://localhost:8081/removeAll - удалить все продукты
Формат данных ответа в json.
Путь директории с файлами настраивается в конфигурационном файле приложения:
Загрузка файла стартует при появлении нового файла в указанной директории:
upload.file = LoadIntoDB.csv
product_id, product_name, price_id, price, price_date 1,product1,1,100.11,2020-11-30 2,product2,2,22.02,2020-11-30 3,product3,3,3.03,2020-11-30 4,product4,4,100.01,2020-11-30 1,product1,5,111.01,2020-12-01 2,product2,6,22.22,2020-12-01 3,product3,7,3.33,2020-12-01 4,product4,8,100.10,2020-12-01
В логфайле LoadIntoDB.log отмечается факт старта обработки файла и результат с количеством обработанных записей (товаров и цен).
1. Таблица товар. Хранит название товара. Колонки: id, name. 2. Таблица цена товара. Хранит цену на товар и дату с которой цена актуальная. По каждому товару может быть несколько цен с разными датами. Колонки: id, price, date, product_id.
Таблицы в БД создаются автоматически при старте приложения.
Скрипт для создания структуры БД .
/* таблица Продукты */ DROP TABLE products PURGE; / CREATE TABLE products ( id NUMBER(10,0) NOT NULL, name VARCHAR2(255), PRIMARY KEY (id) ); / /* таблица Цены */ DROP TABLE prices PURGE; / CREATE TABLE prices ( id NUMBER(10,0) NOT NULL, price NUMBER, pdate DATE, product_id NUMBER(10,0), PRIMARY KEY (id), CONSTRAINT FK_PRODUCT_ID FOREIGN KEY (PRODUCT_ID) REFERENCES PRODUCTS (ID) ); / /* проверка */ SELECT * FROM products pd JOIN prices pr ON pd.id = pr.product_id ORDER BY pr.id; /
Также прилагаю файл со скриптами для создания необходимых сущностей. ScriptDB.sql
Используйте shell, перейдите в корневой каталог проекта (где находится файл pom.xml) и введите команды:
mvn clean package cd target
В командной строке выполните команду:
java -jar demo-0.0.1-SNAPSHOT.jar
- GET http://localhost:8081/listProducts — получить все продукты
- GET http://localhost:8081/getProductById/id=4 — найти продукт по идентификатору
- GET http://localhost:8081/getProductByName/name=product4 — найти продукт по имени
- DELETE http://localhost:8081/deleteProductById/id=4 — удалить продукт по идентификатору
- POST http://localhost:8081/addProduct — добавляет один продукт
< "id": 4, "name": "product4", "prices": [ < "id": 4, "price": 111.11, "pdate": "2020-12-17", "productId": 4 > ] >
- DELETE http://localhost:8081/removeAll — удалить все продукты
- POST http://localhost:8081/saveProducts — добавляет несколько продуктов
[ < "id": 1, "name": "product1", "prices": [ < "id": 1, "price": 100.11, "pdate": "2020-11-30", "productId": 1 > ] >, < "id": 2, "name": "product2", "prices": [ < "id": 2, "price": 22.02, "pdate": "2020-11-30", "productId": 2 > ] >, < "id": 3, "name": "product3", "prices": [ < "id": 3, "price": 3.03, "pdate": "2020-11-30", "productId": 3 > ] > ]
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
java-rest-api
Here are 17 public repositories matching this topic.
mariazevedo88 / travels-java-api
An API for travel management. It is built with Java, Spring Boot, and Spring Framework. A toy-project to serve as a theoretical basis for the Medium series of articles I wrote about Java+Spring.
sammwyy / httplib
HTTP routing library for Java
VigneshDhakshnamoorthy / KMDV-Java-Framework
UltiRequiem / java-se-simple-std-http-rest-api
seij-net / seij-jakarta-ws-rs-hateoas
Jakarta RESTful Web Services (Jax-RS) utilities to manage HATEOAS
yusufsefasezer / jax-rs-example
A simple REST based application developed with JAVA, JAX-RS, Swagger and Angular.
dynamicjuhani / JestFramework
Framework simplifies the creation a Restful API.
ahacalabria / leitor-biometria-catraca-java
Exemplo básico em java (rest server on tomcat) para utilizar os dispositivos: leitor biometrico nitgen DX e catraca inner topdata
spinsage / javalin-java-starter-restapi
Boilerplate maven project for bootstrapping development of a Rest API application with Javalin using Java as the programming language
NihatQuliyev / upload-multipart-files
File upload, download, search and deletion.
giosil / wcron
A job scheduler configurable through RESTful web services.
rafaalvesf / buscaCep-JAVA-SPRING
o servico de busca de CEP, funciona realizando buscas relacionadas ao cep informado, retornando a informação de Logradouro, Bairro, cidade e estado, facilitando o preenchimento automático dessas informações em algum site, em que o endereço seja necessário informá-lo.
LEMUBIT / Simple-Java-Spark-Voting-API
Simple REST API created with Java Spark and Thymeleaf Template Engine
raheemadamboev / demo-people-rest-api
Java Spring Boot, REST API to list people details
giosil / multi-rpc
An easy to use library for xml-rpc, json-rpc and RESTful services implementation.
seycileli / spring-angular-rest-api-h2db-expensetracker
Simple Application with Spring backend and Angular frontend which is connected to an embedded H2 Database. Spring Data JPA to perform CRUD operations. This is OPEN SOURCE — Feel free to share or contribute as you wish.
GabrielFDuarte / Desafio-Bank-Api-MAIDA
API REST bancária para o desafio da Maida;health
Improve this page
Add a description, image, and links to the java-rest-api topic page so that developers can more easily learn about it.
Add this topic to your repo
To associate your repository with the java-rest-api topic, visit your repo’s landing page and select «manage topics.»
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
REST API
A representational state transfer (REST) API is a way to provide compatibility between computer systems on the Internet. The concept was first outlined in a dissertation by Roy Fielding in 2000.
Here are 6,692 public repositories matching this topic.
OpenAPITools / openapi-generator
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
swagger-api / swagger-core
Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
rest-assured / rest-assured
Java DSL for easy testing of REST services
discord-jda / JDA
Java wrapper for the popular chat & VOIP service: Discord https://discord.com
stylefeng / Guns
Guns基于SpringBoot 2,致力于做更简洁的后台管理系统,完美整合springmvc + shiro + mybatis-plus + beetl!Guns项目代码简洁,注释丰富,上手容易,同时Guns包含许多基础模块(用户管理,角色管理,部门管理,字典管理等10个模块),可以直接作为一个后台管理系统的脚手架!
apache / linkis
Apache Linkis builds a computation middleware layer to facilitate connection, governance and orchestration between the upper applications and the underlying data engines.
exadel-inc / CompreFace
Leading free and open-source face recognition system
springdoc / springdoc-openapi
Library for OpenAPI 3 with spring-boot
apilayer / restcountries
Get information about countries via a RESTful API
confluentinc / kafka-rest
Confluent REST Proxy for Kafka
confluentinc / schema-registry
Confluent Schema Registry for Kafka
jonashackt / spring-boot-vuejs
Example project showing how to build a Spring Boot App providing a GUI with Vue.js
strapdata / elassandra
Elassandra = Elasticsearch + Apache Cassandra
Discord4J / Discord4J
Discord4J is a fast, powerful, unopinionated, reactive library to enable quick and easy development of Discord bots for Java, Kotlin, and other JVM languages using the official Discord Bot API.
noear / solon
Java 新的生态:更快、更小、更简单!!!启动快 5 ~ 10 倍;qps 高 2~ 3 倍;运行时内存节省 1/3 ~ 1/2;打包可以缩到 1/2 ~ 1/10
awslabs / aws-serverless-java-container
A Java wrapper to run Spring, Jersey, Spark, and other apps inside AWS Lambda.
MyCollab / mycollab
An open source, free, high performance, stable and secure Java Application Business Platform of Project Management and Document
Endava / cats
CATS is a REST API Fuzzer and negative testing tool for OpenAPI endpoints. CATS automatically generates, runs and reports tests with minimum configuration and no coding effort. Tests are self-healing and do not require maintenance.
SoftInstigate / restheart
REST, GraphQL and WebSocket APIs for MongoDB.
DSpace / DSpace
(Official) The DSpace digital asset management system that powers your Institutional Repository
Related Topics
Footer
You can’t perform that action at this time.