Commit 9054214c by stylefeng

规范注入

parent abbd6f73
......@@ -21,7 +21,7 @@ import java.util.Map;
public class BlackboardController extends BaseController {
@Autowired
INoticeService noticeService;
private INoticeService noticeService;
/**
* 跳转到黑板
......
......@@ -13,6 +13,7 @@ import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.system.model.Dept;
import com.stylefeng.guns.modular.system.service.IDeptService;
import com.stylefeng.guns.modular.system.warpper.DeptWarpper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -20,7 +21,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
......@@ -36,8 +36,8 @@ public class DeptController extends BaseController {
private String PREFIX = "/system/dept/";
@Resource
IDeptService deptService;
@Autowired
private IDeptService deptService;
/**
* 跳转到部门管理首页
......
......@@ -14,6 +14,7 @@ import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.system.model.Dict;
import com.stylefeng.guns.modular.system.service.IDictService;
import com.stylefeng.guns.modular.system.warpper.DictWarpper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -21,7 +22,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
......@@ -37,8 +37,8 @@ public class DictController extends BaseController {
private String PREFIX = "/system/dict/";
@Resource
IDictService dictService;
@Autowired
private IDictService dictService;
/**
* 跳转到字典管理首页
......
......@@ -9,7 +9,6 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
......@@ -28,11 +27,11 @@ import java.io.IOException;
@RequestMapping("/kaptcha")
public class KaptchaController {
@Resource
@Autowired
private GunsProperties gunsProperties;
@Autowired
Producer producer;
private Producer producer;
/**
* 生成验证码
......
......@@ -12,13 +12,13 @@ import com.stylefeng.guns.core.support.BeanKit;
import com.stylefeng.guns.modular.system.model.OperationLog;
import com.stylefeng.guns.modular.system.service.IOperationLogService;
import com.stylefeng.guns.modular.system.warpper.LogWarpper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
......@@ -34,7 +34,7 @@ public class LogController extends BaseController {
private static String PREFIX = "/system/log/";
@Resource
@Autowired
private IOperationLogService operationLogService;
/**
......
......@@ -36,10 +36,10 @@ import static com.stylefeng.guns.core.support.HttpKit.getIp;
public class LoginController extends BaseController {
@Autowired
IMenuService menuService;
private IMenuService menuService;
@Autowired
IUserService userService;
private IUserService userService;
/**
* 跳转到主页
......
......@@ -10,12 +10,12 @@ import com.stylefeng.guns.core.common.constant.factory.PageFactory;
import com.stylefeng.guns.modular.system.model.OperationLog;
import com.stylefeng.guns.modular.system.service.ILoginLogService;
import com.stylefeng.guns.modular.system.warpper.LogWarpper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
......@@ -31,7 +31,7 @@ public class LoginLogController extends BaseController {
private static String PREFIX = "/system/log/";
@Resource
@Autowired
private ILoginLogService loginLogService;
/**
......
......@@ -18,6 +18,7 @@ import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.system.model.Menu;
import com.stylefeng.guns.modular.system.service.IMenuService;
import com.stylefeng.guns.modular.system.warpper.MenuWarpper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
......@@ -26,7 +27,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
......@@ -43,8 +43,8 @@ public class MenuController extends BaseController {
private static String PREFIX = "/system/menu/";
@Resource
IMenuService menuService;
@Autowired
private IMenuService menuService;
/**
* 跳转到菜单列表列表页面
......
......@@ -12,6 +12,7 @@ import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.system.model.Notice;
import com.stylefeng.guns.modular.system.service.INoticeService;
import com.stylefeng.guns.modular.system.warpper.NoticeWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -19,7 +20,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -36,7 +36,7 @@ public class NoticeController extends BaseController {
private String PREFIX = "/system/notice/";
@Resource
@Autowired
private INoticeService noticeService;
/**
......
......@@ -20,6 +20,7 @@ import com.stylefeng.guns.modular.system.model.User;
import com.stylefeng.guns.modular.system.service.IRoleService;
import com.stylefeng.guns.modular.system.service.IUserService;
import com.stylefeng.guns.modular.system.warpper.RoleWarpper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
......@@ -28,7 +29,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
......@@ -45,11 +45,11 @@ public class RoleController extends BaseController {
private static String PREFIX = "/system/role";
@Resource
IUserService userService;
@Autowired
private IUserService userService;
@Resource
IRoleService roleService;
@Autowired
private IRoleService roleService;
/**
* 跳转到角色列表页面
......
......@@ -23,13 +23,13 @@ import com.stylefeng.guns.modular.system.model.User;
import com.stylefeng.guns.modular.system.service.IUserService;
import com.stylefeng.guns.modular.system.transfer.UserDto;
import com.stylefeng.guns.modular.system.warpper.UserWarpper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.naming.NoPermissionException;
import javax.validation.Valid;
import java.io.File;
......@@ -50,10 +50,10 @@ public class UserMgrController extends BaseController {
private static String PREFIX = "/system/user/";
@Resource
@Autowired
private GunsProperties gunsProperties;
@Resource
@Autowired
private IUserService userService;
/**
......
......@@ -19,12 +19,12 @@ import java.util.Map;
public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements IDeptService {
@Resource
DeptMapper deptMapper;
private DeptMapper deptMapper;
@Override
public void deleteDept(Integer deptId) {
Dept dept = deptMapper.selectById(deptId);
Wrapper<Dept> wrapper = new EntityWrapper<>();
wrapper = wrapper.like("pids", "%[" + dept.getId() + "]%");
List<Dept> subDepts = deptMapper.selectList(wrapper);
......
......@@ -22,7 +22,7 @@ import static com.stylefeng.guns.core.common.constant.factory.MutiStrFactory.*;
public class DictServiceImpl extends ServiceImpl<DictMapper, Dict> implements IDictService {
@Resource
DictMapper dictMapper;
private DictMapper dictMapper;
@Override
public void addDict(String dictName, String dictValues) {
......
......@@ -24,7 +24,7 @@ import java.util.Map;
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IMenuService {
@Resource
MenuMapper menuMapper;
private MenuMapper menuMapper;
@Override
public void delMenu(Long menuId) {
......
......@@ -19,10 +19,10 @@ import java.util.Map;
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {
@Resource
RoleMapper roleMapper;
private RoleMapper roleMapper;
@Resource
RelationMapper relationMapper;
private RelationMapper relationMapper;
@Override
@Transactional(readOnly = false)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment