| | |
| | | paramBody := util.Struct2Map(dbperson) |
| | | b, data := pApi.AddDbPerson(paramBody) |
| | | if b { |
| | | util.ResponseFormat(c, code.Success, data) |
| | | util.ResponseFormat(c, code.AddSuccess, data) |
| | | } else { |
| | | util.ResponseFormat(c, code.ServiceInsideError, "") |
| | | util.ResponseFormat(c, code.ComError, "") |
| | | } |
| | | } |
| | | |
| | | |
| | | type MultiCarNo struct { |
| | | TableId string `json:"tableId" binding:"required"` |
| | | CarNos []string `json:"carNos" binding:"required"` |
| | | } |
| | | |
| | | // @Security ApiKeyAuth |
| | | // @Summary 批量添加底库车辆 |
| | | // @Description 批量添加底库车辆 |
| | | // @Accept json |
| | | // @Produce json |
| | | // @Tags dbperson 底库人员 |
| | | // @Param reqBody body controllers.MultiCarNo true "批量车牌号" |
| | | // @Success 200 {string} json "{"code":200, msg:"", success:true}" |
| | | // @Failure 500 {string} json "{"code":500, msg:"", success:false}" |
| | | // @Router /data/api-v/dbperson/multiUploadCarNo [post] |
| | | func (dbc DbPersonController) MultiUploadCarNo(c *gin.Context) { |
| | | var reqBody MultiCarNo |
| | | err := c.BindJSON(&reqBody) |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "") |
| | | return |
| | | } |
| | | logger.Debug("multiUploadCarNo reqBody:", reqBody) |
| | | var pApi dbapi.DbPersonApi |
| | | paramBody := util.Struct2Map(reqBody) |
| | | if pApi.MultiUploadCarNo(paramBody) { |
| | | util.ResponseFormat(c,code.UploadSuccess,"上传成功") |
| | | } else { |
| | | util.ResponseFormat(c,code.ComError,"") |
| | | } |
| | | } |
| | | |
| | |
| | | paramBody := util.Struct2Map(dbperson) |
| | | b, data := pApi.UpdateDbPerson(paramBody) |
| | | if b { |
| | | util.ResponseFormat(c, code.Success, data) |
| | | util.ResponseFormat(c, code.UpdateSuccess, data) |
| | | } else { |
| | | util.ResponseFormat(c, code.ServiceInsideError, "") |
| | | util.ResponseFormat(c, code.UpdateFail, "") |
| | | } |
| | | } |
| | | |
| | |
| | | // Success 请求处理成功 |
| | | Success = &Code{http.StatusOK, true, "请求处理成功"} |
| | | AddSuccess = &Code{http.StatusOK, true, "添加成功"} |
| | | UploadSuccess = &Code{ http.StatusOK, true, "上传成功"} |
| | | UpdateSuccess = &Code{http.StatusOK, true, "更新成功"} |
| | | UpdateFail = &Code{http.StatusBadRequest, false, "更新失败"} |
| | | DelSuccess = &Code{http.StatusOK, true, "删除成功"} |
| | |
| | | go 1.12 |
| | | |
| | | require ( |
| | | basic.com/dbapi.git v0.0.0-20200309083628-e21e6f988638 // indirect |
| | | basic.com/dbapi.git v0.0.0-20200312083548-4b84d53ed3bf // indirect |
| | | basic.com/fileServer/WeedFSClient.git v0.0.0-20190919054037-0182b6c3f5cb |
| | | basic.com/gb28181api.git v0.0.0-20191028082253-472438a8407b |
| | | basic.com/pubsub/cache.git v0.0.0-20190718093725-6a413e1d7d48 |
| | |
| | | basic.com/dbapi.git v0.0.0-20200309083628-e21e6f988638 h1:F6L37lSRGyjfNel9yvvrFtjIP/p3p3JhMnVv9sHcsj8= |
| | | basic.com/dbapi.git v0.0.0-20200309083628-e21e6f988638/go.mod h1:eDXPnxaz6jZPDvBSk7ya7oSASWPCuUEgRTJCjsfKt/Q= |
| | | basic.com/dbapi.git v0.0.0-20200312083548-4b84d53ed3bf h1:d0h3A4bJ6oB2+rHRDA0UJ6FG1zX6HKvIhFfEZyJ7s5Y= |
| | | basic.com/dbapi.git v0.0.0-20200312083548-4b84d53ed3bf/go.mod h1:eDXPnxaz6jZPDvBSk7ya7oSASWPCuUEgRTJCjsfKt/Q= |
| | | basic.com/fileServer/WeedFSClient.git v0.0.0-20190919054037-0182b6c3f5cb h1:fM6DojeInFSCFO+wkba1jtyPiSDqw0jYKi4Tk+e+ka4= |
| | | basic.com/fileServer/WeedFSClient.git v0.0.0-20190919054037-0182b6c3f5cb/go.mod h1:FTryK8BsVLfUplx8a3+l8hJWub6VbAWZCUH7sPRZaso= |
| | | basic.com/gb28181api.git v0.0.0-20191028082253-472438a8407b h1:Qh7x2PY3HA9B404Llq+olY5/YlGYrM58bpOHa2CGcro= |
| | |
| | | vdbperson.POST("/joinDbTable", dbPersonCont.JoinDbTable) |
| | | vdbperson.POST("/move", dbPersonCont.Move) |
| | | vdbperson.POST("/copy", dbPersonCont.Copy) |
| | | |
| | | vdbperson.POST("/multiUploadCarNo", dbPersonCont.MultiUploadCarNo) |
| | | } |
| | | |
| | | // 系统设置 操作 |