| Line 5... |
Line 5... |
| 5 |
|
5 |
|
| 6 |
import javax.servlet.http.HttpServletRequest;
|
6 |
import javax.servlet.http.HttpServletRequest;
|
| 7 |
|
7 |
|
| 8 |
import org.slf4j.Logger;
|
8 |
import org.slf4j.Logger;
|
| 9 |
import org.slf4j.LoggerFactory;
|
9 |
import org.slf4j.LoggerFactory;
|
| - |
|
10 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 10 |
import org.springframework.http.HttpStatus;
|
11 |
import org.springframework.http.HttpStatus;
|
| 11 |
import org.springframework.http.ResponseEntity;
|
12 |
import org.springframework.http.ResponseEntity;
|
| 12 |
import org.springframework.stereotype.Controller;
|
13 |
import org.springframework.stereotype.Controller;
|
| 13 |
import org.springframework.web.bind.annotation.RequestMapping;
|
14 |
import org.springframework.web.bind.annotation.RequestMapping;
|
| 14 |
import org.springframework.web.bind.annotation.RequestMethod;
|
15 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| Line 20... |
Line 21... |
| 20 |
import com.spice.profitmandi.common.util.StringUtils;
|
21 |
import com.spice.profitmandi.common.util.StringUtils;
|
| 21 |
import com.spice.profitmandi.dao.entity.Role;
|
22 |
import com.spice.profitmandi.dao.entity.Role;
|
| 22 |
import com.spice.profitmandi.dao.enumuration.RoleType;
|
23 |
import com.spice.profitmandi.dao.enumuration.RoleType;
|
| 23 |
import com.spice.profitmandi.dao.enumuration.Status;
|
24 |
import com.spice.profitmandi.dao.enumuration.Status;
|
| 24 |
import com.spice.profitmandi.dao.repository.RoleRepository;
|
25 |
import com.spice.profitmandi.dao.repository.RoleRepository;
|
| 25 |
import com.spice.profitmandi.dao.repository.RoleRepositoryImpl;
|
- |
|
| 26 |
import com.spice.profitmandi.web.model.ProfitMandiResponse;
|
26 |
import com.spice.profitmandi.web.model.ProfitMandiResponse;
|
| 27 |
import com.spice.profitmandi.web.model.Response;
|
27 |
import com.spice.profitmandi.web.model.Response;
|
| 28 |
import com.spice.profitmandi.web.model.ResponseStatus;
|
28 |
import com.spice.profitmandi.web.model.ResponseStatus;
|
| 29 |
|
29 |
|
| 30 |
/**
|
30 |
/**
|
| Line 34... |
Line 34... |
| 34 |
@Controller
|
34 |
@Controller
|
| 35 |
public class RoleController {
|
35 |
public class RoleController {
|
| 36 |
|
36 |
|
| 37 |
private static final Logger LOGGER=LoggerFactory.getLogger(RoleController.class);
|
37 |
private static final Logger LOGGER=LoggerFactory.getLogger(RoleController.class);
|
| 38 |
|
38 |
|
| - |
|
39 |
@Autowired
|
| 39 |
private RoleRepository roleRepository = RoleRepositoryImpl.getInstance();
|
40 |
RoleRepository roleRepository;
|
| 40 |
|
41 |
|
| 41 |
@RequestMapping(value = ProfitMandiConstants.URL_ROLE, method = RequestMethod.POST)
|
42 |
@RequestMapping(value = ProfitMandiConstants.URL_ROLE, method = RequestMethod.POST)
|
| 42 |
public ResponseEntity<?> createRole(HttpServletRequest request){
|
43 |
public ResponseEntity<?> createRole(HttpServletRequest request){
|
| 43 |
LOGGER.info("requested url : "+request.getRequestURL().toString());
|
44 |
LOGGER.info("requested url : "+request.getRequestURL().toString());
|
| 44 |
final Role role = (Role)request.getAttribute("role");
|
45 |
final Role role = (Role)request.getAttribute("role");
|