blog_category.go 968 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package fetdata
  2. import (
  3. "golang-fave/utils"
  4. )
  5. type BlogCategory struct {
  6. object *utils.MySql_blog_category
  7. depth int
  8. }
  9. func (this *BlogCategory) Id() int {
  10. if this == nil {
  11. return 0
  12. }
  13. return this.object.A_id
  14. }
  15. func (this *BlogCategory) User() int {
  16. if this == nil {
  17. return 0
  18. }
  19. return this.object.A_user
  20. }
  21. func (this *BlogCategory) Name() string {
  22. if this == nil {
  23. return ""
  24. }
  25. return this.object.A_name
  26. }
  27. func (this *BlogCategory) Alias() string {
  28. if this == nil {
  29. return ""
  30. }
  31. return this.object.A_alias
  32. }
  33. func (this *BlogCategory) Left() int {
  34. if this == nil {
  35. return 0
  36. }
  37. return this.object.A_lft
  38. }
  39. func (this *BlogCategory) Right() int {
  40. if this == nil {
  41. return 0
  42. }
  43. return this.object.A_rgt
  44. }
  45. func (this *BlogCategory) Permalink() string {
  46. if this == nil {
  47. return ""
  48. }
  49. return "/blog/category/" + this.object.A_alias + "/"
  50. }
  51. func (this *BlogCategory) Level() int {
  52. if this == nil {
  53. return 0
  54. }
  55. return this.depth
  56. }