张晓波
2023-10-13 bff2fbdfda25eb57dab169f28d48f1621beb981b
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
package com.thhy.staff.modules.biz.face.controller;
 
import com.alibaba.fastjson.JSONObject;
import com.thhy.general.common.BasicResult;
import com.thhy.staff.modules.biz.face.entity.FaceResult;
import com.thhy.staff.modules.biz.face.service.FaceDeviceService;
import com.thhy.staff.modules.biz.face.service.FaceServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
@RestController
@RequestMapping("face")
public class FaceController {
 
    @Autowired
    private FaceServer faceServer;
 
    @Autowired
    private FaceDeviceService deviceService;
 
    @RequestMapping("/device/login")
    public FaceResult login(@RequestBody String mess){
        FaceResult faceResult = faceServer.login(mess);
        return faceResult;
    }
 
 
    @RequestMapping("/syncPerson")
    public JSONObject syncPerson(@RequestBody String mess){
        JSONObject jsonObject = faceServer.syncPerson(mess);
        return jsonObject;
    }
 
    @RequestMapping("/syncPersonSingle")
    public JSONObject syncPersonSingle(@RequestBody String mess){
        JSONObject jsonObject = faceServer.syncPersonSingle(mess);
        return jsonObject;
    }
 
    @RequestMapping("/sp/notify")
    public JSONObject personNotify(@RequestBody String mess){
        faceServer.personNotify(mess);
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("code",0);
        jsonObject.put("msg","OK");
        jsonObject.put("success",true);
        return jsonObject;
    }
}