66import ita .tinybite .domain .party .enums .ParticipantStatus ;
77import ita .tinybite .domain .party .enums .PartyStatus ;
88import ita .tinybite .domain .party .repository .PartyParticipantRepository ;
9- import ita .tinybite .domain .user .constant .UserStatus ;
109import ita .tinybite .domain .user .dto .req .UpdateUserReqDto ;
1110import ita .tinybite .domain .user .dto .res .PartyResponse ;
1211import ita .tinybite .domain .user .dto .res .UserResDto ;
1615import ita .tinybite .global .exception .errorcode .AuthErrorCode ;
1716import ita .tinybite .global .location .LocationService ;
1817import org .springframework .stereotype .Service ;
18+ import org .springframework .transaction .annotation .Transactional ;
1919
2020import java .util .List ;
2121import java .util .stream .Collectors ;
2222
2323@ Service
24+ @ Transactional (readOnly = true )
2425public class UserService {
2526
2627 private final SecurityProvider securityProvider ;
@@ -43,17 +44,20 @@ public UserResDto getUser() {
4344 return UserResDto .of (user );
4445 }
4546
47+ @ Transactional
4648 public void updateUser (UpdateUserReqDto req ) {
4749 User user = securityProvider .getCurrentUser ();
4850 user .update (req );
4951 }
5052
53+ @ Transactional
5154 public void updateLocation (String latitude , String longitude ) {
5255 User user = securityProvider .getCurrentUser ();
5356 String location = locationService .getLocation (latitude , longitude );
5457 user .updateLocation (location );
5558 }
5659
60+ @ Transactional
5761 public void deleteUser () {
5862 userRepository .delete (securityProvider .getCurrentUser ());
5963 }
0 commit comments