golang-im聊天
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 years ago
12345678910111213141516171819202122232425
  1. package util
  2. import (
  3. "database/sql"
  4. "gim/pkg/logger"
  5. "gim/pkg/util/uid"
  6. )
  7. var (
  8. MessageBodyIdUid *uid.Uid
  9. DeviceIdUid *uid.Uid
  10. )
  11. const (
  12. DeviceIdBusinessId = "device_id" // 设备id
  13. )
  14. func InitUID(db *sql.DB) {
  15. var err error
  16. DeviceIdUid, err = uid.NewUid(db, DeviceIdBusinessId, 5)
  17. if err != nil {
  18. logger.Sugar.Error(err)
  19. panic(err)
  20. }
  21. }