liuxiaolong
2019-05-06 f99bc8c6a1d10610373738edd7d0aa0181c81d99
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
package com.cloud.user.controller;
 
import java.util.Map;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import com.cloud.model.common.Page;
import com.cloud.user.model.BbFace;
import com.cloud.user.service.BbFaceService;
import com.cloud.user.vo.BbFaceVO;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
 
/**
 * 人脸特征
 * 控制层
 */
@RequestMapping("data/api-u")
@RestController
@Api(value = "BbFaceController", description = "人脸特征操作控制层")
public class BbFaceController {
 
    @Autowired
    private BbFaceService service;
        
    /**
     * 添加
     */
    @ApiOperation(value = "添加人脸特征", notes = "BbFace添加模块", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiImplicitParams({
        @ApiImplicitParam(name = "jsonData", value = "人脸特征json表示", required = true)
    })
    @RequestMapping("/BbFace/add")
    public BbFace add(String jsonData) {
        return service.addBbFace(BbFaceVO.beanVOFromJson(jsonData));
    }
        
    /**
     * 去编辑
     */
    @ApiOperation(value = "去编辑人脸特征", notes = "根据id,orgId查询要编辑的人脸特征信息", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "主键id", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "orgId", value = "组织机构id", required = false, dataType = "Long")
    })
    @RequestMapping("/BbFace/toUpdate")
    public BbFace toUpdate(Long id, Long orgId) {
        return service.toUpdateBbFace(id, orgId);
    }
        
    /**
     * 编辑
     */
    @ApiOperation(value = "编辑人脸特征", notes = "编辑人脸特征信息", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "jsonData", value = "人脸特征json表示", required = true)
    })
    @RequestMapping("/BbFace/update")
    public BbFace update(String jsonData) {
        return service.updateBbFace(BbFaceVO.beanVOFromJson(jsonData));
    }
 
    /**
     * 列表
     */
    @ApiOperation(value = "查询人脸特征列表", notes = "根据用户条件查询人脸特征信息列表", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "params", value = "orgId:机构id,start:分页开始位置,length:每页大小", required = false)
    })
    @RequestMapping("/BbFace/list")
    public Page<BbFace> findBbFaces(@RequestParam Map<String, Object> params) {
        return service.findBbFaces(params);
    }
    
    /**
     * 删除
     * @param id 主键
     */
    @ApiOperation(value = "删除人脸特征", notes = "根据用户id,orgId删除人脸特征信息", httpMethod = "GET", produces = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "主键id", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "orgId", value = "组织机构id", required = false, dataType = "Long")
    })
    @RequestMapping("/BbFace/delete")
    public Integer delete(Long id, Long orgId) {
        return service.deleteById(id, orgId);
    }
 
    /**
     * 根据人脸ID得到人员ID
     * @param params
     * @param access_token
     * @return
     */
    @RequestMapping("/BbFace/findEmpIdByFaceId")
    @ApiOperation(value = "根据人脸ID得到人员ID", notes = "根据人脸ID得到人员ID", httpMethod = "GET", produces = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "faceId", value = "人脸ID", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "orgId", value = "组织机构id", required = false, dataType = "Long")
    })
    public Map<String,Object> findEmpIdByFaceId(@RequestParam Map<String, Object> params,@RequestParam String access_token){
        return service.findEmpIdByFaceId(params);
    }
}