diff --git a/src/main/java/com/xkrs/controller/SettingController.java b/src/main/java/com/xkrs/controller/SettingController.java index dfeb7fd..afe05e5 100644 --- a/src/main/java/com/xkrs/controller/SettingController.java +++ b/src/main/java/com/xkrs/controller/SettingController.java @@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import javax.transaction.Transactional; import java.util.List; import java.util.Locale; @@ -25,6 +26,7 @@ public class SettingController { @Resource private SettingDao settingDao; + @Transactional(rollbackOn = Exception.class) @PostMapping("/updateswitchstate") public String updateSwitchState(@RequestBody SettingQo settingQo) { Locale locale = LocaleContextHolder.getLocale();