-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
77 changed files
with
1,361 additions
and
694 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Spotless Check | ||
on: [ pull_request ] | ||
|
||
jobs: | ||
spotless: | ||
name: Spotless Check | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Clone repo with submodules | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
submodules: true # 서브모듈도 함께 체크아웃 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
|
||
- name: Cache Gradle dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Run Spotless | ||
run: ./gradlew spotlessCheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
# implementation: team3-rdParty pre-commit and pre-push hook installer | ||
# This script is based on a LGPL 3.0 licensed script. | ||
# | ||
# Original Script Copyright (C) 2023 Original Author | ||
# Modifications Copyright (C) 2024 mirageoasis | ||
# | ||
# This script is modified under the same license, the GNU Lesser General Public License v3.0. | ||
|
||
install_git_hooks() { | ||
local magic_str_commit="team3-rdParty standard pre-commit hook" | ||
local magic_str_push="team3-rdParty standard pre-push hook" | ||
|
||
# pre-commit hook 설정 | ||
if [ -f .git/hooks/pre-commit ]; then | ||
grep -Fq "$magic_str_commit" .git/hooks/pre-commit | ||
if [ $? -eq 0 ]; then | ||
: | ||
else | ||
echo "" >> .git/hooks/pre-commit | ||
cat scripts/pre-commit.sh >> .git/hooks/pre-commit | ||
fi | ||
else | ||
cp scripts/pre-commit.sh .git/hooks/pre-commit | ||
chmod +x .git/hooks/pre-commit | ||
fi | ||
|
||
# pre-push hook 설정 | ||
if [ -f .git/hooks/pre-push ]; then | ||
grep -Fq "$magic_str_push" .git/hooks/pre-push | ||
if [ $? -eq 0 ]; then | ||
: | ||
else | ||
echo "" >> .git/hooks/pre-push | ||
cat scripts/pre-push.sh >> .git/hooks/pre-push | ||
fi | ||
else | ||
cp scripts/pre-push.sh .git/hooks/pre-push | ||
chmod +x .git/hooks/pre-push | ||
fi | ||
} | ||
|
||
install_git_hooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
# implementation: team3-rdParty pre-push hook | ||
# This script is based on a LGPL 3.0 licensed script. | ||
# | ||
# Original Script Copyright (C) 2023 Lablup Inc. | ||
# Modifications Copyright (C) 2024 mirageoasis | ||
# | ||
# This script is modified under the same license, the GNU Lesser General Public License v3.0. | ||
|
||
# backend.ai monorepo standard pre-commit hook | ||
BASE_PATH=$(cd "$(dirname "$0")"/../.. && pwd) | ||
${BASE_PATH}/scripts/pre-commit.sh "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
# implementation: team3-rdParty pre-push hook | ||
# This script is based on a LGPL 3.0 licensed script. | ||
# | ||
# Original Script Copyright (C) 2023 Lablup Inc. | ||
# Modifications Copyright (C) 2024 mirageoasis | ||
# | ||
# This script is modified under the same license, the GNU Lesser General Public License v3.0. | ||
|
||
BASE_PATH=$(cd "$(dirname "$0")"/.. && pwd) | ||
echo "Performing lint for changed files ..." | ||
|
||
# Gradle을 사용하여 spotlessCheck 검사 수행 | ||
./gradlew spotlessCheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
# implementation: team3-rdParty pre-push hook | ||
# This script is based on a LGPL 3.0 licensed script. | ||
# | ||
# Original Script Copyright (C) 2023 Lablup Inc. | ||
# Modifications Copyright (C) 2024 mirageoais | ||
# | ||
# This script is modified under the same license, the GNU Lesser General Public License v3.0. | ||
|
||
# team3-rdParty pre-push hook | ||
BASE_PATH=$(cd "$(dirname "$0")"/../.. && pwd) | ||
${BASE_PATH}/scripts/pre-push.sh "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
# implementation: team3-rdParty pre-push hook | ||
# This script is based on a LGPL 3.0 licensed script. | ||
# | ||
# Original Script Copyright (C) 2023 Lablup Inc. | ||
# Modifications Copyright (C) 2024 mirageoasis | ||
# | ||
# This script is modified under the same license, the GNU Lesser General Public License v3.0. | ||
|
||
BASE_PATH=$(cd "$(dirname "$0")"/.. && pwd) | ||
|
||
CURRENT_COMMIT=$(git rev-parse --short HEAD) | ||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
if [ -n "$(echo "$CURRENT_BRANCH" | sed -n '/^[[:digit:]]\{1,\}\.[[:digit:]]\{1,\}/p')" ]; then | ||
# if we are on the release branch, use it as the base branch. | ||
BASE_BRANCH="$CURRENT_BRANCH" | ||
else | ||
BASE_BRANCH="main" | ||
fi | ||
if [ "$1" != "origin" ]; then | ||
# extract the owner name of the target repo | ||
ORIGIN="$(echo "$1" | grep -o '://[^/]\+/[^/]\+/' | grep -o '/[^/]\+/$' | tr -d '/')" | ||
cleanup_remote() { | ||
git remote remove "$ORIGIN" | ||
} | ||
trap cleanup_remote EXIT | ||
git remote add "$ORIGIN" "$1" | ||
git fetch -q --depth=1 --no-tags "$ORIGIN" "$BASE_BRANCH" | ||
else | ||
ORIGIN="origin" | ||
fi | ||
echo "Performing lint and check on ${ORIGIN}/${BASE_BRANCH}..HEAD@${CURRENT_COMMIT} ..." | ||
|
||
# Gradle을 사용하여 spotlessCheck 검사 수행 | ||
./gradlew spotlessCheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/java/com/thirdparty/ticketing/domain/ItemResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/java/com/thirdparty/ticketing/domain/member/controller/MemberController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.thirdparty.ticketing.domain.member.controller; | ||
|
||
import jakarta.validation.Valid; | ||
|
||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.thirdparty.ticketing.domain.member.controller.request.MemberCreationRequest; | ||
import com.thirdparty.ticketing.domain.member.service.MemberService; | ||
import com.thirdparty.ticketing.domain.member.service.response.CreateMemberResponse; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/members") | ||
public class MemberController { | ||
|
||
private final MemberService memberService; | ||
|
||
@PostMapping | ||
public ResponseEntity<CreateMemberResponse> createMember( | ||
@RequestBody @Valid MemberCreationRequest request) { | ||
CreateMemberResponse response = memberService.createMember(request); | ||
return ResponseEntity.status(HttpStatus.CREATED).body(response); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.