liuxiaolong
2019-06-28 5a1127aca977be5f0b853fa436e1bd0aacb0fb28
fix dbtable and person uuid
2个文件已修改
10 ■■■■ 已修改文件
controllers/dbtableperson.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/dbtablesCon.go 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/dbtableperson.go
@@ -49,7 +49,7 @@
func addDbPerson(dbperson *models.Dbtablepersons) (result map[string]interface{}) {
    personId := uuid.NewV4().String() //  以后替代 依据生成规则
    dbperson.Uuid = personId
    dbperson.Id = personId
    dbperson.PriInsert()
    url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport +
        "/" + config.EsInfo.EsIndex.Dbtablepersons.IndexName + "/" + config.EsInfo.EsIndex.Dbtablepersons.IndexType + "/" + personId + "?refresh=wait_for"
@@ -77,7 +77,7 @@
func (dbc DbPersonController) UpdateDbPerson(c *gin.Context) {
    var dbperson models.Dbtablepersons
    c.BindJSON(&dbperson)
    personid := dbperson.Uuid
    personid := dbperson.Id
    if personid == "" {
        util.ResponseFormat(c, code.RequestParamError, nil)
        return
controllers/dbtablesCon.go
@@ -68,8 +68,8 @@
    c.BindJSON(&dbtable)
    uuid := c.Params.ByName("uuid")
    if uuid == "" {
        uuid = dbtable.Uuid
        fmt.Println("body中获取底库uuid")
        uuid = dbtable.Id
        fmt.Println("body中获取底库id")
    }
    url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport +
        "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/" + config.EsInfo.EsIndex.DbTables.IndexType + "/" + uuid + "/_update"
@@ -106,7 +106,7 @@
    dbtable := new(models.Dbtables)
    c.BindJSON(&dbtable)
    tableId := uuid.NewV4().String()
    dbtable.Uuid = tableId
    dbtable.Id = tableId
    url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport +
        "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/" + config.EsInfo.EsIndex.DbTables.IndexType + "/" + tableId
    dbtable.PriInsert() // 添加时间和创建人