guyue
4 天以前 89f8649e8cf9bc12b9e29abb0adc4f9b77273143
src/main/java/com/linghu/controller/PlatformController.java
@@ -23,6 +23,7 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -57,6 +58,7 @@
    }
    @DeleteMapping("/{platformId}")
    @ApiOperation(value = "删除平台")
    public ResponseResult<Void> delete(@PathVariable Integer platformId) {
        boolean success = platformService.removeById(platformId);
        if (success) {
@@ -66,6 +68,7 @@
    }
    @PutMapping
    @ApiOperation(value = "更新平台")
    public ResponseResult<Void> update(@RequestBody Platform platform) {
        // 校验平台名称和域名不能为空
        if (!StringUtils.hasText(platform.getPlatform_name())) {
@@ -83,6 +86,7 @@
    }
    @GetMapping("/{platformId}")
    @ApiOperation("根据id获取平台")
    public ResponseResult<Platform> getById(@PathVariable Integer platformId) {
        Platform platform = platformService.getById(platformId);
        if (platform != null) {
@@ -92,6 +96,7 @@
    }
    @GetMapping("/list")
    @ApiOperation("查询平台列表,不传页数和大小就查全部")
    public ResponseResult<List<Platform>> list(
            @RequestParam(required = false) Integer page,
            @RequestParam(required = false) Integer pageSize) {
@@ -165,7 +170,7 @@
                platform.setType_id(typeByName.getType_id());
                // 设置创建时间(解决之前的数据库错误)
                platform.setCreate_time(new Date());
                platform.setCreate_time(LocalDateTime.now());
                platforms.add(platform);
            }