Skip to content

Commit

Permalink
Merge branch 'dev' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Jyuung committed Aug 15, 2024
2 parents 2f2ca1f + 2bff6e5 commit cd246f8
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 0 deletions.
56 changes: 56 additions & 0 deletions delivery/build.gradle
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
}
13 changes: 13 additions & 0 deletions delivery/src/main/java/delivery/DeliveryApplication.java
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 delivery/src/main/java/delivery/common/config/JpaConfig.java
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 delivery/src/main/java/delivery/domain/TestController.java
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";
}

}
28 changes: 28 additions & 0 deletions delivery/src/main/resources/application.yml
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
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ rootProject.name = 'baobab'
include 'db'
include 'global'
include 'warehouse'
include 'delivery'

0 comments on commit cd246f8

Please sign in to comment.