Skip to content

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsorn committed Sep 23, 2020
2 parents 3667e1b + 18ed44a commit bed32d2
Show file tree
Hide file tree
Showing 342 changed files with 9,387 additions and 2,834 deletions.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Bug Report Template
about: 버그 관련 이슈
title: ''
labels: bug, Report
assignees: ''

---

### 버그 사항
해당 버그를 **자세하게** 적어주세요 😊


### 버그 simulation
버그를 발견하게 된 상황을 단계별로 적어주세요 😊


### 원하던 상황
원했던 상황을 자세하게 적어주세요 😊


### **Screenshots**
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement-report-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Enhancement Report Template
about: 기능 개선 사항 관련 템플릿
title: ''
labels: enhancement, Report
assignees: ''

---

### 개선 사항
개선하고 싶은 기능을 자세하게 적어주세요 😊

### 기능 simulation
기대하는 기능에 대한 상황을 단계별로 적어주세요 😊

### 원하는 동작
개선하고 싶은 기능을 자세하게 적어주세요 😊
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: 기능 이슈 템플릿
name: Feature Report Template
about: 기능 개발 관련 이슈
title: ''
labels: 'type: enhancement'
labels: ''
assignees: ''

---
Expand Down
29 changes: 24 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,26 @@ back/.DS_Store

# back
back/.gradle
back/build/

