package cn.flightfeather.supervision.lightshare.web
|
|
import cn.flightfeather.supervision.domain.entity.Version
|
import cn.flightfeather.supervision.lightshare.service.VersionService
|
import io.swagger.annotations.Api
|
import org.springframework.web.bind.annotation.*
|
import org.springframework.web.multipart.MultipartFile
|
|
@Api(tags = ["系统相关API接口"])
|
@RestController
|
@RequestMapping("/version")
|
class VersionController(val versionService: VersionService) {
|
|
@PutMapping("")
|
fun add(@RequestBody version: Version) = versionService.save(version)
|
|
@PostMapping("")
|
fun update(@RequestBody version: Version) = versionService.update(version)
|
|
@DeleteMapping("/{id}")
|
fun delete(@PathVariable id: String) = versionService.delete(id)
|
|
@GetMapping("/latest")
|
fun getLatestVersion() = versionService.getLatestVersion()
|
|
@PostMapping("/crashInfo/upLoad")
|
fun upLoadCrashInfo(
|
@RequestParam("userId") userId: String,
|
@RequestPart("files") files: Array<MultipartFile>
|
) = versionService.upLoadCrashInfo(userId, files)
|
|
}
|