| | |
| | | package com.oying.modules.pc.product.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.oying.exception.EntityNotFoundException; |
| | | import com.oying.modules.pc.product.domain.Product; |
| | | import com.oying.modules.pc.product.domain.dto.ProductQueryCriteria; |
| | | import com.oying.modules.pc.product.mapper.ProductMapper; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author lzp |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Product getProduct(Long productId) { |
| | | Product existingProduct = getById(productId); |
| | | if (ObjUtil.isEmpty(existingProduct)) { |
| | | throw new EntityNotFoundException(Product.class, "id", Optional.ofNullable(productId).map(Object::toString).orElse("null")); |
| | | } |
| | | return existingProduct; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void create(Product resources) { |
| | | productMapper.insert(resources); |