es.go 565 B

1234567891011121314151617181920
  1. package dao
  2. import (
  3. "context"
  4. "go-common/library/log"
  5. )
  6. // UpdateUserTag 更新举报对象的第一个用户tag
  7. func (d *Dao) UpdateUserTag(c context.Context, gid int64, userTid int32) (err error) {
  8. us := d.es.NewUpdate("workflow_group_common").Insert()
  9. data := map[string]int64{"id": gid, "first_user_tid": int64(userTid)}
  10. us.AddData("workflow_group_common", data)
  11. if err = us.Do(c); err != nil {
  12. log.Error("failed upsert elastic error(%v)", err)
  13. return
  14. }
  15. log.Info("gid(%d) has first user complain tid(%d) success upsert", gid, userTid)
  16. return
  17. }