contact_add.go 683 B

123456789101112131415161718192021222324252627
  1. package ent_contact
  2. import (
  3. "context"
  4. ul "data_ent_wuye/ent_util"
  5. "time"
  6. "log"
  7. )
  8. // 增量对于标讯数据...
  9. func InjectContactAddTask(uid string, name string, phone string, email string) {
  10. if phone == "" || uid == "" {
  11. return
  12. }
  13. source_type := 1
  14. create_time := time.Now().Unix()
  15. msgs := GetEntContacts(uid)
  16. if !QueryingExists(msgs, name, phone) {
  17. query := "INSERT INTO information.ent_contact(id,phone,name,email,source_type,create_time,update_time) VALUES(?,?,?,?,?,?,?)"
  18. //插入数据
  19. err := ul.ClickHouseConn.Exec(context.Background(), query, uid, phone, name, email, source_type, create_time, create_time)
  20. if err != nil {
  21. log.Println(err)
  22. }
  23. }
  24. }