| | |
| | | import cn.flightfeather.supervision.domain.entity.Version |
| | | import cn.flightfeather.supervision.lightshare.service.VersionService |
| | | import io.swagger.annotations.Api |
| | | import io.swagger.annotations.ApiOperation |
| | | import io.swagger.annotations.ApiParam |
| | | import org.springframework.web.bind.annotation.* |
| | | import org.springframework.web.multipart.MultipartFile |
| | | import springfox.documentation.annotations.ApiIgnore |
| | | |
| | | @Api(tags = ["系统相关API接口"]) |
| | | @RestController |
| | | @RequestMapping("/version") |
| | | class VersionController(val versionService: VersionService) { |
| | | |
| | | @ApiIgnore |
| | | @PutMapping("") |
| | | fun add(@RequestBody version: Version) = versionService.save(version) |
| | | |
| | | @ApiIgnore |
| | | @PostMapping("") |
| | | fun update(@RequestBody version: Version) = versionService.update(version) |
| | | |
| | | @ApiIgnore |
| | | @DeleteMapping("/{id}") |
| | | fun delete(@PathVariable id: String) = versionService.delete(id) |
| | | |
| | | @ApiOperation(value = "获取最新app版本信息") |
| | | @GetMapping("/latest") |
| | | fun getLatestVersion() = versionService.getLatestVersion() |
| | | |
| | | @ApiOperation(value = "上传错误日志") |
| | | @PostMapping("/crashInfo/upLoad") |
| | | fun upLoadCrashInfo( |
| | | @RequestParam("userId") userId: String, |
| | | @RequestPart("files") files: Array<MultipartFile> |
| | | @ApiParam("用户id") @RequestParam("userId") userId: String, |
| | | @ApiParam("错误日志") @RequestPart("files") files: Array<MultipartFile> |
| | | ) = versionService.upLoadCrashInfo(userId, files) |
| | | |
| | | } |