package com.zt.life.modules.mainPart.sysPictureBase.service; 
 | 
  
 | 
import com.zt.common.service.BaseService; 
 | 
import com.zt.life.modules.mainPart.sysPictureBase.dao.SysPictureBaseDao; 
 | 
import com.zt.life.modules.mainPart.sysPictureBase.model.SysPictureBase; 
 | 
import com.zt.modules.oss.service.SysOssService; 
 | 
import org.springframework.beans.factory.annotation.Autowired; 
 | 
import org.springframework.stereotype.Service; 
 | 
import com.zt.common.db.query.QueryFilter; 
 | 
  
 | 
import javax.servlet.http.HttpServletResponse; 
 | 
import javax.validation.constraints.NotNull; 
 | 
import javax.validation.constraints.Null; 
 | 
import java.io.IOException; 
 | 
import java.util.List; 
 | 
  
 | 
  
 | 
/** 
 | 
 * sys_picture_base 
 | 
 * 
 | 
 * @author zt generator  
 | 
 * @since 1.0.0 2024-02-27 
 | 
 */ 
 | 
@Service 
 | 
public class SysPictureBaseService  extends BaseService<SysPictureBaseDao, SysPictureBase> { 
 | 
    /** 
 | 
     * 分页查询 
 | 
     * 
 | 
     * @param queryFilter 
 | 
     * @return 
 | 
     */ 
 | 
    public List<SysPictureBase> page(QueryFilter queryFilter) { 
 | 
        List<SysPictureBase> list = baseDao.getList(queryFilter.getQueryParams()); 
 | 
        return list; 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 删除 
 | 
     * 
 | 
     * @param ids 
 | 
     */ 
 | 
    public void delete(Long[] ids) { 
 | 
        super.deleteLogic(ids); 
 | 
    } 
 | 
  
 | 
    public void updateByDefault(Long id, Integer productType) { 
 | 
        baseDao.updateByDefault(id,productType); 
 | 
    } 
 | 
  
 | 
    public void updateProdeuctImg(Long id, Integer productType,Long pictureBaseId) { 
 | 
        baseDao.updateProdeuctImg(id,productType,pictureBaseId); 
 | 
    } 
 | 
  
 | 
    public SysPictureBase getDefaultImg(Integer productType) { 
 | 
        return baseDao.getDefaultImg(productType); 
 | 
    } 
 | 
    public void getSvgImage(HttpServletResponse response, Long id) { 
 | 
        try { 
 | 
            SysPictureBase data = this.get(id); 
 | 
            String svgContent = data.getSvgContent(); 
 | 
            response.setContentType("image/svg+xml"); 
 | 
            response.getWriter().write(svgContent); 
 | 
            response.getWriter().flush(); 
 | 
            response.getWriter().close(); 
 | 
  
 | 
        } catch (IOException e) { 
 | 
            e.printStackTrace(); 
 | 
        } 
 | 
    } 
 | 
  
 | 
} 
 |