|
@ -0,0 +1,54 @@ |
|
|
|
|
|
package com.iflytop.gd.app.controller; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
|
import com.iflytop.gd.app.model.entity.Photos; |
|
|
|
|
|
import com.iflytop.gd.app.service.api.PhotosService; |
|
|
|
|
|
import com.iflytop.gd.common.base.BasePageQuery; |
|
|
|
|
|
import com.iflytop.gd.common.result.PageResult; |
|
|
|
|
|
import com.iflytop.gd.common.result.Result; |
|
|
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 照片接口 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Tag(name = "认证") |
|
|
|
|
|
@RestController |
|
|
|
|
|
@RequestMapping("/api/photo") |
|
|
|
|
|
@RequiredArgsConstructor |
|
|
|
|
|
@Slf4j |
|
|
|
|
|
public class PhotoController { |
|
|
|
|
|
|
|
|
|
|
|
private final PhotosService photosService; |
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "照片列表") |
|
|
|
|
|
@GetMapping("/list") |
|
|
|
|
|
public PageResult<Photos> getList(BasePageQuery pageQuery) { |
|
|
|
|
|
LambdaQueryWrapper<Photos> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
queryWrapper.orderByDesc(Photos::getCreateTime); |
|
|
|
|
|
IPage<Photos> result = photosService.page(new Page<>(pageQuery.getPageNum(), pageQuery.getPageSize()), queryWrapper); |
|
|
|
|
|
return PageResult.success(result); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "拍摄一张照片") |
|
|
|
|
|
@GetMapping("/take") |
|
|
|
|
|
public Result<String> take() { |
|
|
|
|
|
return Result.success("http://127.0.0.1/photos/temp/1.png"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "保存照片") |
|
|
|
|
|
@GetMapping("/save") |
|
|
|
|
|
public Result<?> save(Photos photos) { |
|
|
|
|
|
return Result.success(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |