Skip to content

Commit 95d92be

Browse files
committed
GH-61: website переименован в api
1 parent 99b64b5 commit 95d92be

37 files changed

Lines changed: 89 additions & 90 deletions

.github/workflows/maven.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ jobs:
2828
- name: Maven Package Telegrambot
2929
run: mvn -f telegrambot/pom.xml clean package -Dmaven.test.skip=true
3030

31-
- name: Maven Package Website
32-
run: mvn -f website/pom.xml clean package -Dmaven.test.skip=true
31+
- name: Maven Package api
32+
run: mvn -f api/pom.xml clean package -Dmaven.test.skip=true
3333

34-
- name: FTP Deploy Website
34+
- name: FTP Deploy api
3535
uses: SamKirkland/[email protected]
3636
with:
3737
server: 62.109.17.193
3838
username: teamtwo
3939
password: teamtwo
40-
local-dir: website/
41-
server-dir: website/
40+
local-dir: api/
41+
server-dir: api/
4242
exclude: |
4343
**/maven-archiver/**
4444
**/classes/**
@@ -69,13 +69,13 @@ jobs:
6969
HELP.md
7070
pom.xml
7171
72-
- name: SSH Build Docker Website
72+
- name: SSH Build Docker API
7373
uses: appleboy/ssh-action@master
7474
with:
7575
host: 62.109.17.193
7676
username: teamtwo
7777
password: teamtwo
78-
script: docker build website -t teamtwo/website:latest
78+
script: docker build api -t teamtwo/api:latest
7979

8080
- name: SSH Build Docker Telegrambot
8181
uses: appleboy/ssh-action@master
@@ -85,13 +85,13 @@ jobs:
8585
password: teamtwo
8686
script: docker build telegrambot -t teamtwo/telegrambot:latest
8787

88-
- name: SSH Run Docker Website
88+
- name: SSH Run Docker API
8989
uses: appleboy/ssh-action@master
9090
with:
9191
host: 62.109.17.193
9292
username: teamtwo
9393
password: teamtwo
94-
script: docker run -d -p 8080:8080 --rm --name teamtwo_website teamtwo/website
94+
script: docker run -d -p 8080:8080 --rm --name teamtwo_api teamtwo/api
9595

9696
- name: SSH Run Docker Telegrambot
9797
uses: appleboy/ssh-action@master
File renamed without changes.

website/api.rest renamed to api/api.rest

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
GET localhost:8081/marketplace/api/product-offers?text=ар&limit=3&offset=2&order=store.rate
1+
GET localhost:8080/marketplace/api/product-offers?text=ар&limit=3&offset=2&order=store.rate
22

33
###
4-
GET localhost:8081/marketplace/api/product-offers?filter=ар&order=aSc_product.rate
4+
GET localhost:8080/marketplace/api/product-offers?filter=ар&order=aSc_product.rate
55

66
#добавить обработку параметра order выдавая отсортированный список
77
#GET /product-offers?text={text}&order={order)

api/dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM openjdk:17.0.2-slim-buster
2+
COPY target/api-0.0.1-SNAPSHOT.jar api-0.0.1-SNAPSHOT.jar
3+
ENTRYPOINT ["java","-jar","api-0.0.1-SNAPSHOT.jar"]
4+
EXPOSE 8080

website/pom.xml renamed to api/pom.xml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111
<groupId>ru.teamtwo</groupId>
12-
<artifactId>website</artifactId>
12+
<artifactId>api</artifactId>
1313
<version>0.0.1-SNAPSHOT</version>
14-
<name>website</name>
15-
<description>website</description>
14+
<name>api</name>
15+
<description>api</description>
1616
<properties>
1717
<java.version>17</java.version>
1818
</properties>
@@ -55,7 +55,10 @@
5555
<groupId>junit</groupId>
5656
<artifactId>junit</artifactId>
5757
</dependency>
58-
58+
<dependency>
59+
<groupId>com.fasterxml.jackson.core</groupId>
60+
<artifactId>jackson-core</artifactId>
61+
</dependency>
5962
</dependencies>
6063

6164
<build>

website/src/main/java/ru/teamtwo/website/WebsiteApplication.java renamed to api/src/main/java/ru/teamtwo/api/ApiApplication.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ru.teamtwo.website;
1+
package ru.teamtwo.api;
22

33
import org.springframework.boot.SpringApplication;
44
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -8,10 +8,10 @@
88
@SpringBootApplication
99
@ComponentScan(basePackages = { "ru.teamtwo.*" })
1010
@EntityScan("ru.teamtwo.*")
11-
public class WebsiteApplication {
11+
public class ApiApplication {
1212

1313
public static void main(String[] args) {
14-
SpringApplication.run(WebsiteApplication.class, args);
14+
SpringApplication.run(ApiApplication.class, args);
1515
}
1616

1717
}

website/src/main/java/ru/teamtwo/website/LoggingAspect.java renamed to api/src/main/java/ru/teamtwo/api/LoggingAspect.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ru.teamtwo.website;
1+
package ru.teamtwo.api;
22

33
import lombok.extern.slf4j.Slf4j;
44
import org.aspectj.lang.JoinPoint;
@@ -16,7 +16,7 @@
1616
@Component
1717
@Slf4j
1818
public class LoggingAspect {
19-
@Before("within(ru.teamtwo.website..*)")
19+
@Before("within(ru.teamtwo.api..*)")
2020
public void logBefore(JoinPoint joinPoint) {
2121
Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
2222
Parameter[] parameters = method.getParameters();
@@ -39,7 +39,7 @@ public void logBefore(JoinPoint joinPoint) {
3939
log.trace(stringBuilder.toString());
4040
}
4141

42-
@AfterReturning(pointcut="within(ru.teamtwo.website..*)", returning="returnValue")
42+
@AfterReturning(pointcut="within(ru.teamtwo.api..*)", returning="returnValue")
4343
public void logAfter(JoinPoint joinPoint, Object returnValue) {
4444
Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
4545
Class<?> declaringClass = method.getDeclaringClass();

website/src/main/java/ru/teamtwo/website/controller/MarketplaceController.java renamed to api/src/main/java/ru/teamtwo/api/controller/MarketplaceController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ru.teamtwo.website.controller;
1+
package ru.teamtwo.api.controller;
22

33
import lombok.extern.slf4j.Slf4j;
44
import org.springframework.beans.factory.annotation.Autowired;
@@ -9,7 +9,7 @@
99
import org.springframework.web.bind.annotation.RequestParam;
1010
import org.springframework.web.bind.annotation.RestController;
1111
import ru.teamtwo.core.dtos.ProductDTO;
12-
import ru.teamtwo.website.repository.ProductOfferRepository;
12+
import ru.teamtwo.api.repository.ProductOfferRepository;
1313

1414
import java.util.List;
1515
import java.util.Locale;

website/src/main/java/ru/teamtwo/website/controller/ProductOfferController.java renamed to api/src/main/java/ru/teamtwo/api/controller/ProductOfferController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ru.teamtwo.website.controller;
1+
package ru.teamtwo.api.controller;
22

33
import lombok.extern.slf4j.Slf4j;
44
import org.springframework.beans.factory.annotation.Autowired;
@@ -7,8 +7,8 @@
77
import org.springframework.web.bind.annotation.RequestMapping;
88
import org.springframework.web.bind.annotation.RestController;
99
import ru.teamtwo.core.dtos.ProductDTO;
10-
import ru.teamtwo.website.exception.ItemNotFoundException;
11-
import ru.teamtwo.website.repository.ProductOfferRepository;
10+
import ru.teamtwo.api.exception.ItemNotFoundException;
11+
import ru.teamtwo.api.repository.ProductOfferRepository;
1212

1313
@Slf4j
1414
@RestController

website/src/main/java/ru/teamtwo/website/controller/customer/CartItemController.java renamed to api/src/main/java/ru/teamtwo/api/controller/customer/CartItemController.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ru.teamtwo.website.controller.customer;
1+
package ru.teamtwo.api.controller.customer;
22

33
import lombok.extern.slf4j.Slf4j;
44
import org.springframework.beans.factory.annotation.Autowired;
@@ -13,9 +13,9 @@
1313
import org.springframework.web.bind.annotation.RestController;
1414
import ru.teamtwo.core.dtos.customer.CartItemArrayDto;
1515
import ru.teamtwo.core.dtos.customer.CartItemDto;
16-
import ru.teamtwo.website.exception.ItemNotFoundException;
17-
import ru.teamtwo.website.exception.UnableToAddItemException;
18-
import ru.teamtwo.website.service.customer.CartItemService;
16+
import ru.teamtwo.api.exception.ItemNotFoundException;
17+
import ru.teamtwo.api.exception.UnableToAddItemException;
18+
import ru.teamtwo.api.service.customer.CartItemService;
1919

2020
@Slf4j
2121
@RestController

0 commit comments

Comments
 (0)