Skip to content

Commit

Permalink
Merge branch 'main' into event/170
Browse files Browse the repository at this point in the history
  • Loading branch information
KarmaPol authored Jan 9, 2024
2 parents 9e58fcc + ee033f8 commit ca7ca6b
Show file tree
Hide file tree
Showing 32 changed files with 137 additions and 219 deletions.
4 changes: 0 additions & 4 deletions api/api-booking/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,4 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-security'

implementation 'io.jsonwebtoken:jjwt-api:0.12.3'
implementation 'io.jsonwebtoken:jjwt-impl:0.12.3'
implementation 'io.jsonwebtoken:jjwt-jackson:0.12.3'
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.pgms.apibooking.common.exception;

import com.pgms.coredomain.domain.common.BookingErrorCode;

import lombok.Getter;

@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;

import com.pgms.coredomain.domain.common.BookingErrorCode;
import com.pgms.coredomain.response.ErrorResponse;

import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import com.pgms.apibooking.common.exception.BookingErrorCode;
import com.pgms.coredomain.domain.common.BookingErrorCode;
import com.pgms.apibooking.common.exception.BookingException;

import jakarta.servlet.http.HttpServletRequest;
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.pgms.apibooking.common.exception.BookingErrorCode;
import com.pgms.coredomain.domain.common.BookingErrorCode;
import com.pgms.apibooking.common.exception.BookingException;
import com.pgms.apibooking.common.jwt.BookingAuthToken;
import com.pgms.coresecurity.security.jwt.booking.BookingAuthToken;
import com.pgms.apibooking.config.TossPaymentConfig;
import com.pgms.apibooking.domain.booking.dto.request.BookingCancelRequest;
import com.pgms.apibooking.domain.booking.dto.request.BookingCreateRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

import org.springframework.stereotype.Service;

import com.pgms.apibooking.common.exception.BookingErrorCode;
import com.pgms.coredomain.domain.common.BookingErrorCode;
import com.pgms.apibooking.common.exception.BookingException;
import com.pgms.apibooking.common.jwt.BookingJwtPayload;
import com.pgms.apibooking.common.jwt.BookingJwtProvider;
import com.pgms.coresecurity.security.jwt.booking.BookingJwtPayload;
import com.pgms.coresecurity.security.jwt.booking.BookingJwtProvider;
import com.pgms.apibooking.domain.bookingqueue.dto.request.BookingQueueEnterRequest;
import com.pgms.apibooking.domain.bookingqueue.dto.request.BookingQueueExitRequest;
import com.pgms.apibooking.domain.bookingqueue.dto.request.TokenIssueRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.pgms.apibooking.domain.payment.dto.response.PaymentCardResponse;
import com.pgms.apibooking.domain.payment.dto.response.PaymentFailResponse;
import com.pgms.apibooking.domain.payment.dto.response.PaymentVirtualResponse;
import com.pgms.apibooking.common.exception.BookingErrorCode;
import com.pgms.coredomain.domain.common.BookingErrorCode;
import com.pgms.apibooking.common.exception.BookingException;
import com.pgms.apibooking.common.util.DateTimeUtil;
import com.pgms.coredomain.domain.booking.Booking;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import com.pgms.apibooking.domain.payment.dto.request.PaymentConfirmRequest;
import com.pgms.apibooking.domain.payment.dto.response.PaymentCancelResponse;
import com.pgms.apibooking.domain.payment.dto.response.PaymentSuccessResponse;
import com.pgms.apibooking.common.exception.BookingErrorCode;
import com.pgms.coredomain.domain.common.BookingErrorCode;
import com.pgms.apibooking.common.exception.BookingException;

