shop_product_image.go 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. package fetdata
  2. import (
  3. "golang-fave/engine/utils"
  4. "golang-fave/engine/wrapper"
  5. )
  6. type ShopProductImage struct {
  7. wrap *wrapper.Wrapper
  8. object *utils.MySql_shop_product_image
  9. }
  10. func (this *ShopProductImage) load() *ShopProductImage {
  11. return this
  12. }
  13. func (this *ShopProductImage) ProductId() int {
  14. if this == nil {
  15. return 0
  16. }
  17. return this.object.A_product_id
  18. }
  19. func (this *ShopProductImage) FileName() string {
  20. if this == nil {
  21. return ""
  22. }
  23. return this.object.A_filename
  24. }
  25. func (this *ShopProductImage) FullImage() string {
  26. if this == nil {
  27. return ""
  28. }
  29. return "/products/images/" + utils.IntToStr(this.object.A_product_id) + "/" + this.object.A_filename
  30. }
  31. func (this *ShopProductImage) Thumbnail0() string {
  32. if this == nil {
  33. return ""
  34. }
  35. return "/products/images/" + utils.IntToStr(this.object.A_product_id) + "/thumb-0-" + this.object.A_filename
  36. }
  37. func (this *ShopProductImage) Thumbnail1() string {
  38. if this == nil {
  39. return ""
  40. }
  41. return "/products/images/" + utils.IntToStr(this.object.A_product_id) + "/thumb-1-" + this.object.A_filename
  42. }
  43. func (this *ShopProductImage) Thumbnail2() string {
  44. if this == nil {
  45. return ""
  46. }
  47. return "/products/images/" + utils.IntToStr(this.object.A_product_id) + "/thumb-2-" + this.object.A_filename
  48. }
  49. func (this *ShopProductImage) Thumbnail3() string {
  50. if this == nil {
  51. return ""
  52. }
  53. return "/products/images/" + utils.IntToStr(this.object.A_product_id) + "/thumb-3-" + this.object.A_filename
  54. }
  55. func (this *ShopProductImage) ThumbnailFull() string {
  56. if this == nil {
  57. return ""
  58. }
  59. return "/products/images/" + utils.IntToStr(this.object.A_product_id) + "/thumb-full-" + this.object.A_filename
  60. }
  61. func (this *ShopProductImage) ThumbnailSize0() [2]int {
  62. return [2]int{
  63. (*this.wrap.Config).Shop.Thumbnails.Thumbnail0[0],
  64. (*this.wrap.Config).Shop.Thumbnails.Thumbnail0[1],
  65. }
  66. }
  67. func (this *ShopProductImage) ThumbnailSize1() [2]int {
  68. return [2]int{
  69. (*this.wrap.Config).Shop.Thumbnails.Thumbnail1[0],
  70. (*this.wrap.Config).Shop.Thumbnails.Thumbnail1[1],
  71. }
  72. }
  73. func (this *ShopProductImage) ThumbnailSize2() [2]int {
  74. return [2]int{
  75. (*this.wrap.Config).Shop.Thumbnails.Thumbnail2[0],
  76. (*this.wrap.Config).Shop.Thumbnails.Thumbnail2[1],
  77. }
  78. }
  79. func (this *ShopProductImage) ThumbnailSize3() [2]int {
  80. return [2]int{
  81. (*this.wrap.Config).Shop.Thumbnails.Thumbnail3[0],
  82. (*this.wrap.Config).Shop.Thumbnails.Thumbnail3[1],
  83. }
  84. }
  85. func (this *ShopProductImage) ThumbnailSizeFull() [2]int {
  86. return [2]int{
  87. (*this.wrap.Config).Shop.Thumbnails.ThumbnailFull[0],
  88. (*this.wrap.Config).Shop.Thumbnails.ThumbnailFull[1],
  89. }
  90. }