本文整理汇总了Java中org.springframework.format.annotation.DateTimeFormat.ISO.DATE属性的典型用法代码示例。如果您正苦于以下问题:Java ISO.DATE属性的具体用法?Java ISO.DATE怎么用?Java ISO.DATE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.springframework.format.annotation.DateTimeFormat.ISO
的用法示例。
在下文中一共展示了ISO.DATE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: yahooFinanceHistoric
/**
* @param tickersString a ticker with extension, e.g. ABC.L
* @return a CSV string with header row of Date,Open,High,Low,Close,Volume,Adj Close
*/
@RequestMapping("/yahoo/historic/{ticker:.+}/{date}")
public ResponseEntity<String> yahooFinanceHistoric(
@PathVariable @NotNull String ticker,
@PathVariable @DateTimeFormat(iso = ISO.DATE) LocalDate date) {
logger.info("yahooFinanceHistoricDirect({})", ticker);
CharSeq results = doTicksYahooFinanceHistoric(
kennel.parseTickersString.apply(ticker).head(), date);
// create the return type required by this mock API...
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
headers.setContentDispositionFormData("file", "quotes.csv");
ResponseEntity<String> response = new ResponseEntity<>(results.toString(), headers, HttpStatus.OK);
return response;
}
示例2: getLowest
@GetMapping(path = "{sensorCode}/laagste")
public List<Klimaat> getLowest(@PathVariable("sensorCode") String sensorCode,
@RequestParam("sensorType") String sensorType,
@RequestParam("from") @DateTimeFormat(iso = ISO.DATE) LocalDate from,
@RequestParam("to") @DateTimeFormat(iso = ISO.DATE) LocalDate to,
@RequestParam("limit") int limit) {
getKlimaatSensorExpectingOne(sensorCode);
return klimaatService.getLowest(sensorCode, toSensorType(sensorType), aPeriodWithToDate(from, to), limit);
}
示例3: getFullCalendarEvents
@ResponseBody
@RequestMapping(value="/user/{emailAddress}/availability/fullcalendar",method=RequestMethod.GET,produces=MediaType.APPLICATION_JSON_VALUE)
public FullCalendarEvent[] getFullCalendarEvents(@PathVariable String emailAddress, @RequestParam(value="start") @DateTimeFormat(iso=ISO.DATE) Date startDate, @RequestParam(value="end") @DateTimeFormat(iso=ISO.DATE) Date endDate){
return availabilityService.getAvailability(emailAddress, startDate, endDate)
.map(availability ->
availability.getCalendarEvents().stream().map(calendarEvent ->
FullCalendarEvent.builder().resourceId(emailAddress).start(calendarEvent.getStart()).end(calendarEvent.getEnd()).id(calendarEvent.getId()).title(Optional.ofNullable(calendarEvent.getSubject()).orElse("(unknown)")).build()).toArray(FullCalendarEvent[]::new))
.orElseThrow(NotFoundException::new);
}
示例4: getHighest
@GetMapping(path = "{sensorCode}/hoogste")
public List<Klimaat> getHighest(@PathVariable("sensorCode") String sensorCode,
@RequestParam("sensorType") String sensorType,
@RequestParam("from") @DateTimeFormat(iso = ISO.DATE) LocalDate from,
@RequestParam("to") @DateTimeFormat(iso = ISO.DATE) LocalDate to,
@RequestParam("limit") int limit) {
getKlimaatSensorExpectingOne(sensorCode);
return klimaatService.getHighest(sensorCode, toSensorType(sensorType), aPeriodWithToDate(from, to), limit);
}
示例5: findAllInPeriod
@GetMapping(path = "{sensorCode}")
public List<Klimaat> findAllInPeriod(@PathVariable("sensorCode") String sensorCode,
@RequestParam("from") @DateTimeFormat(iso = ISO.DATE) LocalDate from,
@RequestParam("to") @DateTimeFormat(iso = ISO.DATE) LocalDate to) {
getKlimaatSensorExpectingOne(sensorCode);
return klimaatService.getInPeriod(sensorCode, aPeriodWithToDate(from, to));
}
示例6: getOpgenomenVermogenHistory
@GetMapping(path = "historie/{from}/{to}")
public List<OpgenomenVermogen> getOpgenomenVermogenHistory(@PathVariable("from") @DateTimeFormat(iso = ISO.DATE) LocalDate from,
@PathVariable("to") @DateTimeFormat(iso = ISO.DATE) LocalDate to,
@RequestParam("subPeriodLength") long subPeriodLengthInSeconds) {
Duration subPeriodDuration = Duration.ofSeconds(subPeriodLengthInSeconds);
DatePeriod period = aPeriodWithToDate(from, to);
if (to.isBefore(now(clock))) {
return opgenomenVermogenService.getPotentiallyCachedHistory(period, subPeriodDuration);
} else {
return opgenomenVermogenService.getHistory(period, subPeriodDuration);
}
}
示例7: viewUserActivities
@RequestMapping(value = "/{companyId}/user/{userId}/activities", method = RequestMethod.GET)
@Interceptors({ CompanyMemberRequired.class, UserChecking.class })
@ResponseBody
public Map<String, Object> viewUserActivities(@PathVariable int companyId, @PathVariable int userId,
@RequestParam(value = "until", required = false) @DateTimeFormat(iso = ISO.DATE) Date until, Model model) {
Builder<String, Object> builder = ImmutableMap.builder();
DateTime dt = until == null ? new DateTime() : new DateTime(until);
until = dt.withTime(0, 0, 0, 0).plusDays(1).plusMillis(-1).toDate();
List<Integer> projectList = getProjectListOfCurrentUser(companyId);
TreeMap<Date, List<Activity>> map = activityService.getByUserGroupByDate(companyId, userId, ACTIVITY_PER_PAGE,
projectList, until);
TreeMap<String, List<ActivityDTO>> mapDTO = makeMapSerilizable(map);
builder.put("activities", mapDTO);
boolean hasNext = false;
if (map != null && map.size() > 0) {
Date newUntil = new DateTime(map.lastKey()).plusDays(-1).withTime(0, 0, 0, 0).toDate();
TreeMap<Date, List<Activity>> nextMap = activityService.getByUserGroupByDate(companyId, userId,
ACTIVITY_PER_PAGE, projectList, newUntil);
hasNext = nextMap != null;
builder.put("nextPage", dtf.print(new DateTime(newUntil)));
}
builder.put("hasNext", hasNext);
return builder.build();
}
示例8: viewUserAttachments
/**
* 查看用户所有附件
*
* @param companyId
* @param userId
* @param until
* @param model
* @return
*/
@RequestMapping(value = "/{companyId}/user/{userId}/attachments", method = RequestMethod.GET)
@Interceptors({ CompanyMemberRequired.class, UserChecking.class })
@ResponseBody
public ImmutableMap<String, ?> viewUserAttachments(@PathVariable int companyId, @PathVariable int userId,
@RequestParam(value = "until", required = false) @DateTimeFormat(iso = ISO.DATE) Date until,
@RequestParam(value = "page", required = false, defaultValue = "1") Integer page) {
Builder<String, Object> builder = ImmutableMap.builder();
DateTime dt = until == null ? new DateTime() : new DateTime(until);
until = dt.withTime(0, 0, 0, 0).plusDays(1).plusMillis(-1).toDate();
List<Integer> projectList = getProjectListOfCurrentUser(companyId);
TreeMap<Date, List<Attachment>> map = attachmentService.getAttachmentsByUserGroupByDate(companyId, userId,
projectList, until, PER_PAGE);
TreeMap<String, List<AttachmentDTO>> mapDTO = makeUserAttachmentsMapSerilizable(map);
builder.put("userAttachments", mapDTO);
// UserDTO userDto = new UserDTO(userService.getUserById(userId));
boolean hasNext = false;
if (map != null && map.size() > 0) {
Date newUntil = new DateTime(map.lastKey()).withTime(0, 0, 0, 0).plusMillis(-1).toDate();
TreeMap<Date, List<Attachment>> nextMap = attachmentService.getAttachmentsByUserGroupByDate(companyId,
userId, projectList, newUntil, PER_PAGE);
hasNext = nextMap.size() > 0;
builder.put("nextPage", dtf.print(new DateTime(newUntil)));
}
builder.put("hasNext", hasNext);
return builder.build();
}
示例9: viewUserCompletedTodos
/**
* 看一个人完成的所有todo
*
* @param companyId
* @param userId
* @param model
* @return
*/
@RequestMapping(value = "/{companyId}/user/{userId}/completed_todos", method = RequestMethod.GET)
@Interceptors({ CompanyMemberRequired.class, UserChecking.class })
@ResponseBody
public Map<String, Object> viewUserCompletedTodos(@PathVariable int companyId, @PathVariable int userId,
@RequestParam(value = "until", required = false) @DateTimeFormat(iso = ISO.DATE) Date until, Model model) {
Builder<String, Object> builder = ImmutableMap.builder();
DateTime dt = until == null ? new DateTime() : new DateTime(until);
until = dt.withTime(0, 0, 0, 0).plusDays(1).plusMillis(-1).toDate();
List<Integer> projectList = getProjectListOfCurrentUser(companyId);
TreeMap<Date, List<Todolist>> map = todoService.getCompletedTodolistsGroupByDateByUser(companyId, userId,
projectList, until, PER_PAGE);
TreeMap<String, List<TodolistDTO>> mapDTO = makeUserCompletedTodosMapSerilizable(map);
builder.put("completedTodos", mapDTO);
Map<Integer, String> projectIdToName = getProjectIdAndNameByCompanyId(companyId);
builder.put("projectsName", projectIdToName);
boolean hasNext = false;
if (map != null && map.size() > 0) {
Date newUntil = new DateTime(map.lastKey()).withTime(0, 0, 0, 0).plusMillis(-1).toDate();
TreeMap<Date, List<Todolist>> nextMap = todoService.getCompletedTodolistsGroupByDateByUser(companyId,
userId, projectList, newUntil, PER_PAGE);
hasNext = nextMap.size() > 0;
builder.put("nextPage", dtf.print(new DateTime(newUntil)));
}
builder.put("hasNext", hasNext);
return builder.build();
}
示例10: viewUserCompletedBugs
/**
* 获取完成的bugs
*
* @param companyId
* @param userId
* @param until
* @return
*/
@RequestMapping(value = "/{companyId}/user/{userId}/completedBugs", method = RequestMethod.GET)
@Interceptors({ CompanyMemberRequired.class, UserChecking.class })
@ResponseBody
public Map<String, Object> viewUserCompletedBugs(@PathVariable int companyId, @PathVariable int userId,
@RequestParam(value = "until", required = false) @DateTimeFormat(iso = ISO.DATE) Date until) {
Builder<String, Object> builder = ImmutableMap.builder();
DateTime dt = until == null ? new DateTime() : new DateTime(until);
until = dt.withTime(0, 0, 0, 0).plusDays(1).plusMillis(-1).toDate();
List<Integer> projectList = getProjectListOfCurrentUser(companyId);
TreeMap<Date, Map<Integer, List<Bug>>> map = bugService.getCompletedBugsGroupByDateByUser(companyId, userId,
projectList, until, PER_PAGE);
TreeMap<String, Map<Integer, List<BugDTO>>> mapDTO = makeUserCompletedBugsMapSerilizable(map);
builder.put("completedBugs", mapDTO);
Map<Integer, String> projectIdToName = getProjectIdAndNameByCompanyId(companyId);
builder.put("projectsName", projectIdToName);
boolean hasNext = false;
if (map != null && map.size() > 0) {
Date newUntil = new DateTime(map.firstKey()).withTime(0, 0, 0, 0).plusMillis(-1).toDate();
TreeMap<Date, Map<Integer, List<Bug>>> nextMap = bugService.getCompletedBugsGroupByDateByUser(companyId,
userId, projectList, newUntil, PER_PAGE);
hasNext = nextMap.size() > 0;
builder.put("nextPage", dtf.print(new DateTime(newUntil)));
}
builder.put("hasNext", hasNext);
return builder.build();
}
示例11: viewUserCompletedSteps
/**
* 获取完成的steps
*
* @param companyId
* @param userId
* @param until
* @return
*/
@RequestMapping(value = "/{companyId}/user/{userId}/completedSteps", method = RequestMethod.GET)
@Interceptors({ CompanyMemberRequired.class, UserChecking.class })
@ResponseBody
public Map<String, Object> viewUserCompletedSteps(@PathVariable int companyId, @PathVariable int userId,
@RequestParam(value = "until", required = false) @DateTimeFormat(iso = ISO.DATE) Date until) {
Builder<String, Object> builder = ImmutableMap.builder();
DateTime dt = until == null ? new DateTime() : new DateTime(until);
until = dt.withTime(0, 0, 0, 0).plusDays(1).plusMillis(-1).toDate();
List<Integer> projectList = getProjectListOfCurrentUser(companyId);
TreeMap<Date, Map<Integer, List<Step>>> map = stepService.getCompletedStepsGroupByDateByUser(companyId, userId,
projectList, until, PER_PAGE);
TreeMap<String, Map<Integer, List<StepDTO>>> mapDTO = makeUserCompletedStepsMapSerilizable(map);
builder.put("completedSteps", mapDTO);
Map<Integer, String> projectIdToName = getProjectIdAndNameByCompanyId(companyId);
builder.put("projectsName", projectIdToName);
boolean hasNext = false;
if (map != null && map.size() > 0) {
Date newUntil = new DateTime(map.firstKey()).withTime(0, 0, 0, 0).plusMillis(-1).toDate();
TreeMap<Date, Map<Integer, List<Bug>>> nextMap = bugService.getCompletedBugsGroupByDateByUser(companyId,
userId, projectList, newUntil, PER_PAGE);
hasNext = nextMap.size() > 0;
builder.put("nextPage", dtf.print(new DateTime(newUntil)));
}
builder.put("hasNext", hasNext);
return builder.build();
}
示例12: showActivities
@RequestMapping(value = "/activities", method = RequestMethod.GET)
@Interceptors({ CompanyMemberRequired.class })
@ResponseBody
public CompanyActivities showActivities(@PathVariable int companyId, @RequestParam(value = "until",
required = false) @DateTimeFormat(iso = ISO.DATE) Date until,
@RequestParam(required = false) Integer userId, @RequestParam(required = false) Integer projectId,
@RequestParam(required = false) String type) {
DateTime dt = until == null ? new DateTime() : new DateTime(until);
until = dt.withTime(0, 0, 0, 0).plusDays(1).plusMillis(-1).toDate();
boolean hasNext = false;
Date nextDay = null;
List<Activity> activities = activityService.getUserVisibleTillDay(companyId, userId, projectId, until, type,
LIMIT);
if (activities.size() > 0) {
Activity activity = activities.get(activities.size() - 1);
nextDay = new DateTime(activity.getCreated()).withTime(0, 0, 0, 0).plusMillis(-1).toDate();
// 如果取到nextDay仍然有数据,则hasNext为true
List<Activity> nextActivities = activityService.getUserVisibleTillDay(companyId, userId, projectId,
nextDay, type, LIMIT);
if (nextActivities.size() > 0) {
hasNext = true;
}
}
return new CompanyActivities(activities, hasNext, nextDay);
}
示例13: yahooFinanceHistoricDirect
/**
* @param tickersString a ticker with extension, e.g. ABC.L
* @return a CSV string with header row of Date,Open,High,Low,Close,Volume,Adj Close
*/
@RequestMapping("/yahoo/historic/direct/{ticker:.+}/{date}")
public ResponseEntity<String> yahooFinanceHistoricDirect(
@PathVariable @NotNull String ticker,
@PathVariable @DateTimeFormat(iso = ISO.DATE) LocalDate date) {
logger.info("yahooFinanceHistoricDirect({},{})", ticker, date.toString());
CharSeq results = doTicksYahooFinanceHistoric(
kennel.parseTickersString.apply(ticker).head(), date);
// create the return type required by this mock API...
HttpHeaders headers = new HttpHeaders();
ResponseEntity<String> response = new ResponseEntity<>(results.toString(), headers, HttpStatus.OK);
return response;
}
示例14: forIso
private DateTimeFormatter forIso(ISO iso) {
if (iso == ISO.DATE) {
return org.joda.time.format.ISODateTimeFormat.date();
} else if (iso == ISO.TIME) {
return org.joda.time.format.ISODateTimeFormat.time();
} else {
return org.joda.time.format.ISODateTimeFormat.dateTime();
}
}
示例15: methodWithTwoPathVariables
@RequestMapping("/{id}/foo/{date}")
HttpEntity<Void> methodWithTwoPathVariables(
@PathVariable Integer id, @DateTimeFormat(iso = ISO.DATE) @PathVariable DateTime date) {
return null;
}