zhangzengfei
2024-04-29 fe763eba27addfe615d2c107b8984484baef9a23
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
package client
 
import (
    "encoding/json"
    "gat1400Exchange/pkg/logger"
    "gat1400Exchange/util"
    "gat1400Exchange/vo"
)
 
const (
    FacesUrI = "/VIID/Faces"
)
 
func FaceCapture(msg []byte) int {
    if clientStatus != vo.StatusSuccess {
        return clientStatus
    }
 
    rsp, err := util.HttpPost(FacesUrI, headers, msg)
    if err != nil {
        logger.Warn("Post faces failed, %s", err.Error())
        return vo.StatusOtherError
    }
 
    var stat vo.ResponseStatus
    err = json.Unmarshal(rsp, &stat)
    if err != nil {
        logger.Warn("Post faces response unmarshal failed, %s", err.Error())
        return vo.StatusOtherError
    }
 
    logger.Debug("Post faces success.")
    return stat.StatusCode
}