zhangzengfei
2024-07-29 155737d95e7143ffe01cf91749fc601a10cfd7a7
添加录像通知
1个文件已添加
3个文件已修改
23 ■■■■■ 已修改文件
config/config.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
controller/captureCtl.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
repository/captureRepo.go 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vo/record.go 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/config.go
@@ -48,8 +48,8 @@
    ReportServer   string `mapstructure:"report-server"`
    ReportInterval int    `mapstructure:"report-interval"`
    RetryInterval  int    `mapstructure:"retry-interval"`
    Enable         bool   `mapstructure:"enable"`
    FTPServer      string `mapstructure:"ftp-server"`
    RecordServer   string `mapstructure:"record-server"`
}
type image struct {
controller/captureCtl.go
@@ -82,6 +82,10 @@
        go a.Repository.FaceForward(req.FaceListObject.FaceObject)
    }
    if config.ForwardConf.RecordServer != "" {
        go a.Repository.PubRecordMessage(face.DeviceID, face.FaceID)
    }
    rspMsg := vo.ResponseStatus{
        RequestURL:   c.FullPath(),
        StatusCode:   vo.StatusSuccess,
repository/captureRepo.go
@@ -318,3 +318,14 @@
    return
}
func (c CaptureRepository) PubRecordMessage(deviceId, msgId string) {
    var msg = vo.RecordMsg{
        CamId: deviceId,
        MsgId: msgId,
    }
    body, _ := json.Marshal(&msg)
    util.HttpPost(config.ForwardConf.RecordServer, nil, body)
}
vo/record.go
New file
@@ -0,0 +1,6 @@
package vo
type RecordMsg struct {
    CamId string
    MsgId string
}