riku
2021-06-30 63d16d75a6f12e783bb36cfe526d9cb518b48823
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
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.*
 
@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?
    ) = missionService.getMission(type, page, perPage)
 
    @PostMapping("/create")
    fun createMission(
        @RequestBody mission: Mission
    ) = missionService.createMission(mission)
 
    @PostMapping("/delete")
    fun deleteMission(
        @RequestParam("missionCode") missionCode: String
    ) = missionService.deleteMission(missionCode)
}