package com.cloud.retrieve.controller;
|
|
import com.cloud.model.common.Result;
|
import com.cloud.retrieve.service.SearchPhotoService;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.http.MediaType;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.multipart.MultipartFile;
|
|
import java.util.List;
|
import java.util.Map;
|
|
@RequestMapping("/data/api-r")
|
@RestController
|
@Slf4j
|
public class SearchPhotoController {
|
|
@Autowired
|
private SearchPhotoService searchPhotoService;
|
/**
|
* 切图 pl
|
*/
|
@ApiOperation(value = "findLikerPics",notes = "切图",httpMethod = "POST",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
@RequestMapping("/SearchPhoto/extractFace")
|
public Result extractFace(MultipartFile file,int picQuality) {
|
Map map = searchPhotoService.extractFace(file,picQuality);
|
return Result.custom("切图成功!",0,true,map);
|
}
|
|
/**
|
* 以图搜图 pl
|
*/
|
@ApiOperation(value = "findLikerPics",notes = "以图搜图 " +
|
"{\"liker\":60,\"path\":\"group2/M00/06/E3/wKgBnFxjuZ6AMyRuAABoYKTnHOg209.jpg\"," +
|
"\"page\":1,\"length\":3,\"startDate\":\"2019-01-12 12:00:00\"," +
|
"\"endDate\":\"2019-02-12 12:00:00\"}",httpMethod = "POST",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
@RequestMapping("/SearchPhoto/findLikerPics")
|
public Result findLikerPics(@RequestBody Map<String,Object> params) {
|
|
Map map = searchPhotoService.findLikerPics(params);
|
return Result.custom("查询结束!",0,true,map);
|
|
}
|
}
|