Merge branch 'master' of http://192.168.1.14:10010/r/webserver
| | |
| | | |
| | | 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 根据类型查找字典 |
| | |
| | | ) |
| | | |
| | | type EventPushController struct { |
| | | |
| | | } |
| | | |
| | | type EventPushVo struct { |
| | |
| | | "webserver/extend/util" |
| | | "webserver/models" |
| | | "webserver/service" |
| | | |
| | | ) |
| | | |
| | | type FileController struct { |
| | |
| | | util.ResponseFormat(c, code.Success, field) |
| | | } |
| | | } |
| | | |
| | | // @Description 人员照片上传并获取特征值 |
| | | // @Router /data/api-v/dbperson/fileUploadTest [POST] |
| | | func (controller FileController) UploadPersonTest(c *gin.Context){ |
| | |
| | | feat := features[0]["feature"].([]byte) // linux |
| | | if len(feat) != 2560 { // linux |
| | | return field,nil,errors.New("NotFeatureFindError") |
| | | |
| | | } */ // linux |
| | | |
| | | //将上传的图片交人脸检测和人脸提取,获得特征 |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | 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 { |
| | |
| | | } |
| | | |
| | | /**上传方法**/ |
| | | |
| | | |
| | | // @Summary 批量添加底库人员 |
| | | // @Description 依据图片批量添加底库人员 |
| | |
| | | ) |
| | | |
| | | type PollConfigController struct { |
| | | |
| | | } |
| | | |
| | | type PollConfig struct { |
| | |
| | | type PollEnableVo struct { |
| | | Enable bool `json:"enable"` |
| | | } |
| | | |
| | | // @Summary 切换轮询开关 |
| | | // @Description 切换轮询开关 |
| | | // @Produce json |
| | |
| | | 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:"等级"` |
| | | } |
| | | |
| | |
| | | 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,如果是同步库就不需要记录) |
| | | } |
| | | |
| | |
| | | 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) |
| | |
| | | |
| | | 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() { |
| | |
| | | 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"{ |