修复手机上导航栏异常,右上角加入SQL监控链接,部分Service加入事务管理

This commit is contained in:
郑杰
2018-09-23 17:55:53 +08:00
parent bc27ec1b67
commit 17e3b49e58
8 changed files with 33 additions and 12 deletions
@@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
@@ -31,6 +31,7 @@ public class ConfigurerAdapter implements WebMvcConfigurer {
//跳转登陆注册页面
registry.addViewController("/login.html").setViewName("/user/login");
registry.addViewController("/signUp.html").setViewName("/register");
//跳转到swagger页面
registry.addViewController("/swagger/index").setViewName("/system/api/index");
}
}
@@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
@@ -80,6 +81,7 @@ public class MenuServiceImpl implements MenuService {
}
@Override
@Transactional(rollbackFor = Throwable.class)
public void inster(Menu menu, Menu topMenu, String roles) {
validation(menu);
if(topMenu == null){
@@ -100,6 +102,7 @@ public class MenuServiceImpl implements MenuService {
}
@Override
@Transactional(rollbackFor = Throwable.class)
public void delete(Menu menu) {
if(menu.getLevelNum() == 0){
menuRepo.delete(menu);
@@ -119,6 +122,7 @@ public class MenuServiceImpl implements MenuService {
}
@Override
@Transactional(rollbackFor = Throwable.class)
public void update(Menu menu, Menu oldMenu, String roles) {
validation(menu);
Menu oldTopMenu = null;
@@ -16,6 +16,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
/**
@@ -23,6 +23,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
@@ -60,6 +61,7 @@ public class PictureServiceImpl implements PictureService {
}
@Override
@Transactional(rollbackFor = Throwable.class)
public void upload(MultipartFile multipartFile, User user) {
File file = FileUtil.toFile(multipartFile);
//将参数合成一个请求