Skip to content

Commit

Permalink
v 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kouz95 authored Sep 8, 2020
2 parents 1a5901f + 3a1e4ef commit c3a911b
Show file tree
Hide file tree
Showing 303 changed files with 16,896 additions and 6,166 deletions.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/---------.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: 기능 이슈 템플릿
about: 기능 개발 관련 이슈
title: ''
labels: 'type: enhancement'
assignees: ''

---

### 상세 내용
-

### 선행 작업
-
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
front/package-lock.json
front/yarn.lock
front/.prettierignore
front/node_modules/**/*
front/.expo/*
front/npm-debug.*
Expand All @@ -9,6 +12,8 @@ front/*.mobileprovision
front/*.orig.*
front/web-build/
front/dist/
front/src/secret.ts


# macOS
front/.DS_Store
Expand Down Expand Up @@ -48,3 +53,5 @@ back/out/
### VS Code ###
.vscode/
.idea/
/back/src/main/resources/application-*.yml
/back/src/test/resources/application-*.yml
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "seller-lee-secret"]
path = seller-lee-secret
url = https://github.com/seller-lee/seller-lee-secret
branch = master
6 changes: 6 additions & 0 deletions Dockerfile-mariadb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM mariadb:10.5.5

ENV MYSQL_DATABASE sl_db
ENV MYSQL_ROOT_PASSWORD 1234

EXPOSE 3306
11 changes: 11 additions & 0 deletions Dockerfile-springboot
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM openjdk:8-alpine

VOLUME /tmp

EXPOSE 8080

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

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

ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-Dspring.profiles.active=dev","-jar","/seller-lee-springboot.jar"]
8 changes: 8 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node {
stage ('clone') {
checkout scm
}
stage('build') {
sh 'cd back && ./gradlew clean build'
}
}
66 changes: 65 additions & 1 deletion back/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'org.springframework.boot' version '2.3.1.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
id "org.asciidoctor.convert" version "1.5.9.2"
}

group = 'sellerlee'
Expand All @@ -13,14 +14,77 @@ repositories {
}

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-web'
implementation 'org.springframework.boot:spring-boot-starter-security'
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'
}
// documentation
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
asciidoctor 'org.springframework.restdocs:spring-restdocs-asciidoctor'
// 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'
}

test {
useJUnitPlatform()
}

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

test {
outputs.dir snippetsDir
}

asciidoctor {
inputs.dir snippetsDir
dependsOn test
}

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

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'
}
5 changes: 3 additions & 2 deletions back/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Fri Jul 24 13:34:49 KST 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
2 changes: 1 addition & 1 deletion back/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
53 changes: 53 additions & 0 deletions back/src/docs/api-docs.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
ifndef::snippets[]
:snippets: ../../../build/generated-snippets
endif::[]
:toc: preamble
:toc-title: 목차
:toclevels: 2
:doctitle: 셀러리 API
:author: 터틀
:email: [email protected]

Doc Writer <{author} : {email}>

[[resources-member]]
== 회원 관리

=== 회원 로그인

operation::login[snippets='http-request,http-response,request-fields,request-body']

=== 회원 로그인 실패

==== 이메일

operation::login/advice/email[snippets='http-request,http-response,request-fields,request-body,response-body']

==== 비밀번호

operation::login/advice/password[snippets='http-request,http-response,request-fields,request-body,response-body']

[[resources-articles]]
== 게시글 관리

=== 게시글 페이지 조회

operation::articles/getPage[snippets='http-request,http-response,request-parameters,response-body']

=== 게시글 상세 조회

operation::articles/get[snippets='http-request,http-response,path-parameters,request-parameters,response-body']

=== 게시글 생성

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

=== 게시글 수정

operation::articles/update[snippets='http-request,request-body']

== 채팅방 관리

=== 채팅방 생성

operation::chat-rooms/post[snippets='http-request,http-response,request-fields,request-body,response-headers']
13 changes: 0 additions & 13 deletions back/src/main/java/sellerlee/back/BackApplication.java

This file was deleted.

21 changes: 21 additions & 0 deletions back/src/main/java/sellerlee/back/SellerLeeApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package sellerlee.back;

import java.util.TimeZone;

import javax.annotation.PostConstruct;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class SellerLeeApplication {
@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
@@ -0,0 +1,90 @@
package sellerlee.back.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;

public class ArticleCardResponse {
private Long id;
private String title;
private Long price;
private String thumbnail;
private String tradeState;
private long favoriteCount;
private boolean favoriteState;
private String createdTime;

private ArticleCardResponse() {
}

private ArticleCardResponse(Long id, String title, Long price, String thumbnail,
String tradeState, long favoriteCount, boolean favoriteState,
String createdTime) {
this.id = id;
this.title = title;
this.price = price;
this.thumbnail = thumbnail;
this.tradeState = tradeState;
this.favoriteCount = favoriteCount;
this.favoriteState = favoriteState;
this.createdTime = createdTime;
}

public static ArticleCardResponse of(Article article, Long favoriteCount,
boolean favoriteState) {
return new ArticleCardResponse(
article.getId(),
article.getTitle(),
article.getPrice(),
article.getPhotos().pickThumbnail(),
article.getTradeState().getTradeStateName(),
favoriteCount,
favoriteState,
article.getCreatedTime().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
);
}

public static List<ArticleCardResponse> listOf(List<Article> articles,
List<Long> favoriteCounts,
List<Boolean> favoriteStates) {
return IntStream.range(0, articles.size())
.mapToObj(i -> of(articles.get(i), favoriteCounts.get(i), favoriteStates.get(i)))
.collect(toList());
}

public Long getId() {
return id;
}

public String getTitle() {
return title;
}

public Long getPrice() {
return price;
}

public String getThumbnail() {
return thumbnail;
}

public String getTradeState() {
return tradeState;
}

public long getFavoriteCount() {
return favoriteCount;
}

public boolean isFavoriteState() {
return favoriteState;
}

public String getCreatedTime() {
return createdTime;
}
}
Loading

0 comments on commit c3a911b

Please sign in to comment.