Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/refactor/#82-multi_module' into …
Browse files Browse the repository at this point in the history
…refactor/#82-multi_module_api
  • Loading branch information
ddongseop committed Aug 8, 2023
2 parents a863c51 + 4daac0d commit bdd468d
Show file tree
Hide file tree
Showing 13 changed files with 143 additions and 79 deletions.
42 changes: 0 additions & 42 deletions umbba-notification/.gitignore

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sopt.org.umbba.global.config;
package sopt.org.umbba.notification.config.fcm;

import com.google.auth.oauth2.GoogleCredentials;
import com.google.firebase.FirebaseApp;
Expand All @@ -9,9 +9,9 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import sopt.org.umbba.global.exception.CustomException;
import sopt.org.umbba.global.exception.ErrorType;
import sopt.org.umbba.global.util.fcm.controller.dto.FCMPushRequestDto;
import sopt.org.umbba.common.exception.ErrorType;
import sopt.org.umbba.common.exception.model.CustomException;
import sopt.org.umbba.notification.controller.fcm.dto.FCMPushRequestDto;

import javax.annotation.PostConstruct;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package sopt.org.umbba.global.config;
package sopt.org.umbba.notification.config.scheduler;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import sopt.org.umbba.global.util.fcm.FCMService;
import sopt.org.umbba.notification.service.fcm.FCMService;

import java.util.concurrent.ThreadPoolExecutor;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package sopt.org.umbba.notification.config.sqs;

