You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.5 KiB
55 lines
1.5 KiB
package com.iflytop.gd.app.controller;
|
|
|
|
import com.iflytop.gd.app.model.dto.PhotoSaveDTO;
|
|
import com.iflytop.gd.app.model.vo.PhotoListVO;
|
|
import com.iflytop.gd.app.model.vo.PhotoVO;
|
|
import com.iflytop.gd.app.service.api.PhotosService;
|
|
import com.iflytop.gd.common.base.BasePageQuery;
|
|
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.*;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 照片接口
|
|
*/
|
|
@Tag(name = "认证")
|
|
@RestController
|
|
@RequestMapping("/api/photo")
|
|
@RequiredArgsConstructor
|
|
@Slf4j
|
|
public class PhotoController {
|
|
private final PhotosService photosService;
|
|
|
|
@Operation(summary = "照片列表")
|
|
@GetMapping("/list")
|
|
public Result<List<PhotoListVO>> getList(BasePageQuery pageQuery) {
|
|
return Result.success(photosService.getList(pageQuery));
|
|
}
|
|
|
|
@Operation(summary = "拍摄一张照片")
|
|
@GetMapping("/{id}")
|
|
public Result<PhotoVO> show(@PathVariable Long id) {
|
|
return Result.success(photosService.show(id));
|
|
}
|
|
|
|
|
|
@Operation(summary = "拍摄一张照片")
|
|
@GetMapping("/take")
|
|
public Result<String> take() {
|
|
return Result.success(photosService.take());
|
|
}
|
|
|
|
|
|
@Operation(summary = "保存照片")
|
|
@PostMapping("/save")
|
|
public Result<?> save(@RequestBody PhotoSaveDTO photoSaveDTO) {
|
|
return Result.success();
|
|
}
|
|
|
|
|
|
}
|