diff --git a/.gitignore b/.gitignore index e04e1d5ab8ed3005fa7023955a4c244d2fcbdd32..c2065bc26202b2d072aca3efc3d1c2efad3afcbf 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,6 @@ build/ !**/src/main/**/build/ !**/src/test/**/build/ -amplicode.xml - ### STS ### .apt_generated .classpath diff --git a/api/api.yaml b/api/api.yaml deleted file mode 100644 index 330a0ff1c177abe2b2d7766a73943111aa82ecfe..0000000000000000000000000000000000000000 --- a/api/api.yaml +++ /dev/null @@ -1,637 +0,0 @@ -openapi: 3.0.0 -info: - title: Проект "Hive" - version: "0.1" -servers: - - url: http://localhost:8080 - description: Локальный сервер -paths: - - /api/users/signUp: - post: - summary: Зарегистрироваться - tags: - - Пользователи - operationId: signUp - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/User" - responses: - "200": - description: Успешный ответ СЃ идентификатором пользователя - content: - application/json: - schema: - type: object - properties: - token: - type: string - example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.a4AaLWElNeHKGRFoe--t9ovMvdu5KLyxLBoAAdCtQUU - "400": - description: Ошибки - content: - application/json: - schema: - type: object - properties: - error: - type: string - example: "BAD_REQUEST" - - - /api/users/signIn: - post: - summary: Авторизоваться - tags: - - Пользователи - operationId: signIn - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - login: - type: string - example: Bogdan - password: - type: string - example: "somePassword123" - responses: - "200": - description: Успешный ответ СЃ идентификатором пользователя - content: - application/json: - schema: - type: object - properties: - token: - type: string - example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.a4AaLWElNeHKGRFoe--t9ovMvdu5KLyxLBoAAdCtQUU - "400": - description: Ошибки - content: - application/json: - schema: - type: object - properties: - error: - type: string - example: "BAD_REQUEST" - - /api/users/logout: - post: - summary: Выйти РёР· аккаунта - tags: - - Пользователи - operationId: logout - requestBody: - required: true - content: - application/json: - schema: - type: object - # properties: - # login: - # type: string - # example: Bogdan - # password: - # type: string - # example: "somePassword123" - responses: - "200": - description: Успешный ответ СЃ идентификатором пользователя - content: - application/json: - schema: - type: object - properties: - token: - type: string - example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.a4AaLWElNeHKGRFoe--t9ovMvdu5KLyxLBoAAdCtQUU - "400": - description: Ошибки - content: - application/json: - schema: - type: object - properties: - error: - type: string - example: "BAD_REQUEST" - - - /users/{userId}: - get: - summary: Получить пользователя РїРѕ идентификатору - tags: - - Пользователи - operationId: getUserById - parameters: - - name: userId - in: path - required: true - description: Рдентификатор пользователя - schema: - type: string - example: 111 - - name: Authorization - in: header - required: true - description: Рдентификатор сессии - schema: - type: string - example: 2527d786-d0d7-47d9-872b-af295552103b - responses: - "200": - description: Успешный ответ СЃ пользователем - content: - application/json: - schema: - $ref: "#/components/schemas/UserInfo" - "default": - description: Ошибки - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - patch: - summary: Обновить пользователя - tags: - - Пользователи - operationId: updateUser - parameters: - - name: userId - in: path - required: true - description: Рдентификатор пользователя - schema: - type: string - example: 111 - - name: Authorization - in: header - required: true - description: Рдентификатор сессии - schema: - type: string - example: 2527d786-d0d7-47d9-872b-af295552103b - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - lastName: - type: string - example: Богданов - description: Только Р±СѓРєРІС‹ СЂСѓСЃСЃРєРѕРіРѕ алфавита. Первая Р±СѓРєРІР° - заглавная. РќРµ более 50 символов. - firstName: - type: string - example: Богдан - description: Только Р±СѓРєРІС‹ СЂСѓСЃСЃРєРѕРіРѕ алфавита. Первая Р±СѓРєРІР° - заглавная. РќРµ более 50 символов. - middleName: - type: string - example: Богданович - description: Только Р±СѓРєРІС‹ СЂСѓСЃСЃРєРѕРіРѕ алфавита. Первая Р±СѓРєРІР° - заглавная. РќРµ более 50 символов. - birthdate: - type: string - format: date - example: "2000-01-01" - description: Дата рождения РІ формате ISO 8601 (YYYY-MM-DD) - responses: - "200": - description: Успешный ответ - "default": - description: Ошибки - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - - /wallets/{userId}: - get: - summary: Получить информацию Рѕ кошельке - tags: - - Кошелёк - operationId: getWalletByUserId - parameters: - - name: userId - in: path - required: true - description: Рдентификатор пользователя - schema: - type: string - example: 123 - - name: Authorization - in: header - required: true - description: Рдентификатор сессии - schema: - type: string - example: 2527d786-d0d7-47d9-872b-af295552103b - responses: - "200": - description: Успешный ответ СЃ кошельком - content: - application/json: - schema: - $ref: "#/components/schemas/Wallet" - "default": - description: Ошибки - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /wallets/{userId}/HESOYAM: - post: - summary: HESOYAM (25% шанс РЅР° деньги) - tags: - - Кошелёк - operationId: HESOYAM - parameters: - - name: userId - in: path - required: true - description: Рдентификатор пользователя - schema: - type: string - example: 123 - - name: Authorization - in: header - required: true - description: Рдентификатор сессии - schema: - type: string - example: 2527d786-d0d7-47d9-872b-af295552103b - responses: - "200": - description: Успешный ответ - "default": - description: Ошибки - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /transfers: - post: - summary: Создать Рё выполнить перевод - tags: - - Денежные переводы - operationId: createTransfer - parameters: - - name: Authorization - in: header - required: true - description: Рдентификатор сессии - schema: - type: string - example: 2527d786-d0d7-47d9-872b-af295552103b - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - walletId: - type: integer - example: 123 - description: Номер кошелька - amount: - type: integer - example: 1000 - description: РЎСѓРјРјР° денежных единиц операции - responses: - "200": - description: Успешный ответ СЃ информацией Рѕ переводе - content: - application/json: - schema: - $ref: "#/components/schemas/Transfer" - "default": - description: Ошибки - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - get: - summary: Получить информацию Рѕ всех переводах РїРѕ фильтрам - tags: - - Денежные переводы - operationId: getTransfers - parameters: - - name: Authorization - in: header - required: true - description: Рдентификатор сессии - schema: - type: string - example: 2527d786-d0d7-47d9-872b-af295552103b - - name: transferType - in: query - required: true - description: РўРёРї перевода (входящие/исходящие) - schema: - type: string - enum: - - in - - out - - name: active - in: query - required: true - description: Статус перевода (оплачен/РЅРµ оплачен) - schema: - type: string - enum: - - paid - - unpaid - - name: userId - in: query - required: true - description: Рдентификатор пользователя-получателя - schema: - type: string - example: 123 - responses: - "200": - description: Успешный ответ СЃ информацией Рѕ переводе - content: - application/json: - schema: - $ref: "#/components/schemas/Transfers" - "default": - description: Ошибки - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /transfers/{transferId}: - get: - summary: Получить информацию Рѕ переводе - tags: - - Денежные переводы - operationId: getTransferById - parameters: - - name: transferId - in: path - required: true - description: Рдентификатор транзакции - schema: - type: string - example: 12345 - - name: Authorization - in: header - required: true - description: Рдентификатор сессии - schema: - type: string - example: 2527d786-d0d7-47d9-872b-af295552103b - responses: - "200": - description: Успешный ответ СЃ информацией Рѕ переводе - content: - application/json: - schema: - $ref: "#/components/schemas/Transfer" - "default": - description: Ошибки - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /sessions: - post: - summary: Создать сессию - tags: - - Сессии - operationId: createSession - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - userId: - type: string - example: 123 - description: идентификатор пользователя - password: - type: string - example: pwd - description: пароль - responses: - "200": - description: Успешный ответ СЃ сессией - content: - application/json: - schema: - $ref: "#/components/schemas/Session" - "default": - description: Ошибки - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - - /sessions/{sessionId}: - get: - summary: Получить информацию Рѕ сессии - tags: - - Сессии - operationId: getSessionById - parameters: - - name: sessionId - in: path - required: true - description: Рдентификатор сессии - schema: - type: string - example: 2527d786-d0d7-47d9-872b-af295552103b - responses: - "200": - description: Успешный ответ СЃ сессией - content: - application/json: - schema: - $ref: "#/components/schemas/Session" - "default": - description: Ошибки - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - delete: - summary: Выйти РёР· сессии - tags: - - Сессии - operationId: closeSession - parameters: - - name: sessionId - in: path - required: true - description: Рдентификатор сессии - schema: - type: string - example: 2527d786-d0d7-47d9-872b-af295552103b - responses: - "200": - description: Успешный ответ - "default": - description: Ошибки - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - -components: - schemas: - User: - type: object - required: - - username - - password - - email - properties: - username: - type: string - example: Bogdan - description: Любые Р±СѓРєРІС‹. РќРµ более 20 символов. - email: - type: string - format: email - example: potato@mail.ru - description: Стандартный адрес электронной почты. Рљ электронной почте может быть привязан только РѕРґРёРЅ пользователь. - password: - type: string - format: password - example: pass123 - description: РѕС‚ 8 РґРѕ 64 символов. Только латинские символы, цифры, знаки только !?. Обязательно наличие РјРёРЅРёРјСѓРј 1 Р±СѓРєРІС‹ верхнего Рё нижнего регистра, цифры Рё знака. - - UserInfo: - type: object - required: - - lastName - - firstName - - phone - - email - - birthdate - properties: - lastName: - type: string - example: Богданов - description: Только Р±СѓРєРІС‹ СЂСѓСЃСЃРєРѕРіРѕ алфавита. Первая Р±СѓРєРІР° - заглавная. РќРµ более 50 символов. - firstName: - type: string - example: Богдан - description: Только Р±СѓРєРІС‹ СЂСѓСЃСЃРєРѕРіРѕ алфавита. Первая Р±СѓРєРІР° - заглавная. РќРµ более 50 символов. - middleName: - type: string - example: Богданович - description: Только Р±СѓРєРІС‹ СЂСѓСЃСЃРєРѕРіРѕ алфавита. Первая Р±СѓРєРІР° - заглавная. РќРµ более 50 символов. - phone: - type: string - example: 78005553535 - description: 11 цифр, начинается СЃ '7' Рљ номеру телефона может быть привязан только РѕРґРёРЅ пользователь. - email: - type: string - format: email - example: potato@mail.ru - description: Стандартный адрес электронной почты. Рљ электронной почте может быть привязан только РѕРґРёРЅ пользователь. - birthdate: - type: string - format: date - example: "2000-01-01" - description: Дата рождения РІ формате ISO 8601 (YYYY-MM-DD) - - Wallet: - type: object - required: - - number - - balance - properties: - number: - type: integer - example: 123 - description: Номер кошелька - balance: - type: integer - example: 123 - description: Баланс кошелька - - Transfer: - type: object - required: - - creationTime - - amount - - transferType - properties: - transferId: - type: string - example: 12345 - description: Рдентификатор перевода - creationTime: - type: string - format: date-time - example: "2023-07-02T14:48:00Z" - description: Дата Рё время операции РІ ISO 8601 формате (ГГГГ-РњРњ-ДДTР§Р§:РњРњ:РЎРЎZ) - amount: - type: integer - example: 1000 - description: РЎСѓРјРјР° денежных единиц операции - transferType: - type: string - enum: - - transfer - description: РўРёРї операции - status: - type: string - enum: - - paid - - unpaid - description: Статус операции - - Transfers: - type: array - items: - $ref: "#/components/schemas/Transfer" - - Session: - type: object - required: - - expirationTime - - sessionId - - active - properties: - expirationTime: - type: string - format: date-time - example: "2023-07-02T14:48:00Z" - description: Дата Рё время РІ формате ISO 8601 (ГГГГ-РњРњ-ДДTР§Р§:РњРњ:РЎРЎZ) - sessionId: - type: string - example: 2527d786-d0d7-47d9-872b-af295552103b - description: идентификатор сессии - active: - type: boolean - description: Статус сессии - - Error: - type: object - required: - - code - - message - properties: - code: - type: integer - example: 1 - description: Внутренний РєРѕРґ ошибки - message: - type: string - example: "Internal error" - description: Пояснение Рє ошибке \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index b272e7a66381010f66f93b1b0937de9d513773dd..1f3d41479468814c7bbc847911b4aa42cc450516 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,15 +1,15 @@ services: -# app: -# image: 'docker-spring-boot-postgres:latest' -# build: -# context: . -# container_name: app -# depends_on: -# - db -# ports: -# - '8080:8080' -# environment: -# - 'DB_HOST=db' + app: + image: 'docker-spring-boot-postgres:latest' + build: + context: . + container_name: app + depends_on: + - db + ports: + - '8080:8080' + environment: + - 'DB_HOST=db' db: image: 'postgres:latest' environment: @@ -17,4 +17,4 @@ services: - 'POSTGRES_PASSWORD=secret' - 'POSTGRES_USER=myuser' ports: - - '5433:5432' \ No newline at end of file + - '5432:5432' \ No newline at end of file diff --git a/src/main/java/com/example/geekzone/api/controller/Controller.java b/src/main/java/com/example/geekzone/api/controller/Controller.java deleted file mode 100644 index 2a04275f97ab9f2e7a554aa3fd0e63d7e9d56de9..0000000000000000000000000000000000000000 --- a/src/main/java/com/example/geekzone/api/controller/Controller.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.example.geekzone.api.controller; - -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class Controller { -} diff --git a/src/main/java/com/example/geekzone/api/dto/DtoSimple.java b/src/main/java/com/example/geekzone/api/dto/DtoSimple.java deleted file mode 100644 index 0e819542334879f8a904aef6afaea14bf91f6560..0000000000000000000000000000000000000000 --- a/src/main/java/com/example/geekzone/api/dto/DtoSimple.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.example.geekzone.api.dto; - -public class DtoSimple { -} diff --git a/src/main/java/com/example/geekzone/api/mapper/Mapper.java b/src/main/java/com/example/geekzone/api/mapper/Mapper.java deleted file mode 100644 index 900efb9b82b012ca2701db21bab2d43a9dee5bd5..0000000000000000000000000000000000000000 --- a/src/main/java/com/example/geekzone/api/mapper/Mapper.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.example.geekzone.api.mapper; - -public class Mapper { -} diff --git a/src/main/java/com/example/geekzone/core/model/Model.java b/src/main/java/com/example/geekzone/core/model/Model.java deleted file mode 100644 index ef7b9450755cd7fe04dbae5d51729caddda38d04..0000000000000000000000000000000000000000 --- a/src/main/java/com/example/geekzone/core/model/Model.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.example.geekzone.core.model; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import lombok.*; - -@Entity -@Getter -@Setter -@NoArgsConstructor -@AllArgsConstructor -@Builder -public class Model { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - private String name; - private String lastName; - -} diff --git a/src/main/java/com/example/geekzone/core/repository/Repository.java b/src/main/java/com/example/geekzone/core/repository/Repository.java deleted file mode 100644 index 8a8edf595bfa7d96af90e80c0d2bc81f6a58093c..0000000000000000000000000000000000000000 --- a/src/main/java/com/example/geekzone/core/repository/Repository.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.example.geekzone.core.repository; - -public class Repository { -} diff --git a/src/main/java/com/example/geekzone/core/service/Service.java b/src/main/java/com/example/geekzone/core/service/Service.java deleted file mode 100644 index d4bc7b93d599c2062a69735c24b20bc99e9044cb..0000000000000000000000000000000000000000 --- a/src/main/java/com/example/geekzone/core/service/Service.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.example.geekzone.core.service; - -public class Service { -} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 41e1d4230216be2445589dc636ff2650dc7aa149..f7d721b29d49e26c9804def1f0ae3640a363b3ca 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -5,7 +5,7 @@ spring.flyway.baseline-on-migrate=true spring.flyway.out-of-order=true -spring.datasource.url=jdbc:postgresql://localhost:5433/mydatabase +spring.datasource.url=jdbc:postgresql://localhost:5432/mydatabase spring.datasource.username=myuser spring.datasource.password=secret spring.datasource.driver-class-name=org.postgresql.Driver diff --git a/src/main/resources/db/migration/V1__init.sql b/src/main/resources/db/migration/V001__init.sql similarity index 100% rename from src/main/resources/db/migration/V1__init.sql rename to src/main/resources/db/migration/V001__init.sql