journal.go 965 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package http
  2. import (
  3. "fmt"
  4. bm "go-common/library/net/http/blademaster"
  5. )
  6. // searchLogAudit .
  7. func searchLogAudit(c *bm.Context) {
  8. var (
  9. err error
  10. result []byte
  11. )
  12. if result, err = mngSvc.SearchLogAudit(c); err != nil {
  13. c.Bytes(-500, "application/csv", nil)
  14. return
  15. }
  16. c.Writer.Header().Set("Content-Type", "application/csv")
  17. c.Writer.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=%s.csv", "Authority_Record"))
  18. c.Writer.Write([]byte("\xEF\xBB\xBF"))
  19. c.Writer.Write(result)
  20. }
  21. // searchLogAction .
  22. func searchLogAction(c *bm.Context) {
  23. var (
  24. err error
  25. result []byte
  26. )
  27. if result, err = mngSvc.SearchLogAction(c); err != nil {
  28. c.Bytes(-500, "application/csv", nil)
  29. return
  30. }
  31. c.Writer.Header().Set("Content-Type", "application/csv")
  32. c.Writer.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=%s.csv", "Authority_Record"))
  33. c.Writer.Write([]byte("\xEF\xBB\xBF"))
  34. c.Writer.Write(result)
  35. }