import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.sqs.AmazonSQSAsync;
import com.amazonaws.services.sqs.AmazonSQSAsyncClient;
import com.amazonaws.services.sqs.AmazonSQSAsyncClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
public class SqsConfig {

@Value("${cloud.aws.credentials.accessKey}")
private String AWS_ACCESS_KEY;

@Value("${cloud.aws.credentials.secretKey}")
private String AWS_SECRET_KEY;

@Value("${cloud.aws.region.static}")
private String AWS_REGION;

@Primary
@Bean
public AmazonSQSAsync amazonSQSAsync() {
BasicAWSCredentials basicAWSCredentials = new BasicAWSCredentials(AWS_ACCESS_KEY, AWS_SECRET_KEY);
return AmazonSQSAsyncClientBuilder.standard()
.withRegion(AWS_REGION)
.withCredentials(new AWSStaticCredentialsProvider(basicAWSCredentials))
.build();
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package sopt.org.umbba.global.util.fcm.controller;
package sopt.org.umbba.notification.controller.fcm;

import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import sopt.org.umbba.global.common.dto.ApiResponse;
import sopt.org.umbba.global.config.jwt.JwtProvider;
import sopt.org.umbba.global.exception.SuccessType;
import sopt.org.umbba.global.util.fcm.FCMScheduler;
import sopt.org.umbba.global.util.fcm.FCMService;
import sopt.org.umbba.global.util.fcm.controller.dto.FCMPushRequestDto;
import sopt.org.umbba.common.exception.SuccessType;
import sopt.org.umbba.common.exception.dto.ApiResponse;
import sopt.org.umbba.notification.controller.fcm.dto.FCMPushRequestDto;
import sopt.org.umbba.notification.service.fcm.FCMService;
import sopt.org.umbba.notification.service.scheduler.FCMScheduler;

import java.io.IOException;
import java.security.Principal;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sopt.org.umbba.global.util.fcm.controller.dto;
package sopt.org.umbba.notification.controller.fcm.dto;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sopt.org.umbba.global.util.fcm.controller.dto;
package sopt.org.umbba.notification.controller.fcm.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sopt.org.umbba.global.util.fcm.controller.dto;
package sopt.org.umbba.notification.controller.fcm.dto;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package sopt.org.umbba.global.util.slack;
package sopt.org.umbba.notification.controller.slack;

import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import sopt.org.umbba.global.common.dto.ApiResponse;
import sopt.org.umbba.common.exception.dto.ApiResponse;

@Slf4j
@RestController
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sopt.org.umbba.global.util.fcm;
package sopt.org.umbba.notification.service.fcm;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand All @@ -19,17 +19,16 @@
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.DefaultTransactionDefinition;
import sopt.org.umbba.domain.parentchild.dao.ParentchildDao;
import sopt.org.umbba.domain.parentchild.model.Parentchild;
import sopt.org.umbba.domain.parentchild.repository.ParentchildRepository;
import sopt.org.umbba.domain.qna.model.QnA;
import sopt.org.umbba.domain.user.model.User;
import sopt.org.umbba.domain.user.repository.UserRepository;
import sopt.org.umbba.domain.user.social.SocialPlatform;
import sopt.org.umbba.global.exception.CustomException;
import sopt.org.umbba.global.exception.ErrorType;
import sopt.org.umbba.global.util.fcm.controller.dto.FCMMessage;
import sopt.org.umbba.global.util.fcm.controller.dto.FCMPushRequestDto;
import sopt.org.umbba.common.exception.ErrorType;
import sopt.org.umbba.common.exception.model.CustomException;
import sopt.org.umbba.domain.domain.parentchild.Parentchild;
import sopt.org.umbba.domain.domain.parentchild.repository.ParentchildRepository;
import sopt.org.umbba.domain.domain.qna.QnA;
import sopt.org.umbba.domain.domain.user.SocialPlatform;
import sopt.org.umbba.domain.domain.user.User;
import sopt.org.umbba.domain.domain.user.repository.UserRepository;
import sopt.org.umbba.notification.controller.fcm.dto.FCMMessage;
import sopt.org.umbba.notification.controller.fcm.dto.FCMPushRequestDto;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package sopt.org.umbba.global.util.fcm;
package sopt.org.umbba.notification.service.scheduler;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import sopt.org.umbba.domain.parentchild.dao.ParentchildDao;
import sopt.org.umbba.domain.parentchild.repository.ParentchildRepository;
import sopt.org.umbba.domain.user.model.User;
import sopt.org.umbba.domain.user.repository.UserRepository;
import sopt.org.umbba.domain.user.social.SocialPlatform;

import sopt.org.umbba.domain.domain.parentchild.repository.ParentchildRepository;
import sopt.org.umbba.domain.domain.user.SocialPlatform;
import sopt.org.umbba.domain.domain.user.User;
import sopt.org.umbba.domain.domain.user.repository.UserRepository;
import sopt.org.umbba.notification.service.fcm.FCMService;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sopt.org.umbba.global.util.slack;
package sopt.org.umbba.notification.service.slack;

import com.slack.api.Slack;
import com.slack.api.model.block.Blocks;
Expand Down
73 changes: 73 additions & 0 deletions umbba-notification/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
cloud:
aws:
credentials:
accessKey: ${cloud-access}
secretKey: ${cloud-secret}
region:
static: ${cloud-region}
s3:
bucket: ${bucket-name}
stack:
auto: false
sqs:
notification:
name: ${AWS_SQS_NOTIFICATION_NAME_DEV}
url: ${AWS_SQS_NOTIFICATION_URL_DEV}
api:
name: ${AWS_SQS_API_NAME_DEV}
url: ${AWS_SQS_API_URL_DEV}


spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: ${db-url}
username: ${db-user}
password: ${db-pwd}
jpa:
show-sql: false
hibernate:
ddl-auto: update
ejb:
naming_strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy
properties:
hibernate:
format_sql: false

kakao:
client-id: ${kakao-id}
authorization-grant-type: authorization_code
redirect-uri: ${kakao-redirect}

apple:
iss: ${apple-iss}
client-id: ${apple-id}
# nonce: ${apple-nonce}

jwt:
secret: ${jwt-secret}

slack:
webhook:
url: ${slack-url}

fcm:
key:
path: ${fcm-json-path}
scope: ${fcm-scope}
# firebase-create-scoped: "https://www.googleapis.com/auth/firebase.messaging"
api:
url: ${fcm-api-url}
topic:
"qna_notification"

logging:
level:
org:
hibernate:
type:
descriptor:
sql: debug

server:
port: 9091

0 comments on commit bdd468d

Please sign in to comment.