content.go 1.0 KB

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