feiyu02
2025-09-30 94fee0b511279679b43e210878d3d36e5a14384b
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
41
42
43
44
45
46
package com.flightfeather.uav.lightshare.web
 
import com.flightfeather.uav.domain.entity.Mission
import com.flightfeather.uav.lightshare.service.MissionService
import io.swagger.annotations.Api
import org.springframework.web.bind.annotation.*
import javax.servlet.http.HttpServletResponse
 
@Api(tags = ["走航监测任务API接口"])
@RestController
@RequestMapping("air/mission")
class MissionController(private val missionService: MissionService) {
 
    @GetMapping("/type")
    fun getMission(
        @RequestParam(value = "type", required = false) type: String?,
        @RequestParam(value = "page", required = false) page: Int?,
        @RequestParam(value = "perPage", required = false) perPage: Int?
    ) = resPack { missionService.getMission(type, page, perPage) }
 
    @PostMapping("/create")
    fun createMission(
        @RequestBody mission: Mission
    ) = resPack { missionService.createMission(mission) }
 
    @PostMapping("/update")
    fun updateMission(
        @RequestBody mission: Mission
    ) = resPack { missionService.updateMission(mission) }
 
    @PostMapping("/delete")
    fun deleteMission(
        @RequestParam("missionCode") missionCode: String
    ) = resPack { missionService.deleteMission(missionCode) }
 
    @PostMapping("/delete/data/vehicle")
    fun deleteMissionAndData(
        @RequestParam("missionCode") missionCode: String
    ) = resPack { missionService.deleteMissionAndData(missionCode) }
 
    @GetMapping("/report")
    fun getReport(
        @RequestParam missionCode: String,
        response: HttpServletResponse,
    ) = missionService.getReport(missionCode, response)
}