liuxiaolong
2019-06-28 5e31a32f6ce2572cb01388150ddb325724ff15b8
Merge branch 'master' of http://192.168.1.14:10010/r/webserver
10个文件已修改
39 ■■■■ 已修改文件
controllers/camera.go 补丁 | 查看 | 原始文档 | blame | 历史
controllers/dictionary.go 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/eventPush.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/fileController.go 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/pollConfig.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
middlewares/auth/jwt.go 补丁 | 查看 | 原始文档 | blame | 历史
models/dbtablepersons.go 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/dbtables.go 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
router/router.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/FaceSdkService.go 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/camera.go
controllers/dictionary.go
@@ -2,13 +2,12 @@
import (
    "basic.com/dbapi.git"
    "github.com/gin-gonic/gin"
    "webserver/extend/code"
    "webserver/extend/util"
    "github.com/gin-gonic/gin"
)
type DictionaryController struct {
}
// @Summary 根据类型查找字典
controllers/eventPush.go
@@ -8,7 +8,6 @@
)
type EventPushController struct {
}
type EventPushVo struct {
controllers/fileController.go
@@ -17,6 +17,7 @@
    "webserver/extend/util"
    "webserver/models"
    "webserver/service"
)
type FileController struct {
@@ -86,6 +87,7 @@
        util.ResponseFormat(c, code.Success, field)
    }
}
// @Description 人员照片上传并获取特征值
// @Router /data/api-v/dbperson/fileUploadTest [POST]
func (controller FileController) UploadPersonTest(c *gin.Context){
@@ -152,6 +154,7 @@
            feat := features[0]["feature"].([]byte)   // linux
        if len(feat) != 2560 {                                // linux
            return field,nil,errors.New("NotFeatureFindError")
        }    */                     // linux
        //将上传的图片交人脸检测和人脸提取,获得特征
@@ -164,12 +167,15 @@
            }
        }
        dbperson := new(models.Dbtablepersons)
        dbperson.FaceUrl = picIp+field       //  图片路经
        dbperson.FaceFeature = picIp + field //  图片路经
        dbperson.TableId = tableId  //
        dbperson.PersonName = filename // 图片名
        // 演示base64编码
        dbperson.Feature = faceBase64 // 特征值base64 码
        dbperson.FaceFeature = faceBase64 // 特征值base64 码
        result := addDbPerson(dbperson)
        return field, result, nil
    } else {
@@ -192,7 +198,6 @@
}
/**上传方法**/
// @Summary 批量添加底库人员
// @Description  依据图片批量添加底库人员
controllers/pollConfig.go
@@ -9,7 +9,6 @@
)
type PollConfigController struct {
}
type PollConfig struct {
@@ -87,6 +86,7 @@
type PollEnableVo struct {
    Enable bool `json:"enable"`
}
// @Summary 切换轮询开关
// @Description 切换轮询开关
// @Produce json
middlewares/auth/jwt.go
models/dbtablepersons.go
@@ -3,13 +3,12 @@
type Dbtablepersons   struct {
    BaseEntity
    TableId string `json:"tableId,omitempty" example:"库表id"`
    Feature string  `json:"feature,omitempty" example:"人脸特征值"`
    FaceUrl string `json:"faceUrl,omitempty" example:"图片路径"`
    FaceFeature  string `json:"faceFeature,omitempty" example:"人脸特征值"`
    PersonPicUrl string `json:"personPicUrl,omitempty" example:"图片路径"`
    PersonName string `json:"personName,omitempty" example:"人员姓名"`
    Age string `json:"age,omitempty"  example:"年龄"`
    Sex string  `json:"sex,omitempty" example:"性别 男 女"`
    Idcard string `json:"idcard,omitempty" example:"身份证"`
    IdCard       string `json:"idCard,omitempty" example:"身份证"`
    PhoneNum string `json:"phoneNum,omitempty" example:"手机号码"`
    MonitorLevel string `json:"monitorLevel,omitempty" example:"等级"`
}
models/dbtables.go
@@ -8,9 +8,8 @@
    BwType string   `json:"bwType,omitempty" example:"黑名单:1,白名单:0"`  //黑名单:1,白名单:0
    StartTime string  `json:"startTime,omitempty" example:"2019-01-12 12:14:56"` //有效期开始时间
    EndTime string    `json:"endTime,omitempty" example:"2019-10-12 12:14:56"` //有效期结束时间
    UploadFlag string `json:"uploadFlag,omitempty" example:"上传标志"` //
    CmpThreshold string `json:"cmpThreshold,omitempty" example:"45"`// //人脸比对阈值
    SyncType string  `json:"syncType,omitempty" example:"1:同步库,2:本地库"` //是否是同步库(1:同步库,2:本地库)
    Indeviceid string `json:"indeviceid,omitempty" example:"本地库所属的分析设备id,如果是同步库就不需要记录"`// 分析设备id(本地库所属的分析设备id,如果是同步库就不需要记录)
    //UploadFlag string `json:"uploadFlag,omitempty" example:"上传标志"` //
    //CmpThreshold string `json:"cmpThreshold,omitempty" example:"45"`// //人脸比对阈值
    IsSync        string `json:"isSync,omitempty" example:"1:同步库,2:本地库"`                      //是否是同步库(1:同步库,2:本地库)
    AnalyServerId string `json:"analyServerId,omitempty" example:"本地库所属的分析设备id,如果是同步库就不需要记录"` // 分析设备id(本地库所属的分析设备id,如果是同步库就不需要记录)
}
router/router.go
@@ -200,7 +200,7 @@
    r.Static("static", "./static") // 静态文件
    //外部访问swagger.json
    r.StaticFile("/swagger.json", "./docs/swagger.json")
    fileController := new(controllers.FileController)
    vdbperson.POST("/fileupload", fileController.Fileupload)
    vdbperson.POST("/moreFileUpload", fileController.MoreFileUpload)
    r.POST(urlPrefix+"/es/ImageUploadReturnPics", fileController.ImageUploadReturnPics)
service/FaceSdkService.go
@@ -177,11 +177,12 @@
var resultMap map[string][]*protomsg.ResultFaceExtCom
func InitService(){
    fmt.Println("service init!")
    imgPushChan = make(chan []byte)
    resultMap = make(map[string][]*protomsg.ResultFaceExtCom,0)
    client_push = deliver.NewClient(deliver.PushPull, Url_Service_PUSH)
    client_pull = deliver.NewClient(deliver.PushPull, Url_Service_PULL)
    defer func() {
@@ -221,6 +222,7 @@
            perId := rMsg.Cid //数据id
            if rMsg.Tasklab !=nil && rMsg.Tasklab.Taskid == Virtual_FaceTaskId {
                sdkInfos := rMsg.Tasklab.Sdkinfos
                fmt.Println("Len(sdkInfos)=",len(sdkInfos))
                for _,swt :=range sdkInfos{
                    if swt.Sdktype =="FaceDetect"{