|
|
@ -1,42 +0,0 @@ |
|
|
|
package com.qyft.gd.controller.demo; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.qyft.gd.model.entity.demo.DemoCollectInfo; |
|
|
|
import com.qyft.gd.service.demo.IDemoCollectInfoService; |
|
|
|
import com.qyft.gd.system.common.result.PageResult; |
|
|
|
import com.qyft.gd.system.common.result.Result; |
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
|
import jakarta.validation.Valid; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
import org.springframework.web.bind.annotation.PathVariable; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
@Slf4j |
|
|
|
@Tag(name = "测试测试测试") |
|
|
|
@RestController |
|
|
|
@RequestMapping("api/demo") |
|
|
|
@RequiredArgsConstructor |
|
|
|
public class DemoController { |
|
|
|
|
|
|
|
private final IDemoCollectInfoService demoCollectInfoService; |
|
|
|
|
|
|
|
@Operation(summary = "分页列表") |
|
|
|
@GetMapping(value = "/list") |
|
|
|
public PageResult<DemoCollectInfo> queryList() { |
|
|
|
log.info("调用了分页接口"); |
|
|
|
IPage<DemoCollectInfo> result = demoCollectInfoService.page(new Page<DemoCollectInfo>(1, 10), null); |
|
|
|
return PageResult.success(result); |
|
|
|
} |
|
|
|
|
|
|
|
@Operation(summary = "查询") |
|
|
|
@GetMapping(value = "/{id}") |
|
|
|
public Result<?> queryById(@Valid @PathVariable Long id) { |
|
|
|
return Result.success(demoCollectInfoService.getById(id)); |
|
|
|
} |
|
|
|
|
|
|
|
} |