shop_product_image.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. package fetdata
  2. import (
  3. "golang-fave/engine/wrapper"
  4. "golang-fave/utils"
  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 "/api/product-image/thumb-0/" + utils.IntToStr(this.object.A_product_id) + "/" + this.object.A_filename
  36. }
  37. func (this *ShopProductImage) Thumbnail1() string {
  38. if this == nil {
  39. return ""
  40. }
  41. return "/api/product-image/thumb-1/" + utils.IntToStr(this.object.A_product_id) + "/" + this.object.A_filename
  42. }
  43. func (this *ShopProductImage) Thumbnail2() string {
  44. if this == nil {
  45. return ""
  46. }
  47. return "/api/product-image/thumb-2/" + utils.IntToStr(this.object.A_product_id) + "/" + this.object.A_filename
  48. }
  49. func (this *ShopProductImage) Thumbnail3() string {
  50. if this == nil {
  51. return ""
  52. }
  53. return "/api/product-image/thumb-3/" + utils.IntToStr(this.object.A_product_id) + "/" + this.object.A_filename
  54. }
  55. func (this *ShopProductImage) ThumbnailSize0() [2]int {
  56. return (*this.wrap.Config).Shop.Thumbnails.Thumbnail0
  57. }
  58. func (this *ShopProductImage) ThumbnailSize1() [2]int {
  59. return (*this.wrap.Config).Shop.Thumbnails.Thumbnail1
  60. }
  61. func (this *ShopProductImage) ThumbnailSize2() [2]int {
  62. return (*this.wrap.Config).Shop.Thumbnails.Thumbnail2
  63. }
  64. func (this *ShopProductImage) ThumbnailSize3() [2]int {
  65. return (*this.wrap.Config).Shop.Thumbnails.Thumbnail3
  66. }