package cn.flightfeather.supervision.lightshare.web
|
|
import cn.flightfeather.supervision.lightshare.service.ScheduleService
|
import cn.flightfeather.supervision.lightshare.vo.ScheduleOption
|
import io.swagger.annotations.Api
|
import io.swagger.annotations.ApiOperation
|
import io.swagger.annotations.ApiParam
|
import org.springframework.web.bind.annotation.*
|
|
@Api(tags = ["环保日程API接口"])
|
@RestController
|
@RequestMapping("/schedule")
|
class ScheduleController(private val scheduleService: ScheduleService){
|
|
@ApiOperation(value = "获取某种类型的日程")
|
@PostMapping("/get")
|
fun getSchedules(
|
@ApiParam("日程查询参数") @RequestBody option: ScheduleOption,
|
) = scheduleService.getSchedules(option)
|
|
// @ApiOperation(value = "获取用户整个年度的日程")
|
// @PostMapping("/get/year")
|
// fun getYearSchedules(
|
// @ApiParam("日程查询参数") @RequestBody option: ScheduleOption,
|
// ) = resPack { scheduleService.getYearSchedules(option) }
|
|
@ApiOperation(value = "用户完成某项日程")
|
@PostMapping("/complete")
|
fun completeSchedule(
|
@ApiParam("用户id") @RequestParam userId: String,
|
@ApiParam("日程id") @RequestParam id: Int,
|
) = scheduleService.completeSchedule(userId, id)
|
|
@ApiOperation(value = "用户撤销某项日程的完成状态")
|
@PostMapping("/revoke")
|
fun revokeSchedule(
|
@ApiParam("用户id") @RequestParam userId: String,
|
@ApiParam("完成记录id") @RequestParam recordId: Int,
|
) = scheduleService.revokeSchedule(userId, recordId)
|
}
|