use of org.springframework.web.bind.annotation.RequestMapping in project spring-boot-admin by codecentric.
the class RegistryController method register.
/**
* Register an application within this admin application.
*
* @param application The application infos.
* @return The registered application.
*/
@RequestMapping(method = RequestMethod.POST)
public ResponseEntity<Application> register(@RequestBody Application application) {
Application applicationWithSource = Application.copyOf(application).withSource("http-api").build();
LOGGER.debug("Register application {}", applicationWithSource.toString());
Application registeredApp = registry.register(applicationWithSource);
return ResponseEntity.status(HttpStatus.CREATED).body(registeredApp);
}
use of org.springframework.web.bind.annotation.RequestMapping in project spring-boot-admin by codecentric.
the class RegistryController method unregister.
/**
* Unregister an application within this admin application.
*
* @param id The application id.
* @return the unregistered application.
*/
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public ResponseEntity<?> unregister(@PathVariable String id) {
LOGGER.debug("Unregister application with ID '{}'", id);
Application application = registry.deregister(id);
if (application != null) {
return ResponseEntity.ok(application);
} else {
return ResponseEntity.notFound().build();
}
}
use of org.springframework.web.bind.annotation.RequestMapping in project spring-boot-admin by codecentric.
the class JournalController method getJournalEvents.
@RequestMapping(produces = "text/event-stream")
public SseEmitter getJournalEvents() {
final SseEmitter emitter = new SseEmitter();
emitter.onCompletion(new Runnable() {
@Override
public void run() {
emitters.remove(emitter);
}
});
emitters.add(emitter);
return emitter;
}
use of org.springframework.web.bind.annotation.RequestMapping in project head by mifos.
the class AccountingDataController method confirmExportsDelete.
@RequestMapping("confirmExportsDelete.ftl")
public final ModelAndView confirmExportsDelete() {
ModelAndView mav = new ModelAndView("confirmExportsDelete");
List<BreadCrumbsLinks> breadcrumbs = new AdminBreadcrumbBuilder().withLink("accounting.viewaccountingexports", "confirmExportsDelete.ftl").build();
mav.addObject("breadcrumbs", breadcrumbs);
return mav;
}
use of org.springframework.web.bind.annotation.RequestMapping in project head by mifos.
the class AccountingDataController method showAccountingDataFor.
@RequestMapping("renderAccountingData.ftl")
public final ModelAndView showAccountingDataFor(@RequestParam(value = FROM_DATE) String paramFromDate, @RequestParam(value = TO_DATE) String paramToDate) {
DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd");
LocalDate fromDate = fmt.parseDateTime(paramFromDate).toLocalDate();
LocalDate toDate = fmt.parseDateTime(paramToDate).toLocalDate();
Boolean hasAlreadyRanQuery = Boolean.FALSE;
String fileName = null;
List<AccountingDto> accountingData = new ArrayList<AccountingDto>();
try {
fileName = accountingService.getExportOutputFileName(fromDate, toDate).replace(".xml", "");
hasAlreadyRanQuery = accountingService.hasAlreadyRanQuery(fromDate, toDate);
accountingData = accountingService.getExportDetails(fromDate, toDate);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
}
ModelAndView mav = new ModelAndView("renderAccountingData");
List<BreadCrumbsLinks> breadcrumbs = new AdminBreadcrumbBuilder().withLink("accounting.viewaccountingexports", "renderAccountingDataCacheInfo.ftl").withLink(fileName, "").build();
mav.addObject("breadcrumbs", breadcrumbs);
mav.addObject("accountingData", accountingData);
mav.addObject("hasAlreadyRanQuery", hasAlreadyRanQuery);
mav.addObject("fileName", fileName);
mav.addObject("fromDate", fromDate);
mav.addObject("toDate", toDate);
return mav;
}
Aggregations