Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@
import com.permitseoul.permitserver.global.response.BaseResponse;
import com.permitseoul.permitserver.global.response.code.SuccessCode;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.net.URLDecoder;

@RestController
@RequestMapping("/api/admin")
@RequiredArgsConstructor
@Validated
public class AdminController {
private final AdminService adminService;
private final S3Service s3Service;
Expand All @@ -41,9 +47,12 @@ public ResponseEntity<BaseResponse<?>> getUploadImagesUrl(
//유저 권한 정보 조회 API
@GetMapping("/users")
public ResponseEntity<BaseResponse<?>> getUserAuthority(
@RequestBody @Valid final UserAuthorityGetRequest request
@RequestParam("email")
@NotBlank(message = "email은 필수입니다.")
@Email(message = "email 형식이 올바르지 않습니다.")
final String email
){
return ApiResponseUtil.success(SuccessCode.OK, adminService.getUserAuthority(request.email()));
return ApiResponseUtil.success(SuccessCode.OK, adminService.getUserAuthority(email));
}

//유저 권한 변경 API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class CookieCreatorUtil {
private static final long COOKIE_MAX_AGE = 2L * 60; // 24L * 60 * 60; //1일 (refresh Token 이랑 같음)
private static final long RESERVED_MAX_AGE = 10L * 60; // 10분(10분간 선점 가능)
private static final long COOKIE_MAX_AGE = 2L * 60; //7L * 24 * 60 * 60; //일주일
private static final long RESERVED_MAX_AGE = 7L * 60; // 7분(7분간 선점 가능)

public static ResponseCookie createReservationSessionCookie(final String sessionKey) {
return ResponseCookie.from(Constants.RESERVATION_SESSION_KEY, sessionKey)
Expand Down