feiyu02
2024-08-15 196bb14112448857a885e32dc4149e308e00b01a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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("/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)
}