Skip to content

Commit

Permalink
v0.1.7-Release (#78)
Browse files Browse the repository at this point in the history
* [etc] logger 추가 및 Exception logging 추가 (#71)

* [etc] CODEOWNERS 수정 (#72)

* Spring boot version 3.1.2 -> 3.1.6 (#73)

* [refactor]cursor 기반 page 타입 변경 (#74)

* [refactor] Swagger UI 라이브러리 변경: Spring REST docs -> Springdoc (#75)

* Swagger UI 라이브러리 변경 - Spring REST docs -> Springdoc

* 컨트롤러 인터페이스 분리

* Update src/main/resources/static/swagger-ui/openapi3.yaml

Co-authored-by: 유도진 <[email protected]>

* build.gradle 의존성 제거

* 인터페이스 이름 변경: ApiPresentation 추가

* 커버리지 체크 제외할 리스트 수정

* postfix 수정

* postfix 수정

* postfix 수정

* postfix 수정

* postfix수정

* REST doc 관련 의존성 및 파일 삭제

* 변경 사항 반영

* 리뷰 반영해서 수정

* 초깃값 동작 체크

---------

Co-authored-by: 유도진 <[email protected]>

* [etc] version 수정 (#77)

---------

Co-authored-by: 유도진 <[email protected]>
Co-authored-by: YOON <[email protected]>
Co-authored-by: Gopistol <[email protected]>
  • Loading branch information
4 people authored Jan 4, 2024
1 parent 16098ac commit 75571fb
Show file tree
Hide file tree
Showing 57 changed files with 518 additions and 824 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @dojinyou @k-kbk
* @dojinyou @k-kbk @Gopistol @0702Yoon
27 changes: 4 additions & 23 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.epages.restdocs.apispec.gradle.OpenApi3Task
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jooq.meta.jaxb.Logging
import org.springframework.boot.gradle.tasks.bundling.BootJar
Expand All @@ -7,7 +6,6 @@ plugins {
id("org.springframework.boot")
id("io.spring.dependency-management")
id("org.jlleitschuh.gradle.ktlint")
id("com.epages.restdocs-api-spec")
id("nu.studer.jooq")
kotlin("jvm")
kotlin("plugin.spring")
Expand Down Expand Up @@ -53,12 +51,12 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-starter-web")

// springDoc
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0")

// convert
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")

// container
developmentOnly("org.springframework.boot:spring-boot-docker-compose")

// database
runtimeOnly("org.postgresql:postgresql")
implementation("org.liquibase:liquibase-core")
Expand Down Expand Up @@ -135,24 +133,6 @@ tasks.test {
finalizedBy(tasks.jacocoTestReport)
}

tasks.register<Copy>("copyOasToSwagger") {
from("$buildDir/api-spec/openapi3.yaml")
into("src/main/resources/static/swagger-ui/.")
dependsOn("openapi3")
}

tasks.withType<OpenApi3Task> {
finalizedBy("copyOasToSwagger")
}

openapi3 {
setServer("http://localhost:8080")
title = "Eatda API Documentation"
description = "Eatda(잇다) 서비스의 API 명세서입니다."
version = "0.0.1"
format = "yaml"
}

jacoco {
toolVersion = jacocoVersion
}
Expand Down Expand Up @@ -209,6 +189,7 @@ tasks.jacocoTestCoverageVerification {
// 커버리지 체크를 제외할 클래스들
excludes = listOf(
"com.mjucow.eatda.EatdaApplicationKt",
"*.*ApiPresentation.*",
"*.common.*",
"*.dto.*",
"com.mjucow.eatda.jooq.*",
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### Application version ###
applicationVersion=0.1.5-RELEASE
applicationVersion=0.1.7-RELEASE

### Project configs ###
projectGroup="com.mjucow"
Expand All @@ -14,7 +14,7 @@ ktlintVersion=11.6.0
jacocoVersion=0.8.9

### Spring dependency versions ###
springBootVersion=3.1.2
springBootVersion=3.1.6
springDependencyManagementVersion=1.1.3

### DB depedency versions ###
Expand Down
5 changes: 5 additions & 0 deletions src/main/kotlin/com/mjucow/eatda/common/Common.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.mjucow.eatda.common

import org.slf4j.LoggerFactory

inline fun <reified T> T.logger() = LoggerFactory.getLogger(T::class.java)!!

This file was deleted.

20 changes: 20 additions & 0 deletions src/main/kotlin/com/mjucow/eatda/common/config/SwaggerConfig.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.mjucow.eatda.common.config

import io.swagger.v3.oas.models.Components
import io.swagger.v3.oas.models.OpenAPI
import io.swagger.v3.oas.models.info.Info
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@Configuration
class SwaggerConfig {
@Bean
fun swaggerApi(): OpenAPI = OpenAPI()
.components(Components())
.info(
Info()
.title("Eatda API Documentation")
.description("Eatda(잇다) 서비스의 API 명세서입니다.")
.version("0.1.7")
)
}
7 changes: 7 additions & 0 deletions src/main/kotlin/com/mjucow/eatda/common/dto/CursorPage.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.mjucow.eatda.common.dto

class CursorPage<T>(
val contents: List<T>,
val hasNext: Boolean,
val nextCursor: String?,
)
2 changes: 2 additions & 0 deletions src/main/kotlin/com/mjucow/eatda/common/vo/PhoneNumber.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.mjucow.eatda.common.vo
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.mjucow.eatda.common.vo.deseializer.PhoneNumberDeserializer
import io.swagger.v3.oas.annotations.media.Schema
import jakarta.persistence.Column
import jakarta.persistence.Embeddable

Expand All @@ -15,6 +16,7 @@ import jakarta.persistence.Embeddable
data class PhoneNumber(
@JsonProperty(value = "phoneNumber")
@Column(name = "phone_number")
@Schema(name = "phoneNumber", example = "02-300-1656")
val value: String,
) {
init {
Expand Down
14 changes: 12 additions & 2 deletions src/main/kotlin/com/mjucow/eatda/common/vo/Point.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
package com.mjucow.eatda.common.vo

import io.swagger.v3.oas.annotations.media.Schema
import jakarta.persistence.Column
import jakarta.persistence.Embeddable

@Embeddable
@Schema(
name = "Point",
description = "Represents a geographical point with latitude and longitude",
example = """{"latitude": 37.5802219, "longitude": 126.9226047}"""
)
data class Point(
@Column(name = "location_latitude") val latitude: Double,
@Column(name = "location_longitude") val longitude: Double,

@Column(name = "location_latitude")
val latitude: Double,

@Column(name = "location_longitude")
val longitude: Double,
)
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package com.mjucow.eatda.domain.banner.service.command.dto

import io.swagger.v3.oas.annotations.media.Schema
import java.time.Instant

data class CreateBannerCommand(
@Schema(name = "link", example = "https://career.programmers.co.kr/competitions/3353")
val link: String,
@Schema(name = "imageAddress", example = "banner/232D8241-C6A9-4AD9-B0EA-56F6DD24BADF.png")
val imageAddress: String,
@Schema(name = "expiredAt", example = "2023-11-21T14:11:34.639184Z")
val expiredAt: Instant? = null,
)
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package com.mjucow.eatda.domain.banner.service.command.dto

import io.swagger.v3.oas.annotations.media.Schema
import java.time.Instant

data class UpdateBannerCommand(
@Schema(name = "link", example = "https://career.programmers.co.kr/competitions/3353")
val link: String,
@Schema(name = "imageAddress", example = "banner/232D8241-C6A9-4AD9-B0EA-56F6DD24BADF.png")
val imageAddress: String,
@Schema(name = "expiredAt", example = "2023-11-21T14:11:34.639184Z")
val expiredAt: Instant?,
)
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
package com.mjucow.eatda.domain.banner.service.query.dto

import com.mjucow.eatda.domain.banner.entity.Banner
import io.swagger.v3.oas.annotations.media.Schema
import java.time.Instant

data class BannerDto(
@Schema(name = "id", example = "1")
val id: Long,
@Schema(name = "link", example = "https://career.programmers.co.kr/competitions/3353")
val link: String,
@Schema(name = "imageAddress", example = "banner/232D8241-C6A9-4AD9-B0EA-56F6DD24BADF.png")
val imageAddress: String,
@Schema(name = "expiredAt", example = "2023-11-21T14:11:34.639184Z")
val expiredAt: Instant?,
@Schema(name = "createdAt", example = "2023-11-20T14:11:52.114906Z")
val createdAt: Instant,
) {
companion object {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package com.mjucow.eatda.domain.notice.service.command.dto

import io.swagger.v3.oas.annotations.media.Schema

data class UpdateNoticeCommand(
@Schema(name = "title", example = "newTitle")
val title: String,
@Schema(name = "content", example = "newContent")
val content: String,
)
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
package com.mjucow.eatda.domain.notice.service.query.dto

import com.mjucow.eatda.domain.notice.entity.Notice
import io.swagger.v3.oas.annotations.media.Schema
import java.time.Instant

data class NoticeDto(
@Schema(name = "id", example = "1")
val id: Long,
@Schema(name = "title", example = "공지사항 제목")
val title: String,
@Schema(name = "content", example = "공지사항 내용")
val content: String,
@Schema(name = "createdAt", example = "2023-11-20T14:11:53.025126Z")
val createdAt: Instant,
) {
companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,21 @@ import com.mjucow.eatda.common.vo.PhoneNumber
import com.mjucow.eatda.common.vo.Point
import com.mjucow.eatda.domain.poplarstore.entity.PopularStore
import com.mjucow.eatda.domain.store.entity.Store
import io.swagger.v3.oas.annotations.media.Schema

data class PopularStoreDto(
@Schema(name = "id", example = "3")
val id: Long,
@Schema(name = "displayedName", example = "명지대학교")
val displayedName: String,
@Schema(name = "address", example = "서울특별시 서대문구 거북골로 34")
val address: String,
@JsonUnwrapped val phoneNumber: PhoneNumber? = null,
@JsonUnwrapped
val phoneNumber: PhoneNumber? = null,
@Schema(name = "imageAddress", example = "/eatda/public/store/232D8241-C6A9-4AD9-B0EA-56F6DD24BADF.jpg")
val imageAddress: String? = null,
val location: Point? = null,
@Schema(name = "count", example = "1")
val count: Long,
) {
companion object {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
package com.mjucow.eatda.domain.store.service.command.dto

data class CreateCommand(val name: String)
import io.swagger.v3.oas.annotations.media.Schema

data class CreateCommand(
@Schema(description = "생성할 카테고리 이름", example = "validName")
val name: String,
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package com.mjucow.eatda.domain.store.service.command.dto

import io.swagger.v3.oas.annotations.media.Schema

data class MenuCreateCommand(
@Schema(name = "name", example = "고추바사삭")
val name: String,
@Schema(name = "price", example = "20000")
val price: Int,
@Schema(name = "imageAddress", example = "null")
val imageAddress: String? = null,
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package com.mjucow.eatda.domain.store.service.command.dto

import io.swagger.v3.oas.annotations.media.Schema

data class MenuUpdateCommand(
@Schema(name = "name", example = "뿌링클")
val name: String,
@Schema(name = "price", example = "18000")
val price: Int,
@Schema(name = "imageAddress", example = "null")
val imageAddress: String? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ package com.mjucow.eatda.domain.store.service.command.dto

import com.mjucow.eatda.common.vo.PhoneNumber
import com.mjucow.eatda.common.vo.Point
import io.swagger.v3.oas.annotations.media.Schema

data class StoreCreateCommand(
@Schema(name = "name", example = "명지대학교")
val name: String,
@Schema(name = "address", example = "서울특별시 서대문구 거북골로 34")
val address: String,
@Schema(name = "displayName", example = "띵지대")
val displayName: String? = null,
@Schema(name = "phoneNumber", example = "02-123-4567")
val phoneNumber: PhoneNumber? = null,
@Schema(name = "imageAddress", example = "/eatda/public/store/232D8241-C6A9-4AD9-B0EA-56F6DD24BADF.jpg")
val imageAddress: String? = null,
@Schema(name = "location", example = "null")
val location: Point? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ package com.mjucow.eatda.domain.store.service.command.dto

import com.mjucow.eatda.common.vo.PhoneNumber
import com.mjucow.eatda.common.vo.Point
import io.swagger.v3.oas.annotations.media.Schema

data class StoreUpdateCommand(
@Schema(name = "Store Name", example = "명지대학교")
val name: String,
@Schema(name = "address", example = "서울특별시 서대문구 거북골로 34")
val address: String,
@Schema(name = "displayName", example = "띵지대")
val displayName: String?,
@Schema(name = "phoneNumber", example = "02-300-1656")
val phoneNumber: PhoneNumber?,
@Schema(name = "imageAddress", example = "/eatda/public/store/232D8241-C6A9-4AD9-B0EA-56F6DD24BADF.jpg")
val imageAddress: String?,
@Schema(name = "location")
val location: Point?,
)
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
package com.mjucow.eatda.domain.store.service.command.dto

data class UpdateNameCommand(val name: String)
import io.swagger.v3.oas.annotations.media.Schema

data class UpdateNameCommand(
@Schema(name = "name", description = "수정할 카테고리 이름", example = "newName")
val name: String,
)
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
package com.mjucow.eatda.domain.store.service.query

import com.mjucow.eatda.domain.store.entity.Menu
import io.swagger.v3.oas.annotations.media.Schema

data class MenuDto(
@Schema(name = "id", example = "25")
val id: Long,
@Schema(name = "name", example = "뿌링클")
val name: String,
@Schema(name = "price", example = "16000")
val price: Int,
@Schema(name = "imageAddress", example = "null")
val imageAddress: String? = null,
) {
companion object {
Expand Down
Loading

0 comments on commit 75571fb

Please sign in to comment.