|
|
@ -1,7 +1,8 @@ |
|
|
|
package com.qyft.gd.controller; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.qyft.gd.model.entity.Logs; |
|
|
|
import com.qyft.gd.model.entity.Tasks; |
|
|
|
import com.qyft.gd.service.LogsService; |
|
|
|
import com.qyft.gd.system.common.base.BasePageQuery; |
|
|
|
import com.qyft.gd.system.common.result.PageResult; |
|
|
|
import com.qyft.gd.system.common.result.Result; |
|
|
@ -12,27 +13,36 @@ import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@Tag(name = "日志") |
|
|
|
@RestController |
|
|
|
@RequestMapping("/api/logs") |
|
|
|
@RequiredArgsConstructor |
|
|
|
@Slf4j |
|
|
|
public class LogsController { |
|
|
|
private final LogsService logsService; |
|
|
|
@Operation(summary = "日志列表") |
|
|
|
@GetMapping("/list") |
|
|
|
public PageResult<Logs> getAllTasks(BasePageQuery pageQuery) { |
|
|
|
return PageResult.success(null); |
|
|
|
|
|
|
|
return PageResult.success(logsService.page(new Page<>(pageQuery.getPageNum(), pageQuery.getPageSize()))); |
|
|
|
} |
|
|
|
|
|
|
|
@Operation(summary = "日志详情") |
|
|
|
@GetMapping("/") |
|
|
|
public Result<Logs> detail(@RequestParam Long id) { |
|
|
|
return Result.success(null); |
|
|
|
return Result.success(logsService.getBaseMapper().selectById(id)); |
|
|
|
} |
|
|
|
|
|
|
|
@Operation(summary = "删除日志") |
|
|
|
@DeleteMapping("/{ids}") |
|
|
|
public Result<String> deleteLog(@Parameter(description = "日志ID,多个以英文逗号(,)分割") @PathVariable String ids) { |
|
|
|
return Result.success(); |
|
|
|
public Result<Boolean> deleteLog(@Parameter(description = "日志ID,多个以英文逗号(,)分割") @PathVariable String ids) { |
|
|
|
List<Long> idsArr = Arrays.stream(ids.split(",")) |
|
|
|
.map(Long::parseLong) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
return Result.success(logsService.removeByIds(idsArr)); |
|
|
|
} |
|
|
|
} |