import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import com.pgms.apibooking.domain.seat.dto.request.SeatsGetRequest;
import com.pgms.apibooking.domain.seat.dto.response.AreaResponse;
import com.pgms.apibooking.common.exception.BookingErrorCode;
import com.pgms.coredomain.domain.common.BookingErrorCode;
import com.pgms.apibooking.common.exception.BookingException;
import com.pgms.coredomain.domain.event.EventSeat;
import com.pgms.coredomain.domain.event.EventSeatStatus;
Expand Down
7 changes: 1 addition & 6 deletions api/api-booking/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ spring:
payment:
toss:
test-client-api-key: test_ck_Gv6LjeKD8aE1pdWDXXNw8wYxAdXy
test-secret-api-key: test_sk_eqRGgYO1r5MNel9067jarQnN2Eya # 노출되면 안됨!! 임시값 넣어놓음
test-secret-api-key: test # 노출되면 안됨!! 임시값 넣어놓음
success-url: https://localhost:8080/api/v1/success
fail-url: https://localhost:8080/api/v1/fail

booking-jwt:
issuer: booking
secret-key: EENY5W0eegTf1naQB2eDeyCLl5kRS2b8xa5c4qLdS0hmVjtbvo8tOyhPMcAmtPu
expiry-seconds: 420
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import com.pgms.apibooking.domain.payment.dto.response.PaymentSuccessResponse;
import com.pgms.apibooking.domain.payment.dto.response.PaymentVirtualResponse;
import com.pgms.apibooking.domain.payment.dto.response.RefundAccountResponse;
import com.pgms.apibooking.common.exception.BookingErrorCode;
import com.pgms.coredomain.domain.common.BookingErrorCode;
import com.pgms.apibooking.common.exception.BookingException;
import com.pgms.apibooking.domain.payment.service.TossPaymentService;
import com.pgms.coredomain.domain.booking.Booking;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.springframework.context.annotation.Import;
import org.springframework.transaction.annotation.Transactional;

import com.pgms.apibooking.common.exception.BookingErrorCode;
import com.pgms.coredomain.domain.common.BookingErrorCode;
import com.pgms.apibooking.common.exception.BookingException;
import com.pgms.apibooking.config.TestConfig;
import com.pgms.apibooking.domain.booking.dto.request.BookingCancelRequest;
Expand Down
5 changes: 1 addition & 4 deletions api/api-member/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'

runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'


// security
implementation 'org.springframework.boot:spring-boot-starter-security'
}
49 changes: 38 additions & 11 deletions api/api-member/http/test.http
Original file line number Diff line number Diff line change
@@ -1,28 +1,51 @@
@token = eyJhbGciOiJIUzI1NiJ9.eyJpZCI6Mywic3ViIjoiZGh4bDUwQG5hdmVyLmNvbSIsImlhdCI6MTcwNDYxNjU4NSwiZXhwIjoyMDY0NjE2NTg1LCJhdXRob3JpdHkiOiJST0xFX1VTRVIifQ.OIiQazdvmv-bsZp0VroiouW5gEqNAj7ROqRTOcLbWXQ
@adminToken = eyJhbGciOiJIUzI1NiJ9.eyJpZCI6Miwic3ViIjoiYWRtaW5AZXhhbXBsZS5jb20iLCJpYXQiOjE3MDQ2Mzc1NzgsImV4cCI6MjA2NDYzNzU3OCwiYXV0aG9yaXR5IjoiUk9MRV9BRE1JTiJ9.lAXg2NbcVeuSak6IW-AUNKC6zqd_0x_ER8RU3CMxNpk

### 토큰 갱신
POST http://localhost:8081/api/v1/auth/refresh
## AUTH

### 로그인 - 슈퍼 관리자
POST http://localhost:8081/api/v1/auth/admin/login
Content-Type: application/json

{
"refreshToken": "a718e554-fad4-48c2-a131-d73228937605"
"email": "[email protected]",
"password": "user1234"
}

### 로그인 - 슈퍼 관리자
### 로그인 - 관리자
POST http://localhost:8081/api/v1/auth/admin/login
Content-Type: application/json

{
"email": "superadmin@example.com",
"email": "admin@example.com",
"password": "user1234"
}

### 멤버 로그인
POST http://localhost:8081/api/v1/auth/members/login
Content-Type: application/json

