Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge develop to main #77

Merged
merged 85 commits into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
21bf4e8
docs: README μˆ˜μ •
egg528 Nov 11, 2023
147acab
feat: add issue template
Nov 11, 2023
3024a41
chore: java version 17 λ³€κ²½, projectGroup λ³€κ²½
egg528 Nov 11, 2023
86ef3f9
feat(#1): add spring security config
Nov 11, 2023
ca9f049
fix(#1): fix typo
Nov 11, 2023
ffb57db
chore(#1): fix typo
Nov 11, 2023
7c0c4dd
feat(#1): add local sign-up
ManHyuk Nov 11, 2023
7e918c4
feat(#1): add jwt login
ManHyuk Nov 11, 2023
02dd51a
feat(#1): 둜컬 둜그인 μΆ”κ°€
ManHyuk Nov 13, 2023
53624f7
chore(#1): μ½”λ“œ 정리
ManHyuk Nov 13, 2023
27514e3
refact(#1): SecurityUser -> CurrentUser 클래슀 이름 λ³€κ²½
ManHyuk Nov 13, 2023
9c6b816
feat(#1): delete ".sprintboot" in path
ManHyuk Nov 13, 2023
9302cdd
feat(#1): add oauth2
ManHyuk Nov 13, 2023
064b449
feat(#1): oauth2 카카였 μ‚­μ œ
ManHyuk Nov 14, 2023
2760e91
chore(#1): edit println -> logger
ManHyuk Nov 14, 2023
90ff6ac
refact(#1): loadUser μ½”λ“œ 정리
ManHyuk Nov 14, 2023
3e65e4c
chore(#1): μ½”λ“œ 정리
ManHyuk Nov 14, 2023
7498447
docs : PR을 open, synchronize, closed ν•  λ•Œλ§ˆλ‹€ λΉŒλ“œν•˜κΈ° μœ„ν•œ github workflows 코…
binary-ho Nov 16, 2023
b8c2d73
chore(#1): μ½”λ“œλ¦¬λ·° 반영
ManHyuk Nov 17, 2023
85b3eac
refact(#1): μ½”λ“œλ¦¬λ·° 반영
ManHyuk Nov 17, 2023
f678d97
Merge pull request #8 from depromeet/feature/#1-social
ManHyuk Nov 17, 2023
f4d6351
chore(#1): μ½”λ“œ 정리
ManHyuk Nov 17, 2023
2b1b550
Merge pull request #7 from depromeet/feature/#6
binary-ho Nov 21, 2023
a464946
Merge pull request #3 from depromeet/feature/#1
ManHyuk Nov 21, 2023
214593e
Merge pull request #10 from depromeet/feature/#1-social
ManHyuk Nov 21, 2023
7c154e0
feat(#1): edit response token
Nov 23, 2023
ce8592e
Merge pull request #11 from depromeet/feature/#1-auth
ManHyuk Nov 23, 2023
fae86bc
feat(#9): refactor project architecture
egg528 Nov 24, 2023
321081e
style: apply lint
egg528 Nov 26, 2023
658b71a
fix: fix package path
egg528 Nov 26, 2023
528b77d
style: apply lint
egg528 Nov 26, 2023
9c6fe52
delete: delete example test
egg528 Nov 27, 2023
3ddd433
refactor: package path μˆ˜μ •(auth νŒ¨ν‚€μ§€ api λ‚΄λΆ€λ‘œ 이동)
egg528 Nov 27, 2023
93d581b
Merge pull request #12 from depromeet/feature/#9
egg528 Nov 28, 2023
a5fe807
feat(#1): edit package
ManHyuk Nov 28, 2023
535fbf2
Merge pull request #15 from depromeet/feature/#1-edit-package
ManHyuk Nov 28, 2023
610f8a9
refact(#1): refact oauth login
ManHyuk Dec 2, 2023
8f2ac30
feat(#1): μœ μ € 정보 μˆ˜μ • api μΆ”κ°€
ManHyuk Dec 2, 2023
da20a6f
chore(#1): λ³€μˆ˜λͺ… μˆ˜μ •
ManHyuk Dec 2, 2023
094894b
chore(#1): lint
ManHyuk Dec 2, 2023
1c17d5c
chore(#1): edit test code
ManHyuk Dec 2, 2023
70d4e17
chore: add codeowners
Dec 3, 2023
5239ba9
Merge branch 'develop' of https://github.com/depromeet/amazing3-be in…
Dec 3, 2023
c7c9a79
chore: add pre commit plugin
Dec 3, 2023
e7973d2
Merge pull request #18 from depromeet/feature/#1-login
ManHyuk Dec 3, 2023
6f94b71
feat(#22): Actuator μ„€μ •
egg528 Dec 11, 2023
6a2b10b
fix(#22): profiles group μ„€μ • 방식 λ³€κ²½
Dec 11, 2023
677e42e
Merge pull request #23 from depromeet/feature/#22-set-actuator
egg528 Dec 11, 2023
a3b028f
refactor : λΆˆν•„μš”ν•œ db-core package example files 제거 (#26)
binary-ho Dec 14, 2023
95a5cd4
ERD 기반 Entity 생성 #21 (#24)
binary-ho Dec 14, 2023
e7e6e59
[Feature] Sticker, Tag API μž‘μ„± (#29) (#30)
binary-ho Dec 15, 2023
b16cffe
[Feature] Goal API μž‘μ„± #27 (#32)
binary-ho Dec 15, 2023
ae727eb
[Feature] Task API μž‘μ„± (#33)
binary-ho Dec 16, 2023
01135e2
[Feature] Swagger λ„μž… (#35) (#37)
binary-ho Dec 16, 2023
483acb9
[Refactor] λΆˆν•„μš”ν•˜κ²Œ Wrapping된 Responseλ“€ Unwrapping (#43)
binary-ho Dec 18, 2023
d6b724e
[Refactor] Goal 전체 쑰회 API μˆ˜μ • - 총 λͺ©ν‘œ 갯수 μΆ”κ°€, title, description μ‚­μ œ, dea…
binary-ho Dec 19, 2023
b04243b
[Refactor] 생성 API에 생성 λ¦¬μ†ŒμŠ€ λ°˜ν™˜ μΆ”κ°€ (#40) (#45)
binary-ho Dec 19, 2023
15f81b7
[Feature] 기쀀에 따라 Goal 쑰회 κ²°κ³Ό μ •λ ¬ (#38) (#47)
binary-ho Dec 19, 2023
d3695cd
[Feature] Dockerfile μΆ”κ°€ / DB μ„€μ • μˆ˜μ • / springdoc μ„€λͺ… μΆ”κ°€ 및 JWT μΆ”κ°€ κΈ°λŠ₯ (#4)…
egg528 Dec 19, 2023
cf26e9b
feat(#50): edit current user info api
ManHyuk Dec 19, 2023
91ba43a
[feature] μ•”ν˜Έν™”λ₯Ό μœ„ν•œ Jasypt λ„μž…κ³Ό μ‚¬μš© μ„€λͺ… ν…ŒμŠ€νŠΈ μž‘μ„± (#48) (#49)
binary-ho Dec 19, 2023
a0dd031
chore(#50): edit lint
ManHyuk Dec 19, 2023
2780b11
Merge pull request #51 from depromeet/feature/#50
ManHyuk Dec 19, 2023
49d32cf
fix: Sticker ν•„λ“œ μˆ˜μ • (#52)
egg528 Dec 19, 2023
351c1d7
fix: db-core live ν™˜κ²½ λ³€μˆ˜ μˆ˜μ •
egg528 Dec 19, 2023
dfa0ebb
[Feature] 곡톡 Response Wrapping (#53) (#54)
binary-ho Dec 20, 2023
f1aa666
fix: create goal requestBody ν•„λ“œ μ˜€νƒ€ μˆ˜μ •
egg528 Dec 21, 2023
26bb959
fix: GoalResponse description ν•„λ“œ μΆ”κ°€
egg528 Dec 21, 2023
31ffa94
[Revert] "μ•”ν˜Έν™”λ₯Ό μœ„ν•œ Jasypt λ„μž…κ³Ό μ‚¬μš© μ„€λͺ… ν…ŒμŠ€νŠΈ μž‘μ„± (#48) (#49)" (#56)
egg528 Dec 21, 2023
7675662
feat(#16): add user profile image
ManHyuk Dec 21, 2023
7c6f550
feature(#4): github action CI/CD pipeline ꡬ좕 (#57)
egg528 Dec 21, 2023
e625731
feat(#59): edit DELETE /goal params
ManHyuk Dec 21, 2023
fb239b9
chore(#16): edit test user field
ManHyuk Dec 21, 2023
3502fee
chore(#16): edit test user field
ManHyuk Dec 21, 2023
4c2420a
Merge pull request #58 from depromeet/feature/#16-profile
ManHyuk Dec 21, 2023
817aea3
Merge branch 'feature/#16-profile' into feature/#59
ManHyuk Dec 21, 2023
0c46447
Merge pull request #60 from depromeet/feature/#59
ManHyuk Dec 21, 2023
a840324
Update WebSecurityConfig.kt
ManHyuk Dec 22, 2023
86e5c7d
Merge pull request #62 from depromeet/feature/#61
ManHyuk Dec 22, 2023
a462d62
[Feature] Slack Webhook을 ν™œμš©ν•œ Logger μΆ”κ°€ (#63) (#64)
egg528 Dec 24, 2023
5e6ab44
fix: Slack Logger defaultError() νŒŒλΌλ―Έν„° μˆœμ„œ μˆ˜μ •
egg528 Dec 24, 2023
0651fd5
Goal Serivce, CustomLocalDate ν…ŒμŠ€νŠΈ 보좩 (#42) (#55)
binary-ho Dec 26, 2023
65c2d1f
fix(#65): swagger μ„œλ²„ url κ°’ ν™˜κ²½ λ³€μˆ˜λ‘œ λΉΌκΈ° (#66)
egg528 Dec 27, 2023
dd9d68e
[Feature] Admin Api 개발 (#68) (#74)
egg528 Jan 4, 2024
5b7c93b
fix: ci/cd github secrets μˆ˜μ •
egg528 Jan 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @ManHyuk @egg528 @binary-ho
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: ν‹°μΌ“ 이슈
about: ν‹°μΌ“ λ°œν–‰μ„ μœ„ν•œ μ΄μŠˆμž…λ‹ˆλ‹€.
title: ''
labels: enhancement
assignees: ''

---

### ⚠️ Issue
- 이슈 κ°œμš”λ₯Ό μž…λ ₯ν•΄μ£Όμ„Έμš”.

### ✏️ ToDoList
- [ ] ν•  일1
41 changes: 41 additions & 0 deletions .github/workflows/admin-ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Admin CI/CD

on:
push:
branches: [ "develop" ]
paths-ignore:
- 'application/api/**' # application/api 폴더 λ‚΄μ˜ λ³€ν™” λ¬΄μ‹œ

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3

- name: setup jdk 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: build with gradle
run: ./gradlew bootJar

- name: push to dockerhub
run: |
docker login -u ${{ secrets.DOCKER_ID }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build --no-cache -t ${{ secrets.DOCKER_ID }}/${{ secrets.DOCKER_ADMIN_REPO }} -f ./application/admin/Dockerfile .
docker push ${{ secrets.DOCKER_ID }}/${{ secrets.DOCKER_ADMIN_REPO }}
- name: deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
port: ${{ secrets.SSH_PORT }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
script: |
${{ secrets.SSH_SCRIPT_FOR_ADMIN }}
41 changes: 41 additions & 0 deletions .github/workflows/api-ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Api CI/CD

on:
push:
branches: [ "develop" ]
paths-ignore:
- 'application/admin/**' # application/admin 폴더 λ‚΄μ˜ λ³€ν™” λ¬΄μ‹œ

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3

- name: setup jdk 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: build with gradle
run: ./gradlew bootJar

- name: push to dockerhub
run: |
docker login -u ${{ secrets.DOCKER_ID }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build --no-cache -t ${{ secrets.DOCKER_ID }}/${{ secrets.DOCKER_REPO }} -f ./application/api/Dockerfile .
docker push ${{ secrets.DOCKER_ID }}/${{ secrets.DOCKER_REPO }}
- name: deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
port: ${{ secrets.SSH_PORT }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
script: |
${{ secrets.SSH_SCRIPT }}
41 changes: 41 additions & 0 deletions .github/workflows/pull-request-gradle-build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name : Pull Request Gradle Build Test

on:
pull_request:
types: [opened, synchronize, closed]

permissions: read-all

jobs:
build-test:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Git Checkout
uses: actions/[email protected]

- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
application:
- 'build.gradle.kts'
- '**/src/**'

- name: JDK μ„€μΉ˜
if: steps.changes.outputs.application == 'true'
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
cache: 'gradle'

- name: gradlew κΆŒν•œ λΆ€μ—¬
run: chmod +x ./gradlew

- name: Gradle Build
if: steps.changes.outputs.application == 'true'
run: |
./gradlew build --no-build-cache
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# amazing3-be

## 컀멧 μ»¨λ²€μ…˜
## 컀밋 μ»¨λ²€μ…˜
- `νƒœκ·Έ(#issue): λ‚΄μš©`
- feat : μƒˆλ‘œμš΄ κΈ°λŠ₯ μΆ”κ°€
- fix : 버그 μˆ˜μ •
- docs : λ¬Έμ„œ μˆ˜μ •
- style : μ½”λ“œ ν¬λ§·νŒ…, μ„Έλ―Έμ½œλ‘  λˆ„λ½, μ½”λ“œ 변경이 μ—†λŠ” 경우
- refactor : μ½”λ“œ λ¦¬νŽ™ν† λ§
- test : ν…ŒμŠ€νŠΈ μ½”λ“œ, λ¦¬νŽ™ν† λ§ ν…ŒμŠ€νŠΈ μ½”λ“œ μΆ”κ°€
- chore : λΉŒλ“œ 업무 μˆ˜μ •, νŒ¨ν‚€μ§€ λ§€λ‹ˆμ € μˆ˜μ •
- chore : λΉŒλ“œ 업무 μˆ˜μ •, νŒ¨ν‚€μ§€ λ§€λ‹ˆμ € 수
4 changes: 4 additions & 0 deletions application/admin/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM --platform=linux/amd64 openjdk:17-jdk-slim
EXPOSE 7000
COPY application/admin/build/libs/*.jar app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
17 changes: 17 additions & 0 deletions application/admin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
tasks.getByName("bootJar") {
enabled = true
}

tasks.getByName("jar") {
enabled = false
}

dependencies {
implementation(project(":storage:db-core"))
implementation(project(":storage:image"))

implementation("org.springframework.boot:spring-boot-starter-web")

/* swagger */
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0")
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package io.dodn.springboot.storage.db
package io.raemian

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.context.properties.ConfigurationPropertiesScan
import org.springframework.boot.runApplication

@ConfigurationPropertiesScan
@SpringBootApplication
class CoreDbTestApplication
class AdminApplication

fun main(args: Array<String>) {
runApplication<CoreDbTestApplication>(*args)
runApplication<AdminApplication>(*args)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package io.raemian.admin.config

import io.raemian.admin.support.error.CoreApiException
import io.raemian.admin.support.error.ErrorType
import io.raemian.admin.support.response.ApiResponse
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.ExceptionHandler
import org.springframework.web.bind.annotation.RestControllerAdvice

@RestControllerAdvice
class GlobalExceptionHandler {
private val log: Logger = LoggerFactory.getLogger(javaClass)

@ExceptionHandler(CoreApiException::class)
fun handleCoreApiException(e: CoreApiException): ResponseEntity<ApiResponse<Any>> {
log.error("Exception : {}", e.message, e)
return ResponseEntity(ApiResponse.error(e.errorType), e.errorType.status)
}

@ExceptionHandler(Exception::class)
fun handleException(e: Exception): ResponseEntity<ApiResponse<Any>> {
log.error("Exception : {}", e.message, e)
return ResponseEntity(ApiResponse.error(ErrorType.DEFAULT_ERROR, e), ErrorType.DEFAULT_ERROR.status)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package io.raemian.admin.config

import io.swagger.v3.oas.models.OpenAPI
import io.swagger.v3.oas.models.info.Info
import io.swagger.v3.oas.models.servers.Server
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@Configuration
class SpringdocConfig {

@Value("\${springdoc.server.url}")
private lateinit var url: String

@Bean
fun openAPI(): OpenAPI {
return OpenAPI()
.info(apiInfo())
.servers(listOf(apiServer()))
}

private fun apiInfo() = Info()
.title("BANDIBOODI Admin API λͺ…μ„Έ")
.description("BANDIBOODI Admin API λͺ…μ„Έμ„œ")
.version("v1.0.0")

private fun apiServer() = Server().url(url)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package io.raemian.admin.sticker

import io.raemian.admin.sticker.controller.request.CreateStickerRequest
import io.raemian.admin.sticker.controller.request.UpdateStickerRequest
import io.raemian.admin.sticker.controller.response.StickerResponse
import io.raemian.admin.support.error.CoreApiException
import io.raemian.admin.support.error.ErrorType
import io.raemian.image.enums.FileExtensionType
import io.raemian.image.repository.ImageRepository
import io.raemian.storage.db.core.sticker.Sticker
import io.raemian.storage.db.core.sticker.StickerRepository
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional

@Service
class StickerService(
private val stickerRepository: StickerRepository,
private val imageRepository: ImageRepository,
) {

@Transactional
fun create(
createStickerRequest: CreateStickerRequest,
): StickerResponse {
val fileName = validateFileName(createStickerRequest.image.originalFilename)

val url = imageRepository.upload(fileName, createStickerRequest.image.inputStream)

val stickers = stickerRepository.save(Sticker(createStickerRequest.name, url))

return StickerResponse.from(stickers)
}

@Transactional(readOnly = true)
fun findAll(): List<StickerResponse> =
stickerRepository.findAll().map(::StickerResponse)

@Transactional
fun update(
stickerId: Long,
updateStickerRequest: UpdateStickerRequest,
): StickerResponse {
val newFileName = validateFileName(updateStickerRequest.image.originalFilename)

val stickers = stickerRepository.getById(stickerId)

val url = imageRepository.update(
newFileName,
splitFileNameFromUrl(stickers.url),
updateStickerRequest.image.inputStream,
)

val updatedStickers = stickerRepository.save(Sticker(updateStickerRequest.name, url))

return StickerResponse.from(stickers)
}

@Transactional
fun delete(
stickerId: Long,
) {
val stickers = stickerRepository.getById(stickerId)

imageRepository.delete(splitFileNameFromUrl(stickers.url))

stickerRepository.delete(stickers)
}

private fun splitFileNameFromUrl(url: String): String {
return url.split("/").last()
}

private fun validateFileName(fileName: String?): String {
if (fileName.isNullOrBlank()) {
throw CoreApiException(ErrorType.NO_IMAGE_NAME_ERROR)
}

if (!fileName.endsWith(FileExtensionType.PNG.value)) {
throw CoreApiException(ErrorType.NO_PNG_FILE_ERROR)
}

return fileName
}
}
Loading
Loading