feiyu02
2024-01-10 30a53b41f09d2eefd33513a409d472c2166ba1ea
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
package cn.flightfeather.supervision.lightshare.web
 
import cn.flightfeather.supervision.domain.ds1.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 = ["VersionController"], description = "移动端App相关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)
}