|  |  |  | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.business.model.CarUseBook; | 
|---|
|  |  |  | import com.doumee.dao.business.vo.DateIntervalVO; | 
|---|
|  |  |  | import com.doumee.service.business.CarUseBookService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | 
|---|
|  |  |  | @GetMapping("/{id}") | 
|---|
|  |  |  | @CloudRequiredPermission("business:carusebook:query") | 
|---|
|  |  |  | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | return ApiResponse.success(carUseBookService.findById(id)); | 
|---|
|  |  |  | return ApiResponse.success(carUseBookService.findById(id,getLoginUser(token).getMemberId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("查询车辆预约记录") | 
|---|
|  |  |  | 
|---|
|  |  |  | return ApiResponse.success(carUseBookService.carUseBookList(carUseBook)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("查询车辆可预约时段") | 
|---|
|  |  |  | @GetMapping("/carCanReservationDate") | 
|---|
|  |  |  | public ApiResponse<List<DateIntervalVO>> carCanReservationDate (@RequestParam Integer carId, @RequestParam String dateDay, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | return ApiResponse.success(carUseBookService.checkDateUse(carId,dateDay)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("申请撤销") | 
|---|
|  |  |  | @GetMapping("/revoke") | 
|---|
|  |  |  | public ApiResponse  revoke (@RequestParam Integer id, @RequestParam String info, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | carUseBookService.revoke(id,info,getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success("操作成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|