feiyu02
2025-09-30 6904763f0e74d9a9fa4dbc39f635d2aee39416c6
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
35
36
37
38
39
40
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)
}