| Line 12... |
Line 12... |
| 12 |
import org.springframework.web.bind.annotation.RequestParam;
|
12 |
import org.springframework.web.bind.annotation.RequestParam;
|
| 13 |
|
13 |
|
| 14 |
import com.spice.profitmandi.common.ResponseCodeHolder;
|
14 |
import com.spice.profitmandi.common.ResponseCodeHolder;
|
| 15 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
15 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 16 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
16 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 17 |
import com.spice.profitmandi.common.util.StringUtils;
|
- |
|
| 18 |
import com.spice.profitmandi.dao.enumuration.RoleType;
|
- |
|
| 19 |
import com.spice.profitmandi.dao.repository.RoleRepository;
|
17 |
import com.spice.profitmandi.dao.repository.RoleRepository;
|
| 20 |
import com.spice.profitmandi.web.util.ResponseSender;
|
18 |
import com.spice.profitmandi.web.util.ResponseSender;
|
| 21 |
|
19 |
|
| 22 |
/**
|
20 |
/**
|
| 23 |
* @author ashikali
|
21 |
* @author ashikali
|
| Line 52... |
Line 50... |
| 52 |
}
|
50 |
}
|
| 53 |
|
51 |
|
| 54 |
@RequestMapping(value = ProfitMandiConstants.URL_ROLE_TYPE,method=RequestMethod.GET)
|
52 |
@RequestMapping(value = ProfitMandiConstants.URL_ROLE_TYPE,method=RequestMethod.GET)
|
| 55 |
public ResponseEntity<?> getByType(HttpServletRequest request, @RequestParam(name = "type") String typeName){
|
53 |
public ResponseEntity<?> getByType(HttpServletRequest request, @RequestParam(name = "type") String typeName){
|
| 56 |
LOGGER.info("requested url : "+request.getRequestURL().toString());
|
54 |
LOGGER.info("requested url : "+request.getRequestURL().toString());
|
| 57 |
try {
|
- |
|
| 58 |
RoleType roleType = StringUtils.toRoleType(typeName);
|
- |
|
| 59 |
return responseSender.ok(roleRepository.selectByType(roleType));
|
55 |
return responseSender.ok(roleRepository.selectByType(null));
|
| 60 |
}catch (ProfitMandiBusinessException profitMandiBusinessException) {
|
- |
|
| 61 |
LOGGER.error("ProfitMandi error: ", profitMandiBusinessException);
|
- |
|
| 62 |
return responseSender.badRequest(profitMandiBusinessException);
|
- |
|
| 63 |
}
|
- |
|
| 64 |
}
|
56 |
}
|
| 65 |
|
57 |
|
| 66 |
|
58 |
|
| 67 |
@RequestMapping(value = ProfitMandiConstants.URL_ROLE_NAME,method=RequestMethod.GET)
|
59 |
@RequestMapping(value = ProfitMandiConstants.URL_ROLE_NAME,method=RequestMethod.GET)
|
| 68 |
public ResponseEntity<?> getByName(HttpServletRequest request, @RequestParam(name = "name") String name){
|
60 |
public ResponseEntity<?> getByName(HttpServletRequest request, @RequestParam(name = "name") String name){
|