Class ProductDTO

java.lang.Object
com.goldenleaf.shop.dto.ProductDTO

public class ProductDTO extends Object
Data Transfer Object for creating, updating or returning product information.

Used in:

  • Product catalog API (list, details)
  • Admin panel – product management
  • Search and filtering operations
  • Cart and order processing

Note: For performance and security, consider using separate DTOs:

  • ProductListDTO – minimal data for catalog listings
  • ProductDetailsDTO – full data including reviews and images

Since:
1.0
  • Constructor Details

    • ProductDTO

      public ProductDTO()
      Required for JSON deserialization
    • ProductDTO

      public ProductDTO(Long id, String name, String brand, double price, List<String> imageUrls, Set<Long> categoryIds, List<Long> reviewIds)
  • Method Details

    • getId

      public Long getId()
    • setId

      public void setId(Long id)
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • getBrand

      public String getBrand()
    • setBrand

      public void setBrand(String brand)
    • getPrice

      public double getPrice()
    • setPrice

      public void setPrice(double price)
    • getImageUrls

      public List<String> getImageUrls()
    • setImageUrls

      public void setImageUrls(List<String> imageUrls)
    • getCategoryIds

      public Set<Long> getCategoryIds()
    • setCategoryIds

      public void setCategoryIds(Set<Long> categoryIds)
    • getReviewIds

      public List<Long> getReviewIds()
    • setReviewIds

      public void setReviewIds(List<Long> reviewIds)
    • toString

      public String toString()
      Overrides:
      toString in class Object