自定义 Claim HandlerMethodArgumentResolver
This commit is contained in:
parent
90782da7c4
commit
f125c1d114
@ -54,8 +54,7 @@ public class LocationRecordController {
|
||||
|
||||
@PostJson("/page")
|
||||
@Operation(summary = "分页查询记录")
|
||||
public JsonResponse<PageWrapper<LocationRecordVo>> getPageLocationRecord(@RequestBody PageLocationRecordParams params, @RequestHeader("token") String token){
|
||||
Claims claims = jwtService.parseToken(token);
|
||||
public JsonResponse<PageWrapper<LocationRecordVo>> getPageLocationRecord(@Claim Claims claims, @RequestBody PageLocationRecordParams params){
|
||||
PageInfo<LocationRecordVo> pageInfo =
|
||||
LocationRecordConvertor.INSTANCE.daoToVo(locationRecordService.getPageLocationRecord(params, claims.getUserId()).getResult());
|
||||
|
||||
|
@ -12,9 +12,11 @@ import java.util.Date;
|
||||
public class LocationRecordParams {
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@Schema(example = "2023-05-08 00:00:00")
|
||||
private Date startTime;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@Schema(example = "2023-05-08 23:59:59")
|
||||
private Date endTime;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user