content.go 892 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package fetdata
  2. import (
  3. "html/template"
  4. "time"
  5. "golang-fave/utils"
  6. )
  7. func (this *FERData) Name() string {
  8. if this.Wrap.CurrModule == "index" {
  9. return this.DataRow.(*utils.MySql_page).A_name
  10. }
  11. return ""
  12. }
  13. func (this *FERData) Alias() string {
  14. if this.Wrap.CurrModule == "index" {
  15. return this.DataRow.(*utils.MySql_page).A_alias
  16. }
  17. return ""
  18. }
  19. func (this *FERData) Content() template.HTML {
  20. if this.Wrap.CurrModule == "index" {
  21. return template.HTML(this.DataRow.(*utils.MySql_page).A_content)
  22. }
  23. return template.HTML("")
  24. }
  25. func (this *FERData) DateTime() int {
  26. if this.Wrap.CurrModule == "index" {
  27. return this.DataRow.(*utils.MySql_page).A_datetime
  28. }
  29. return 0
  30. }
  31. func (this *FERData) DateTimeFormat(format string) string {
  32. if this.Wrap.CurrModule == "index" {
  33. return time.Unix(int64(this.DataRow.(*utils.MySql_page).A_datetime), 0).Format(format)
  34. }
  35. return ""
  36. }