liuxiaolong
2019-05-06 0bc4f4c791437b39b8c30624f5c21f8c855dc61d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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);
 
    }
}