package com.farriver.bwf.service.product; import com.farriver.bwf.common.model.ApiData; import com.farriver.bwf.common.model.ApiPageData; import com.farriver.bwf.common.statics.LangConstants; import com.farriver.bwf.data.transferobject.queryobject.product.ProductCategoryQueryObject; import com.farriver.bwf.data.transferobject.queryobject.product.ProductMasterQueryObject; import com.farriver.bwf.service.ServiceBase; import com.farriver.bwf.service.extend.pim.PIMService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cache.annotation.CacheConfig; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; @Service @CacheConfig(cacheNames = "bwf_ProductService_cache") public class ProductService extends ServiceBase { private static final Logger logger = LoggerFactory.getLogger(ProductService.class); @Resource PIMService pimService; public ApiPageData GetProductMasterList(ProductMasterQueryObject queryObject) { if (queryObject == null) { return ApiPageData.error(LangConstants.MSG_ERROR_PARAMETERS); } return pimService.GetProductMasterList(queryObject); } public ApiPageData GetProductListByCategoryId(String categoryid) { if (categoryid == null || categoryid.isEmpty()) return null; return pimService.GetProductListByCategoryId(categoryid); } public ApiData GetProductDetailByMasterId(String masterid) { if (masterid == null || masterid.isEmpty()) return null; return pimService.GetProductDetailByMasterId(masterid); } public ApiPageData GetProductCategoryList(ProductCategoryQueryObject queryObject) { if (queryObject == null) { return ApiPageData.error(LangConstants.MSG_ERROR_PARAMETERS); } return pimService.GetProductCategoryList(queryObject); } public ApiPageData GetProductCategoryWithProductList(ProductCategoryQueryObject queryObject) { if (queryObject == null) { return ApiPageData.error(LangConstants.MSG_ERROR_PARAMETERS); } return pimService.GetProductCategoryWithProductList(queryObject); } public ApiData GetProductCategoryListByParentName(String parentname) { if (parentname == null || parentname.isEmpty()) return null; return pimService.GetProductCategoryListByParentName(parentname); } }