Skip to content

Commit

Permalink
Merge pull request #49 from AmorGakCo/hotfix/#48
Browse files Browse the repository at this point in the history
Hotfix/#48
  • Loading branch information
songhaechan authored Sep 24, 2024
2 parents 690388c + 1dadadc commit 2f1ce35
Show file tree
Hide file tree
Showing 137 changed files with 951 additions and 434 deletions.
1 change: 1 addition & 0 deletions .github/workflows/amorgakco-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
cd Backend
git pull
sudo docker-compose down
sudo docker images prune
sudo docker-compose up -d --build
11 changes: 10 additions & 1 deletion .github/workflows/amorgakco-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
- main

permissions: write-all

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -15,6 +14,16 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
- name: Apply Environment Variables
run: |
echo "${{ secrets.APPLICATION_JWT }}" > ./src/test/resources/application-jwt.yml
echo "${{ secrets.APPLICATION_OAUTH2 }}" > ./src/test/resources/application-oauth2.yml
echo "${{ secrets.FCM_SECRET }}" | base64 -d > ./src/test/resources/fcm-secret.json
echo "${{ secrets.APPLICATION_NOTIFICATION }}" > ./src/test/resources/application-notification.yml
echo "${{ secrets.APPLICATION_JWT }}" > ./src/main/resources/application-jwt.yml
echo "${{ secrets.FCM_SECRET }}" | base64 -d > ./src/test/resources/fcm-secret.json
echo "${{ secrets.APPLICATION_OAUTH2 }}" > ./src/main/resources/application-oauth2.yml
echo "${{ secrets.APPLICATION_NOTIFICATION }}" > ./src/main/resources/application-notification.yml
- run: chmod +x gradlew
- run: ./gradlew build
- name: 테스트 커버리지를 PR에 코멘트에 등록
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ src/main/resources/application-oauth2local.yml
src/main/resources/application-jwt.yml
src/main/resources/application-notification.yml
src/main/resources/fcm-secret.json
src/test/resources/fcm-secret.json
src/test/resources/application-jwt.yml
src/test/resources/application-oauth2.yml
src/test/resources/application-notification.yml

docker/
.docker-conf/

Expand Down
7 changes: 7 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-amqp'
implementation 'com.google.firebase:firebase-admin:9.3.0'
implementation 'com.google.geometry:s2-geometry:2.0.0'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation'
runtimeOnly 'com.h2database:h2'
implementation 'org.redisson:redisson-spring-boot-starter:3.18.0'
testImplementation "org.junit.jupiter:junit-jupiter:5.8.1"
testImplementation "org.testcontainers:junit-jupiter:1.16.3"
testImplementation "com.redis:testcontainers-redis:2.0.1"
testImplementation "org.testcontainers:mysql:1.17.2"
}

