admin_operate_record_cache.go 636 B

123456789101112131415161718192021222324252627
  1. package cache
  2. import (
  3. "fmt"
  4. "hongze/hz_crm_api/models/system"
  5. "hongze/hz_crm_api/utils"
  6. )
  7. func AdminOperateRecord(adminId int, realName, uuid, uri, params, ip, userAgent, header string) bool {
  8. record := new(system.AdminOperateRecord)
  9. record.AdminId = adminId
  10. record.RealName = realName
  11. record.Uuid = uuid
  12. record.Uri = uri
  13. record.Params = params
  14. record.Ip = ip
  15. record.UserAgent = userAgent
  16. record.Header = header
  17. if utils.Re == nil {
  18. err := utils.Rc.LPush(utils.CACHE_KEY_ADMIN_OPERATE_RECORD, record)
  19. if err != nil {
  20. fmt.Println("AdminOperateRecord LPush Err:" + err.Error())
  21. }
  22. return true
  23. }
  24. return false
  25. }