constructor 정리
This commit is contained in:
+10
-9
@@ -7,7 +7,6 @@ import com.eactive.httpmockserver.api.entity.MockRoute;
|
||||
import com.eactive.httpmockserver.api.mapper.MockRouteMapper;
|
||||
import com.eactive.httpmockserver.api.service.MockRouteService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@@ -30,18 +29,20 @@ public class MockRouteMgmtController {
|
||||
mockRouteService.initAllRoutes();
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private MockRouteService mockRouteService;
|
||||
private final MockRouteService mockRouteService;
|
||||
|
||||
@Autowired
|
||||
private Validator validator;
|
||||
private final Validator validator;
|
||||
|
||||
@Autowired
|
||||
private MockRouteMapper mockRouteMapper;
|
||||
private final MockRouteMapper mockRouteMapper;
|
||||
|
||||
@Autowired
|
||||
private MockApiHandlerMapping mockApiHandlerMapping;
|
||||
private final MockApiHandlerMapping mockApiHandlerMapping;
|
||||
|
||||
public MockRouteMgmtController(MockRouteService mockRouteService, Validator validator, MockRouteMapper mockRouteMapper, MockApiHandlerMapping mockApiHandlerMapping) {
|
||||
this.mockRouteService = mockRouteService;
|
||||
this.validator = validator;
|
||||
this.mockRouteMapper = mockRouteMapper;
|
||||
this.mockApiHandlerMapping = mockApiHandlerMapping;
|
||||
}
|
||||
|
||||
public static final String MOCK_ROUTE_EDIT = "page/routes/mockRouteEdit";
|
||||
public static final String MOCK_ROUTE_LIST_VIEW = "redirect:/mgmt/routes/list_view.do";
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.eactive.httpmockserver.client.dto.ApiResponse;
|
||||
import com.eactive.httpmockserver.client.service.NettyApiClient;
|
||||
import com.eactive.httpmockserver.server.entity.Server;
|
||||
import com.eactive.httpmockserver.server.entity.ServerRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -19,11 +18,14 @@ import java.util.concurrent.ExecutionException;
|
||||
@Controller
|
||||
public class ApiClientController {
|
||||
|
||||
@Autowired
|
||||
private ServerRepository serverRepository;
|
||||
private final ServerRepository serverRepository;
|
||||
|
||||
@Autowired
|
||||
private NettyApiClient nettyApiClient;
|
||||
private final NettyApiClient nettyApiClient;
|
||||
|
||||
public ApiClientController(ServerRepository serverRepository, NettyApiClient nettyApiClient) {
|
||||
this.serverRepository = serverRepository;
|
||||
this.nettyApiClient = nettyApiClient;
|
||||
}
|
||||
|
||||
@PostMapping("/mgmt/api/test.do")
|
||||
@ResponseBody
|
||||
|
||||
+3
-3
@@ -18,11 +18,11 @@ import java.util.List;
|
||||
public class ApiRequestMgmtController {
|
||||
|
||||
private static final String SUCCESS = "success";
|
||||
ApiRequestMgmtService apiRequestMgmtService;
|
||||
private final ApiRequestMgmtService apiRequestMgmtService;
|
||||
|
||||
ApiRequestMapper apiRequestMapper;
|
||||
private final ApiRequestMapper apiRequestMapper;
|
||||
|
||||
UserService userService;
|
||||
private final UserService userService;
|
||||
|
||||
public ApiRequestMgmtController(ApiRequestMgmtService apiRequestMgmtService, ApiRequestMapper apiRequestMapper, UserService userService) {
|
||||
this.apiRequestMgmtService = apiRequestMgmtService;
|
||||
|
||||
@@ -27,7 +27,7 @@ public class LoginController {
|
||||
|
||||
public static final String LOGIN_MESSAGE = "loginMessage";
|
||||
|
||||
private UserService userService;
|
||||
private final UserService userService;
|
||||
|
||||
public LoginController(UserService userService) {
|
||||
this.userService = userService;
|
||||
|
||||
+9
-7
@@ -6,7 +6,6 @@ import com.eactive.httpmockserver.server.entity.Server;
|
||||
import com.eactive.httpmockserver.server.mapper.ServerMapper;
|
||||
import com.eactive.httpmockserver.server.service.ServerMgmtService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@@ -22,14 +21,17 @@ import java.util.List;
|
||||
@RequestMapping("/mgmt/servers")
|
||||
public class ServerMgmtController {
|
||||
|
||||
@Autowired
|
||||
ServerMgmtService serverMgmtService;
|
||||
private final ServerMgmtService serverMgmtService;
|
||||
|
||||
@Autowired
|
||||
ServerMapper serverMapper;
|
||||
private final ServerMapper serverMapper;
|
||||
|
||||
@Autowired
|
||||
private Validator validator;
|
||||
private final Validator validator;
|
||||
|
||||
public ServerMgmtController(ServerMgmtService serverMgmtService, ServerMapper serverMapper, Validator validator) {
|
||||
this.serverMgmtService = serverMgmtService;
|
||||
this.serverMapper = serverMapper;
|
||||
this.validator = validator;
|
||||
}
|
||||
|
||||
public static final String SERVER = "server";
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.eactive.httpmockserver.user.controller;
|
||||
import com.eactive.httpmockserver.common.util.SecurityUtil;
|
||||
import com.eactive.httpmockserver.user.dto.PasswordChangeRequestDTO;
|
||||
import com.eactive.httpmockserver.user.service.UserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.ui.ModelMap;
|
||||
@@ -17,12 +16,15 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
public class AccountController {
|
||||
|
||||
public static final String UPDATE_PW = "page/updatePw";
|
||||
@Autowired
|
||||
private Validator validator;
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
public AccountController(Validator validator, UserService userService) {
|
||||
this.validator = validator;
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
@GetMapping("/change_password.do")
|
||||
public String changePassword( @ModelAttribute("passwordChangeRequest") PasswordChangeRequestDTO passwordChangeRequestDTO) {
|
||||
return UPDATE_PW;
|
||||
|
||||
+13
-11
@@ -5,7 +5,6 @@ import com.eactive.httpmockserver.user.entity.StaffUser;
|
||||
import com.eactive.httpmockserver.user.mapper.StaffUserMapper;
|
||||
import com.eactive.httpmockserver.user.repository.StaffUserRepository;
|
||||
import com.eactive.httpmockserver.user.service.StaffUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.validation.BindingResult;
|
||||
@@ -17,27 +16,30 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
@Controller
|
||||
public class AdminRegisterController {
|
||||
|
||||
@Autowired
|
||||
StaffUserService staffUserService;
|
||||
private final StaffUserService staffUserService;
|
||||
|
||||
@Autowired
|
||||
StaffUserRepository staffUserRepository;
|
||||
private final StaffUserRepository staffUserRepository;
|
||||
|
||||
@Autowired
|
||||
private Validator validator;
|
||||
private final Validator validator;
|
||||
|
||||
@Autowired
|
||||
private StaffUserMapper staffUserMapper;
|
||||
private final StaffUserMapper staffUserMapper;
|
||||
|
||||
public AdminRegisterController(StaffUserService staffUserService, StaffUserRepository staffUserRepository, Validator validator, StaffUserMapper staffUserMapper) {
|
||||
this.staffUserService = staffUserService;
|
||||
this.staffUserRepository = staffUserRepository;
|
||||
this.validator = validator;
|
||||
this.staffUserMapper = staffUserMapper;
|
||||
}
|
||||
|
||||
@GetMapping("/admin_register_view.do")
|
||||
public String adminRegisterView(ModelMap model) {
|
||||
|
||||
long users = staffUserRepository.count();
|
||||
|
||||
if (users == 0){
|
||||
if (users == 0) {
|
||||
model.addAttribute("user", new StaffUser());
|
||||
return "page/users/adminRegister";
|
||||
}else {
|
||||
} else {
|
||||
return "redirect:/";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.eactive.httpmockserver.user.entity.StaffUser;
|
||||
import com.eactive.httpmockserver.user.mapper.StaffUserMapper;
|
||||
import com.eactive.httpmockserver.user.service.StaffUserService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@@ -24,14 +23,17 @@ public class UserMgmtController {
|
||||
public static final String STAFF_USER_EDIT = "page/users/staffUserEdit";
|
||||
public static final String USERS_LIST_VIEW = "redirect:/mgmt/users/list_view.do";
|
||||
|
||||
@Autowired
|
||||
private StaffUserService staffUserService;
|
||||
private final StaffUserService staffUserService;
|
||||
|
||||
@Autowired
|
||||
private Validator validator;
|
||||
private final Validator validator;
|
||||
|
||||
@Autowired
|
||||
private StaffUserMapper staffUserMapper;
|
||||
private final StaffUserMapper staffUserMapper;
|
||||
|
||||
public UserMgmtController(StaffUserService staffUserService, Validator validator, StaffUserMapper staffUserMapper) {
|
||||
this.staffUserService = staffUserService;
|
||||
this.validator = validator;
|
||||
this.staffUserMapper = staffUserMapper;
|
||||
}
|
||||
|
||||
@GetMapping("/list_view.do")
|
||||
public String userList(@ModelAttribute("userSearch") UserSearch userSearch,
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.eactive.httpmockserver.user.entity;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Table(name = "PT_USER_GROUP")
|
||||
public class UserGroup {
|
||||
public class UserGroup implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
Reference in New Issue
Block a user