tasks.named('test') {
Expand Down
50 changes: 25 additions & 25 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,9 @@ <h4 id="_그룹_등록_http_request"><a class="link" href="#_그룹_등록_http_
{
"name" : "AmorGakCo",
"description" : "모각코 합시다.",
"groupCapacity" : 3,
"beginAt" : "2024-09-04T16:57:22.301368",
"endAt" : "2024-09-04T19:57:22.301368",
"groupCapacity" : 4,
"beginAt" : "2024-09-22T16:36:39.843631",
"endAt" : "2024-09-22T19:36:39.843631",
"latitude" : 37.5703901,
"longitude" : 126.9748397,
"address" : "서울특별시 종로구 신문로1가 23"
Expand Down Expand Up @@ -604,9 +604,9 @@ <h4 id="_그룹_단건_조회_모달창용_http_response"><a class="link" href="
"data" : {
"hostNickname" : "아모르겠고",
"hostImgUrl" : "https://fakeimg",
"beginAt" : "2024-09-04T16:57:22.149485",
"endAt" : "2024-09-04T19:57:22.149489",
"groupCapacity" : 3,
"beginAt" : "2024-09-22T16:36:39.743266",
"endAt" : "2024-09-22T19:36:39.743272",
"groupCapacity" : 4,
"currentParticipants" : 3,
"address" : "서울특별시 종로구 신문로1가 23"
}
Expand Down Expand Up @@ -697,8 +697,8 @@ <h4 id="_그룹_단건_조회_상세페이지용_http_response"><a class="link"
"address" : "서울특별시 종로구 신문로1가 23",
"longitude" : 126.9748397,
"latitude" : 37.5703901,
"beginAt" : "2024-09-04T16:57:22.149485",
"endAt" : "2024-09-04T19:57:22.149489",
"beginAt" : "2024-09-22T16:36:39.743266",
"endAt" : "2024-09-22T19:36:39.743272",
"groupMembers" : [ {
"memberId" : 2,
"imgUrl" : "https://fakeimg",
Expand Down Expand Up @@ -1085,7 +1085,7 @@ <h4 id="_참여자의_모각코_참여_내역_http_response"><a class="link" hre
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 1483
Content-Length: 1489

{
"status" : "success",
Expand All @@ -1098,39 +1098,39 @@ <h4 id="_참여자의_모각코_참여_내역_http_response"><a class="link" hre
"groupId" : 4,
"name" : "AmorGakCo",
"address" : "서울특별시 종로구 신문로1가 23",
"beginAt" : "2024-09-04T16:57:24.40491",
"endAt" : "2024-09-04T19:57:24.404916"
"beginAt" : "2024-09-22T16:36:41.721794",
"endAt" : "2024-09-22T19:36:41.721804"
}, {
"groupId" : 5,
"name" : "AmorGakCo",
"address" : "서울특별시 종로구 신문로1가 23",
"beginAt" : "2024-09-04T16:57:24.40491",
"endAt" : "2024-09-04T19:57:24.404916"
"beginAt" : "2024-09-22T16:36:41.721794",
"endAt" : "2024-09-22T19:36:41.721804"
}, {
"groupId" : 6,
"name" : "AmorGakCo",
"address" : "서울특별시 종로구 신문로1가 23",
"beginAt" : "2024-09-04T16:57:24.40491",
"endAt" : "2024-09-04T19:57:24.404916"
"beginAt" : "2024-09-22T16:36:41.721794",
"endAt" : "2024-09-22T19:36:41.721804"
} ],
"InactivatedGroup" : [ {
"groupId" : 1,
"name" : "AmorGakCo",
"address" : "서울특별시 종로구 신문로1가 23",
"beginAt" : "2024-09-04T16:57:24.40491",
"endAt" : "2024-09-04T19:57:24.404916"
"beginAt" : "2024-09-22T16:36:41.721794",
"endAt" : "2024-09-22T19:36:41.721804"
}, {
"groupId" : 2,
"name" : "AmorGakCo",
"address" : "서울특별시 종로구 신문로1가 23",
"beginAt" : "2024-09-04T16:57:24.40491",
"endAt" : "2024-09-04T19:57:24.404916"
"beginAt" : "2024-09-22T16:36:41.721794",
"endAt" : "2024-09-22T19:36:41.721804"
}, {
"groupId" : 3,
"name" : "AmorGakCo",
"address" : "서울특별시 종로구 신문로1가 23",
"beginAt" : "2024-09-04T16:57:24.40491",
"endAt" : "2024-09-04T19:57:24.404916"
"beginAt" : "2024-09-22T16:36:41.721794",
"endAt" : "2024-09-22T19:36:41.721804"
} ]
}
}</code></pre>
Expand Down Expand Up @@ -1370,7 +1370,7 @@ <h4 id="_알림_내역_조회_http_response"><a class="link" href="#_알림_내
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 551
Content-Length: 575

{
"status" : "success",
Expand All @@ -1381,13 +1381,13 @@ <h4 id="_알림_내역_조회_http_response"><a class="link" href="#_알림_내
"hasNext" : false,
"notificationMessages" : [ {
"title" : "참여 요청",
"content" : "아모르겠고 님께서 모각코에 참여하길 원합니다."
"content" : "아모르겠고 님께서 mogakco 모각코에 참여하길 원합니다."
}, {
"title" : "참여 요청",
"content" : "아모르겠고 님께서 모각코에 참여하길 원합니다."
"content" : "아모르겠고 님께서 mogakco 모각코에 참여하길 원합니다."
}, {
"title" : "참여 요청",
"content" : "아모르겠고 님께서 모각코에 참여하길 원합니다."
"content" : "아모르겠고 님께서 mogakco 모각코에 참여하길 원합니다."
} ]
}
}</code></pre>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/amorgakco/backend/global/BaseTime.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import jakarta.persistence.Column;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.MappedSuperclass;

