-
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.
- Loading branch information
Showing
6 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
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,56 @@ | ||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' | ||
id 'io.spring.dependency-management' | ||
} | ||
|
||
group = 'org.fx' | ||
version = '1.0-SNAPSHOT' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
testImplementation platform('org.junit:junit-bom:5.10.0') | ||
testImplementation 'org.junit.jupiter:junit-jupiter' | ||
|
||
compileOnly 'org.projectlombok:lombok' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
|
||
//implementation 'org.springframework.boot:spring-boot-starter-security' | ||
|
||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
|
||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
|
||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' | ||
|
||
implementation 'io.jsonwebtoken:jjwt-api:0.11.5' | ||
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5' | ||
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5' | ||
|
||
// QueryDsl | ||
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta' | ||
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta" | ||
annotationProcessor "jakarta.annotation:jakarta.annotation-api" | ||
annotationProcessor "jakarta.persistence:jakarta.persistence-api" | ||
|
||
implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
|
||
implementation project(":db") | ||
implementation project(":global") | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
bootJar { | ||
enabled = true | ||
} | ||
|
||
jar { | ||
enabled = false | ||
} |
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,13 @@ | ||
package delivery; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
//@OpenAPIDefinition(servers = {@Server(url = "https://baobab.run", description = "fx server 연습용 도메인")}) | ||
@SpringBootApplication | ||
public class DeliveryApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(DeliveryApplication.class, args); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
delivery/src/main/java/delivery/common/config/JpaConfig.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,12 @@ | ||
package delivery.common.config; | ||
|
||
import org.springframework.boot.autoconfigure.domain.EntityScan; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories; | ||
|
||
@Configuration | ||
@EntityScan(basePackages = {"db"}) | ||
@EnableJpaRepositories(basePackages = {"db"}) | ||
public class JpaConfig { | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
delivery/src/main/java/delivery/domain/TestController.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,42 @@ | ||
package delivery.domain; | ||
|
||
import db.domain.goods.GoodsEntity; | ||
import db.domain.goods.GoodsRepository; | ||
import db.domain.goods.enums.GoodsStatus; | ||
import java.util.Optional; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
// TODO 삭제 예정 | ||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/test") | ||
public class TestController { | ||
|
||
private final GoodsRepository goodsRepository; | ||
|
||
/** | ||
* TODO 삭제 필요 - 임시 | ||
* 물품 id를 이용하여 입고 진행 중인 물품의 상태를 입고 완료로 변경하는 테스트 api 추가 요청합니다. | ||
* (클라이언트에서 입고 완료된 물품을 출고, 중고 등으로 전환 UI 테스트용) | ||
* by. iOS | ||
*/ | ||
@PostMapping("/goods/{goodsId}") | ||
public String changGoodsStatus(@PathVariable Long goodsId){ | ||
|
||
Optional<GoodsEntity> goods = goodsRepository.findById(goodsId); | ||
|
||
if(goods.isPresent()){ | ||
GoodsEntity goodsEntity = goods.get(); | ||
goodsEntity.setStatus(GoodsStatus.STORAGE); | ||
goodsRepository.save(goodsEntity); | ||
return "goods status changed !"; | ||
} | ||
|
||
return "goods not found"; | ||
} | ||
|
||
} |
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,28 @@ | ||
spring: | ||
jpa: | ||
show-sql: true | ||
hibernate: | ||
ddl-auto: validate | ||
properties: | ||
hibernate: | ||
format_sql: true | ||
dialect: org.hibernate.dialect.MySQL8Dialect | ||
datasource: | ||
url: jdbc:mysql://localhost:3306/baobab?useSSL=false&useUnicode=true&allowPublicKeyRetrieval=true | ||
driver-class-name: com.mysql.cj.jdbc.Driver | ||
username: root | ||
password: 1234 | ||
file: | ||
upload-dir: /Users/yeongwoonshin/Desktop/Baobab-SERVER/warehouse/src/main/resources/static/images/ | ||
path : /images/ | ||
|
||
jwt: | ||
secret: | ||
key: shinyangjunglee_baobab_passwordkey | ||
access-token: | ||
plus-hour: 1 | ||
refresh-token: | ||
plus-hour: 12 | ||
|
||
server: | ||
port: 8081 |
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ rootProject.name = 'baobab' | |
include 'db' | ||
include 'global' | ||
include 'warehouse' | ||
include 'delivery' | ||
|