Skip to content

Commit

Permalink
Merge pull request #23 from Timetris-Trendithon/mainpage
Browse files Browse the repository at this point in the history
โšกFeat: ๋ฉ”์ธํŽ˜์ด์ง€ ์„œ๋น„์Šค๋‹จ์— @transactional ์ถ”๊ฐ€
  • Loading branch information
Zena0128 authored Feb 20, 2024
2 parents 6cd9d25 + 149369f commit 9265937
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@
import com.trendithon.timetris.global.exception.enums.ErrorStatus;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@RequiredArgsConstructor
@Transactional
public class CategoryServiceImpl implements CategoryService{

private final CategoryRepository categoryRepository;
private final UserRepository userRepository;

// @Override
@Override
@Transactional(readOnly = true)
public List<CategoryViewDTO> readCategoryAll(long userId) {
User user = userRepository.findById(userId)
.orElseThrow(() -> new CustomException(ErrorStatus.USER_NOT_FOUND_ERROR));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
import lombok.RequiredArgsConstructor;
import org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;
import java.time.LocalTime;
import java.util.concurrent.CancellationException;

@Service
@RequiredArgsConstructor
@Transactional
public class DoServiceImpl implements DoService{

private final DoRepository doRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
import lombok.RequiredArgsConstructor;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;
import java.util.List;
import java.util.Optional;

@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class MainPageServiceImpl implements MainPageService{

private final PlanRepository planRepository;
Expand Down Expand Up @@ -61,6 +63,7 @@ public MyPageResponse.getMyPageDTO getUserInfo(Long userId) {

@Override
@Scheduled(cron = "0 0 0 * * *")
@Transactional
public void createUserDate() {
List<User> users = userRepository.findAll();
LocalDate localDate = LocalDate.now();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
import com.trendithon.timetris.global.exception.enums.ErrorStatus;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;
import java.time.LocalTime;

@Service
@RequiredArgsConstructor
@Transactional
public class PlanServiceImpl implements PlanService {

private final PlanRepository planRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
import com.trendithon.timetris.global.exception.enums.ErrorStatus;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;

@Service
@RequiredArgsConstructor
@Transactional
public class SeeServiceImpl implements SeeService{

private final SeeRepository seeRepository;
Expand Down

0 comments on commit 9265937

Please sign in to comment.