Update JenisLogController.java

Clean code
This commit is contained in:
Salman Manoe 2024-02-07 14:42:18 +07:00
parent 7c24ab5bc1
commit 6ec433d135

View File

@ -29,19 +29,19 @@ import static org.springframework.web.bind.annotation.RequestMethod.POST;
@RestController
@RequestMapping("/log/jenis")
public class JenisLogController {
private static final Logger LOGGER = getLogger(JenisLogController.class);
private static final Logger LOGGER = getLogger(JenisLogController.class);
@Autowired
private JenisLogService jenisLogService;
@Autowired
private JenisLogService jenisLogService;
@RequestMapping(method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
public ResponseEntity<String> addVO(@Valid @RequestBody List<JenisLogVO> vos, HttpServletRequest request) {
try {
jenisLogService.save(vos);
return RestUtil.getJsonResponse(CREATED.getReasonPhrase(), CREATED);
} catch (ServiceVOException e) {
LOGGER.error("Got exception {} when add Agama", e.getMessage());
return RestUtil.getJsonHttptatus(INTERNAL_SERVER_ERROR);
}
}
@RequestMapping(method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
public ResponseEntity<String> addVO(@Valid @RequestBody List<JenisLogVO> vos, HttpServletRequest request) {
try {
jenisLogService.save(vos);
return RestUtil.getJsonResponse(CREATED.getReasonPhrase(), CREATED);
} catch (ServiceVOException e) {
LOGGER.error("Got exception {} when add jenis log", e.getMessage());
return RestUtil.getJsonHttptatus(INTERNAL_SERVER_ERROR);
}
}
}