{
"email": "[email protected]",
"password": "user1234"
}

### 토큰 갱신
POST http://localhost:8081/api/v1/auth/refresh
Content-Type: application/json

{
"refreshToken": "{{refreshToken}}"
}

===

## ADMIN MANAGEMENT

### 관리자 등록 - 슈퍼 관리자
POST http://localhost:8081/api/v1/admin/management
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwic3ViIjoic3VwZXJhZG1pbkBleGFtcGxlLmNvbSIsImlhdCI6MTcwNDY0MzY2MSwiZXhwIjoxNzA0NjQ1NDYxLCJhdXRob3JpdHkiOiJST0xFX1NVUEVSQURNSU4ifQ.CGgjH4e4FTvz8s-adQBd2S6T5N8Uo9YLfht3LIkE0Js
Authorization: Bearer {{superAdminToken}}

{
"name": "testAdmin",
Expand All @@ -35,12 +58,12 @@ Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwic3ViIjoic3VwZXJhZG1pbkBle

### 관리자 목록 조회 - 슈퍼 관리자
GET http://localhost:8081/api/v1/admin/management
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwic3ViIjoic3VwZXJhZG1pbkBleGFtcGxlLmNvbSIsImlhdCI6MTcwNDY0MzY2MSwiZXhwIjoxNzA0NjQ1NDYxLCJhdXRob3JpdHkiOiJST0xFX1NVUEVSQURNSU4ifQ.CGgjH4e4FTvz8s-adQBd2S6T5N8Uo9YLfht3LIkE0Js
Authorization: Bearer {{superAdminToken}}

### 관리자 수정 - 슈퍼 관리자
PATCH http://localhost:8081/api/v1/admin/management/1
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwic3ViIjoic3VwZXJhZG1pbkBleGFtcGxlLmNvbSIsImlhdCI6MTcwNDY0MzY2MSwiZXhwIjoxNzA0NjQ1NDYxLCJhdXRob3JpdHkiOiJST0xFX1NVUEVSQURNSU4ifQ.CGgjH4e4FTvz8s-adQBd2S6T5N8Uo9YLfht3LIkE0Js
Authorization: Bearer {{superAdminToken}}

{
"name": "",
Expand All @@ -53,9 +76,11 @@ Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwic3ViIjoic3VwZXJhZG1pbkBle

### 관리자 삭제 - 슈퍼 관리자
DELETE http://localhost:8081/api/v1/admin/management?adminIds=1
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwic3ViIjoic3VwZXJhZG1pbkBleGFtcGxlLmNvbSIsImlhdCI6MTcwNDY0MzY2MSwiZXhwIjoxNzA0NjQ1NDYxLCJhdXRob3JpdHkiOiJST0xFX1NVUEVSQURNSU4ifQ.CGgjH4e4FTvz8s-adQBd2S6T5N8Uo9YLfht3LIkE0Js
Authorization: Bearer {{superAdminToken}}

===

######
## ADMIN

### 로그인 - 관리자
POST http://localhost:8081/api/v1/auth/admin/login
Expand All @@ -82,7 +107,9 @@ Authorization: Bearer {{adminToken}}
GET http://localhost:8081/api/v1/admin/members/details?memberIds=1,2
Authorization: Bearer {{adminToken}}

#######
===

## MEMBER

### 멤버 일반 회원가입
POST http://localhost:8081/api/v1/members/signup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
@RequiredArgsConstructor
public class MemberService {

// TODO: role의 기본값을 어떻게 할 지 논의해봐야함
private static final String DEFAULT_ROLE_NAME = "ROLE_USER";

private final MemberRepository memberRepository;
private final PasswordEncoder passwordEncoder;

Expand Down
7 changes: 0 additions & 7 deletions api/api-member/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ server:
properties:
hibernate.format_sql: true

# H2
datasource:
url: jdbc:h2:mem:devdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
username: sa
password:
driver-class-name: org.h2.Driver

logging:
level:
org:
Expand Down
Loading

0 comments on commit ca7ca6b

Please sign in to comment.