Skip to content
Merged
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 @@ -16,57 +16,6 @@
public class UserServiceV2 {

private final UserRepositoryV2 userRepositoryV2;
private final RedisTemplate<String, Object> redisTemplate;

// // 사용자 등록 여부 확인
// public int getUserCampusId(String userId) {
// // redis에서 데이터 찾음
// String key = "campusId:" + userId;
// // null값 처리 위해 Integer 사용
// Integer campusId = (Integer) redisTemplate.opsForValue().get(key);
// System.out.println("campusId:" + campusId);
//
// // redis에 데이터 없는 경우 db 조회
// if (campusId == null) {
// campusId = userRepositoryV2.findCampusIdById(userId).orElse(-1);
// // campusId가 -1이 아니면 캐시 저장
// if (campusId != -1) {
// redisTemplate.opsForValue().set(key, campusId, Duration.ofDays(1)); // 1일 TTL 설정
// }
// }
// return campusId;
// }
//
// // 사용자 학과 id 찾기
// public int getUserDepartmentId(String userId) {
// String key = "departmentId:" + userId;
// Integer departmentId = (Integer) redisTemplate.opsForValue().get(key);
// System.out.println("departmentId:" + departmentId);
//
// if (departmentId == null) {
// departmentId = userRepositoryV2.findDepartmentIdById(userId).orElse(-1);
// // campusId가 -1이 아니면 캐시 저장
// if (departmentId != -1) {
// redisTemplate.opsForValue().set(key, departmentId, Duration.ofDays(1)); // 1일 TTL 설정
// }
// }
// return getParentDepartmentId(departmentId);
// }
//
// // 부모 게시판 매핑 (해당 학과 ID가 없으면 기본값 그대로 유지)
// public int getParentDepartmentId(int childDepartmentId) {
// Map<Integer, Integer> parentDepartmentMap = Map.of(
// 52, 51,
// 53, 51,
// 103, 102,
// 104, 102,
// 106, 105,
// 107, 105
// );
// return parentDepartmentMap.getOrDefault(childDepartmentId, childDepartmentId);
// }



public int getUserCampusId(String userId) {
Optional<Integer> campusId = userRepositoryV2.findCampusIdById(userId);
Expand Down
Loading