-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat : 업체 등록 구현 및 도커 수정
- Loading branch information
Showing
35 changed files
with
252 additions
and
91 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
|
||
FROM openjdk:17 AS builder | ||
|
||
# 패키지를 설치해야, bootJAR 를 실행할 수 있다 | ||
RUN microdnf install findutils | ||
|
||
COPY gradlew . | ||
COPY gradle gradle | ||
COPY build.gradle . | ||
COPY settings.gradle . | ||
COPY src src | ||
|
||
RUN chmod +x ./gradlew | ||
RUN ./gradlew bootJAR | ||
|
||
|
||
FROM openjdk:17 | ||
|
||
# 위 builder에서 만든 .jar파일을 컨테이너 내부로 복사 | ||
COPY --from=builder build/libs/*.jar app/app.jar |
Binary file modified
BIN
-470 Bytes
(79%)
backend/ready/build/classes/java/main/project/one/OneApplication.class
Binary file not shown.
Binary file modified
BIN
-9 Bytes
(100%)
backend/ready/build/classes/java/main/project/one/auctionbids/dto/AuctionBidRequest.class
Binary file not shown.
Binary file modified
BIN
+247 Bytes
(110%)
backend/ready/build/classes/java/main/project/one/auctionbids/dto/AuctionBidResponse.class
Binary file not shown.
Binary file modified
BIN
+612 Bytes
(110%)
...end/ready/build/classes/java/main/project/one/auctionbids/service/AuctionBidService.class
Binary file not shown.
Binary file modified
BIN
+2.51 KB
(850%)
...nd/ready/build/classes/java/main/project/one/business/controller/BusinessController.class
Binary file not shown.
Binary file modified
BIN
+2.04 KB
(230%)
backend/ready/build/classes/java/main/project/one/business/domain/Business.class
Binary file not shown.
Binary file added
BIN
+1.93 KB
backend/ready/build/classes/java/main/project/one/business/dto/BusinessRequest.class
Binary file not shown.
Binary file added
BIN
+3.62 KB
backend/ready/build/classes/java/main/project/one/business/dto/BusinessResponse.class
Binary file not shown.
Binary file modified
BIN
+4.44 KB
(1500%)
backend/ready/build/classes/java/main/project/one/business/service/BusinessService.class
Binary file not shown.
Binary file added
BIN
+852 Bytes
backend/ready/build/classes/java/main/project/one/category/domain/Category.class
Binary file not shown.
Binary file removed
BIN
-3 KB
backend/ready/build/classes/java/main/project/one/category/domain/CategoryEnum.class
Binary file not shown.
Binary file added
BIN
+358 Bytes
backend/ready/build/classes/java/main/project/one/category/domain/CategoryRepository.class
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-5.97 KB
...y/build/tmp/compileJava/compileTransaction/stash-dir/AuctionBidController.class.uniqueId0
Binary file not shown.
Binary file removed
BIN
-7.93 KB
...eady/build/tmp/compileJava/compileTransaction/stash-dir/AuctionBidService.class.uniqueId1
Binary file not shown.
Binary file removed
BIN
-5.7 KB
...eady/build/tmp/compileJava/compileTransaction/stash-dir/AuctionController.class.uniqueId3
Binary file not shown.
Binary file removed
BIN
-4.43 KB
...d/ready/build/tmp/compileJava/compileTransaction/stash-dir/AuctionService.class.uniqueId4
Binary file not shown.
Binary file added
BIN
+2.2 KB
...d/ready/build/tmp/compileJava/compileTransaction/stash-dir/OneApplication.class.uniqueId0
Binary file not shown.
Binary file removed
BIN
-3.03 KB
backend/ready/build/tmp/compileJava/compileTransaction/stash-dir/S3Service.class.uniqueId2
Binary file not shown.
Binary file modified
BIN
-1 Byte
(100%)
backend/ready/build/tmp/compileJava/previous-compilation-data.bin
Binary file not shown.
25 changes: 10 additions & 15 deletions
25
backend/ready/src/main/java/project/one/OneApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,26 @@ | ||
package project.one; | ||
|
||
import io.github.cdimascio.dotenv.Dotenv; | ||
import io.swagger.v3.oas.annotations.OpenAPIDefinition; | ||
import io.swagger.v3.oas.annotations.servers.Server; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; | ||
|
||
import java.util.TimeZone; | ||
|
||
@OpenAPIDefinition(servers = {@Server(url = "/", description = "Default Server URL")}) | ||
@SpringBootApplication(exclude = SecurityAutoConfiguration.class) | ||
public class OneApplication { | ||
|
||
public static void main(String[] args) { | ||
Dotenv dotenv = Dotenv.load(); | ||
System.setProperty("spring.datasource.url", dotenv.get("SPRING_DATASOURCE_URL")); | ||
System.setProperty("spring.datasource.password", dotenv.get("SPRING_DATASOURCE_PASSWORD")); | ||
System.setProperty("spring.datasource.username", dotenv.get("SPRING_DATASOURCE_USERNAME")); | ||
System.setProperty("spring.datasource.driver.class.name", dotenv.get("SPRING_DATASOURCE_DRIVER_CLASS_NAME")); | ||
System.setProperty("spring.jpa.database", dotenv.get("SPRING_JPA_DATABASE")); | ||
System.setProperty("s3.access.key", dotenv.get("S3_ACCESS_KEY")); | ||
System.setProperty("s3.secret.key", dotenv.get("S3_SECRET_KEY")); | ||
System.setProperty("s3.bucket.url", dotenv.get("S3_BUCKET_URL")); | ||
System.setProperty("s3.bucket.name", dotenv.get("S3_BUCKET_NAME")); | ||
System.setProperty("spring.datasource.url", System.getenv("SPRING_DATASOURCE_URL")); | ||
System.setProperty("spring.datasource.password", System.getenv("SPRING_DATASOURCE_PASSWORD")); | ||
System.setProperty("spring.datasource.username", System.getenv("SPRING_DATASOURCE_USERNAME")); | ||
System.setProperty("spring.datasource.driver.class.name", System.getenv("SPRING_DATASOURCE_DRIVER_CLASS_NAME")); | ||
System.setProperty("spring.jpa.database", System.getenv("SPRING_JPA_DATABASE")); | ||
System.setProperty("s3.access.key", System.getenv("S3_ACCESS_KEY")); | ||
System.setProperty("s3.secret.key", System.getenv("S3_SECRET_KEY")); | ||
System.setProperty("s3.bucket.url", System.getenv("S3_BUCKET_URL")); | ||
System.setProperty("s3.bucket.name", System.getenv("S3_BUCKET_NAME")); | ||
|
||
SpringApplication.run(OneApplication.class, args); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
backend/ready/src/main/java/project/one/business/controller/BusinessController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,40 @@ | ||
package project.one.business.controller; | ||
|
||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
|
||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
import org.springframework.web.multipart.MultipartFile; | ||
import org.springframework.web.server.ResponseStatusException; | ||
import project.one.business.dto.BusinessRequest; | ||
import project.one.business.dto.BusinessResponse; | ||
import project.one.business.service.BusinessService; | ||
|
||
|
||
|
||
@RestController | ||
@RequestMapping("/business") | ||
public class BusinessController { | ||
private final BusinessService businessService; | ||
|
||
public BusinessController(BusinessService businessService) { | ||
this.businessService = businessService; | ||
} | ||
|
||
@Operation(summary = "업체 등록", description = "업체 정보와 관련 파일을 등록합니다.") | ||
@PostMapping(value = "/register", consumes = "multipart/form-data") | ||
public ResponseEntity<BusinessResponse> registerBusiness( | ||
@RequestPart("request") BusinessRequest request, | ||
@RequestPart("businessLicense") MultipartFile businessLicense, | ||
@RequestPart("businessIdentification") MultipartFile businessIdentification, | ||
@RequestPart("businessImage") MultipartFile businessImage) { | ||
try { | ||
BusinessResponse response = businessService.registerBusiness(request, businessLicense, businessIdentification, businessImage); | ||
return ResponseEntity.ok(response); | ||
} catch (Exception e) { | ||
throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Error registering business", e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
backend/ready/src/main/java/project/one/business/dto/BusinessRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package project.one.business.dto; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.springframework.web.multipart.MultipartFile; | ||
|
||
@Getter | ||
@Setter | ||
public class BusinessRequest { | ||
private Long userId; | ||
private Long categoryId; | ||
private String businessType; | ||
private String businessNumber; | ||
private String businessName; | ||
private String businessAddress; | ||
private String businessDetailAddress; | ||
} |
39 changes: 39 additions & 0 deletions
39
backend/ready/src/main/java/project/one/business/dto/BusinessResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package project.one.business.dto; | ||
|
||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
import project.one.business.domain.Business; | ||
|
||
@Getter | ||
@Setter | ||
public class BusinessResponse { | ||
private Long businessId; | ||
private Long userId; | ||
private Long categoryId; | ||
private String businessType; | ||
private String businessLicense; | ||
private String businessIdentification; | ||
private String businessNumber; | ||
private String businessImage; | ||
private String businessName; | ||
private String businessAddress; | ||
private String businessDetailAddress; | ||
private boolean isVerified; | ||
|
||
public BusinessResponse(Business business) { | ||
this.businessId = business.getId(); | ||
this.userId = business.getUser().getId(); | ||
this.categoryId = business.getCategory().getId(); | ||
this.businessType = business.getBusinessType(); | ||
this.businessLicense = business.getBusinessLicense(); | ||
this.businessIdentification = business.getBusinessIdentification(); | ||
this.businessNumber = business.getBusinessNumber(); | ||
this.businessImage = business.getBusinessImage(); | ||
this.businessName = business.getBusinessName(); | ||
this.businessAddress = business.getBusinessAddress(); | ||
this.businessDetailAddress = business.getBusinessDetailAddress(); | ||
this.isVerified = business.isVerified(); | ||
} | ||
} | ||
|
Oops, something went wrong.