import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
Expand All @@ -18,5 +17,6 @@ public abstract class BaseTime {
@Column(updatable = false)
private LocalDateTime createdAt;

@LastModifiedDate private LocalDateTime modifiedAt;
@LastModifiedDate
private LocalDateTime modifiedAt;
}
3 changes: 2 additions & 1 deletion src/main/java/com/amorgakco/backend/global/IdResponse.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package com.amorgakco.backend.global;

public record IdResponse(Long id) {}
public record IdResponse(Long id) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@

@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface AuthMember {}
public @interface AuthMember {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import com.amorgakco.backend.global.oauth.MemberPrincipal;
import com.amorgakco.backend.member.domain.Member;
import com.amorgakco.backend.member.service.MemberService;

import lombok.RequiredArgsConstructor;

import org.springframework.core.MethodParameter;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@

@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface AuthMemberId {}
public @interface AuthMemberId {
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.amorgakco.backend.global.argumentresolver;

import com.amorgakco.backend.global.oauth.MemberPrincipal;

import org.springframework.core.MethodParameter;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.amorgakco.backend.global.config;

import com.amorgakco.backend.oauth2.converter.Oauth2ProviderConverter;

import lombok.RequiredArgsConstructor;

import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import net.nurigo.sdk.NurigoApp;
import net.nurigo.sdk.message.service.DefaultMessageService;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.amorgakco.backend.global.config;

import com.google.common.net.HttpHeaders;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.amorgakco.backend.global.config;

import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;

public class CustomSpringELParser {
public static Object getDynamicValue(String[] parameterNames, Object[] args, String key) {
ExpressionParser parser = new SpelExpressionParser();
StandardEvaluationContext context = new StandardEvaluationContext();

for (int i = 0; i < parameterNames.length; i++) {
context.setVariable(parameterNames[i], args[i]);
}

return parser.parseExpression(key).getValue(context, Object.class);
}

private CustomSpringELParser() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
import com.google.auth.oauth2.GoogleCredentials;
import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Component;

import java.io.IOException;

import javax.annotation.PostConstruct;
import java.io.IOException;

@Component
public class FcmInitializer {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import com.amorgakco.backend.global.argumentresolver.AuthMemberArgumentResolver;
import com.amorgakco.backend.global.argumentresolver.AuthMemberIdArgumentResolver;

import lombok.RequiredArgsConstructor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package com.amorgakco.backend.global.config;

public record KakaoRedirectionLoginUrl(String redirectionUrl) {}
public record KakaoRedirectionLoginUrl(String redirectionUrl) {
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.amorgakco.backend.global.config;

import com.amorgakco.backend.oauth2.provider.kakao.KakaoOauth2Properties;

import lombok.RequiredArgsConstructor;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.util.UriComponentsBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
import com.amorgakco.backend.global.rabbitmq.QueueName;
import com.amorgakco.backend.global.rabbitmq.RabbitMQProperties;
import com.amorgakco.backend.global.rabbitmq.RoutingKey;

import lombok.RequiredArgsConstructor;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
Expand All @@ -20,10 +18,12 @@
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

@EnableRabbit
@Configuration
@RequiredArgsConstructor
@Profile("!test")
public class RabbitMQConfig {

private final RabbitMQProperties properties;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.amorgakco.backend.global.config;

import com.amorgakco.backend.oauth2.provider.kakao.KakaoRestClient;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestClient;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package com.amorgakco.backend.global.config;

import io.jsonwebtoken.security.Keys;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.nio.charset.StandardCharsets;

import javax.crypto.SecretKey;
import java.nio.charset.StandardCharsets;

@Configuration
public class SecretKeyConfig {
Expand Down
Loading

0 comments on commit 2f1ce35

Please sign in to comment.