# api
back/api/.gradle
back/api/out/
back/api/build/
back/!gradle/wrapper/gradle-wrapper.jar
back/!**/src/main/**
back/!**/src/test/**
back/api/!**/src/main/**
back/api/!**/src/test/**
back/api/src/main/resources/application-*.yml
back/api/src/test/resources/application-*.yml
back/api/src/main/generated

# chat
back/chat/out/
back/chat/build/
back/chat/src/main/resources/application-*.yml

# common
back/common/build/
back/common/out/

### STS ###
back/.apt_generated
Expand Down Expand Up @@ -53,5 +69,8 @@ back/out/
### VS Code ###
.vscode/
.idea/
/back/src/main/resources/application-*.yml
/back/src/test/resources/application-*.yml
/back/api/src/main/resources/application-*.yml
/back/api/src/test/resources/application-*.yml
/back/api/src/main/generated

/back/chat/src/main/resources/application-*.yml
2 changes: 1 addition & 1 deletion Dockerfile-springboot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ VOLUME /tmp

EXPOSE 8080

ARG JAR_FILE=back/build/libs/back-0.0.1-SNAPSHOT.jar
ARG JAR_FILE=back/api/build/libs/api-0.0.1-SNAPSHOT.jar

ADD ${JAR_FILE} seller-lee-springboot.jar

Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ node {
checkout scm
}
stage('build') {
sh 'cd back && ./gradlew clean build'
sh 'cd back && ./gradlew api:clean api:build && ./gradlew chat:clean chat:build'
}
}
121 changes: 121 additions & 0 deletions back/api/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
// QueryDSL Version
def queryDSLVersion = '4.2.2'
// QueryDSL PATH
def generated = "src/main/generated"

configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
compileOnly {
extendsFrom annotationProcessor
}
}

dependencies {
// spring
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}

// queryDSL
implementation "com.querydsl:querydsl-core:${queryDSLVersion}"
implementation "com.querydsl:querydsl-jpa:${queryDSLVersion}"
implementation "com.querydsl:querydsl-apt:${queryDSLVersion}"
annotationProcessor(
"com.querydsl:querydsl-apt:${queryDSLVersion}:jpa",
"org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final",
"javax.annotation:javax.annotation-api",
)

// expo server
implementation 'io.github.jav:expo-server-sdk:1.1.0'
// documentation
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
asciidoctor 'org.springframework.restdocs:spring-restdocs-asciidoctor'
// httpClientBuilder
implementation 'org.apache.httpcomponents:httpclient:4.5'
// jwt
implementation 'io.jsonwebtoken:jjwt:0.9.1'
// apache
implementation 'org.apache.commons:commons-lang3:3.10'
// flyway
implementation 'org.flywaydb:flyway-core'
// mariaDB
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
// h2
testImplementation 'com.h2database:h2'
// rest assured
testImplementation 'io.rest-assured:rest-assured:3.3.0'
// security test
testImplementation 'org.springframework.security:spring-security-test'
}

test {
useJUnitPlatform()
}

sourceSets {
main.java.srcDirs += [ generated ]
}

tasks.withType(JavaCompile) {
options.annotationProcessorGeneratedSourcesDirectory = file(generated)
}

clean.doLast {
file(generated).deleteDir()
}

bootJar {
dependsOn asciidoctor
from("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}
}

ext {
snippetsDir = file('build/generated-snippets')
}

test {
outputs.dir snippetsDir
}

asciidoctor {
inputs.dir snippetsDir
dependsOn test
}

processResources.dependsOn('copyDatabaseSecret')

task copyDatabaseSecret {
dependsOn 'copyDatabaseSecretMain'
dependsOn 'copyDatabaseSecretTest'
}

task copyDatabaseSecretMain(type: Copy) {
from('../../seller-lee-secret') {
include 'application-common.yml'
include 'application-security.yml'
include 'application-dev.yml'
include 'application-local.yml'
include 'application-prod.yml'
}
into 'src/main/resources'
}

task copyDatabaseSecretTest(type: Copy) {
from('../../seller-lee-secret') {
include 'application-security.yml'
}
into 'src/test/resources'
}

19 changes: 18 additions & 1 deletion back/src/docs/api-docs.adoc → back/api/src/docs/api-docs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,21 @@ operation::articles/update[snippets='http-request,request-body']

=== 채팅방 생성

operation::chat-rooms/post[snippets='http-request,http-response,request-fields,request-body,response-headers']
operation::chat-rooms/post[snippets='http-request,http-response,request-fields,request-body,response-headers']

== 조직 관리

=== 조직 생성

operation::organizations/create[snippets='http-request,request-headers,request-body,request-fields,http-response,response-body,response-fields']

=== 회원이 가입한 조직 조회

operation::organizations/get[snippets='http-request,request-headers,http-response,response-body,response-fields']

== 회원 / 조직 관리

=== 회원 - 조직 입장

operation::memberOrganization/create[snippets='http-request,request-headers,request-body,request-fields,http-response,response-headers']

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sellerlee.back;
package com.jikgorae.api;

import java.util.TimeZone;

Expand All @@ -8,14 +8,14 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class SellerLeeApplication {
public class ApiApplication {
public static void main(String[] args) {
SpringApplication.run(ApiApplication.class, args);
}

@PostConstruct
void init() {
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Seoul"));
}

public static void main(String[] args) {
SpringApplication.run(SellerLeeApplication.class, args);
}

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package sellerlee.back.article.application;
package com.jikgorae.api.article.application;

import static java.util.stream.Collectors.*;

import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.stream.IntStream;

import sellerlee.back.article.domain.Article;
import com.jikgorae.api.article.domain.Article;
import com.querydsl.core.annotations.QueryProjection;

public class ArticleCardResponse {
private Long id;
Expand Down Expand Up @@ -34,6 +35,21 @@ private ArticleCardResponse(Long id, String title, Long price, String thumbnail,
this.createdTime = createdTime;
}

@QueryProjection
public ArticleCardResponse(Article article, long favoriteCount, boolean favoriteState) {
this(article.getId(), article.getTitle(), article.getPrice(),
article
.getPhotos()
.pickThumbnail(),
article
.getTradeState()
.getTradeStateName(),
favoriteCount,
favoriteState,
article.getCreatedTime().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
);
}

public static ArticleCardResponse of(Article article, Long favoriteCount,
boolean favoriteState) {
return new ArticleCardResponse(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package sellerlee.back.article.application;
package com.jikgorae.api.article.application;

import java.util.List;

import sellerlee.back.article.domain.Article;
import sellerlee.back.article.domain.Category;
import sellerlee.back.article.domain.Photos;
import sellerlee.back.article.domain.Tags;
import sellerlee.back.article.domain.TradeState;
import sellerlee.back.member.domain.Member;
import com.jikgorae.api.article.domain.Article;
import com.jikgorae.api.article.domain.Category;
import com.jikgorae.api.article.domain.Photos;
import com.jikgorae.api.article.domain.Tags;
import com.jikgorae.api.article.domain.TradeState;
import com.jikgorae.api.member.domain.Member;
import com.jikgorae.api.organization.domain.Organization;

public class ArticleRequest {
private String title;
private List<Organization> organizations;
private Long price;
private String category;
private String contents;
Expand All @@ -20,9 +22,12 @@ public class ArticleRequest {
private ArticleRequest() {
}

public ArticleRequest(String title, Long price, String category, String contents,
public ArticleRequest(String title, List<Organization> organizations, Long price,
String category,
String contents,
List<String> tags, List<String> photos) {
this.title = title;
this.organizations = organizations;
this.price = price;
this.category = category;
this.contents = contents;
Expand All @@ -46,6 +51,10 @@ public String getTitle() {
return title;
}

public List<Organization> getOrganizations() {
return organizations;
}

public Long getPrice() {
return price;
}
Expand Down
Loading

0 comments on commit bed32d2

Please sign in to comment.