riku
2025-08-25 2de612e9b260df2e76d4dd620ca739aa3b6e8c57
src/main/kotlin/com/flightfeather/uav/lightshare/web/MissionController.kt
@@ -4,6 +4,7 @@
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
@@ -15,20 +16,31 @@
        @RequestParam(value = "type", required = false) type: String?,
        @RequestParam(value = "page", required = false) page: Int?,
        @RequestParam(value = "perPage", required = false) perPage: Int?
    ) = missionService.getMission(type, page, perPage)
    ) = resPack { missionService.getMission(type, page, perPage) }
    @PostMapping("/create")
    fun createMission(
        @RequestBody mission: Mission
    ) = missionService.createMission(mission)
    ) = resPack { missionService.createMission(mission) }
    @PostMapping("/update")
    fun updateMission(
        @RequestBody mission: Mission
    ) = resPack { missionService.updateMission(mission) }
    @PostMapping("/delete")
    fun deleteMission(
        @RequestParam("missionCode") missionCode: String
    ) = missionService.deleteMission(missionCode)
    ) = 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)
}