fix
Helius
2022-07-04 9684fd3b9ad7e71b614c2ee0a3e45b7783d4c6cf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.xcong.farmer.cms.modules.system.service.Impl;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xcong.farmer.cms.core.template.TemplateConfiguration;
import com.xcong.farmer.cms.modules.system.dto.TemplateListDto;
import com.xcong.farmer.cms.modules.system.entity.CmsTemplateEntity;
import com.xcong.farmer.cms.modules.system.mapper.CmsTemplateMapper;
import com.xcong.farmer.cms.modules.system.service.ICmsTemplateService;
import com.xcong.farmer.cms.modules.system.util.LoginUserUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
 
/**
 * @author wzy
 * @date 2022-07-04
 **/
@Service
public class CmsTemplateServiceImpl extends ServiceImpl<CmsTemplateMapper, CmsTemplateEntity> implements ICmsTemplateService {
 
    @Autowired
    private TemplateConfiguration cfg;
 
    @Override
    public void updateTemplate(MultipartFile file) {
        String templatePath = cfg.templatePath;
        String staticPath = cfg.staticPath;
    }
 
    @Override
    public IPage<CmsTemplateEntity> findInPage(TemplateListDto templateListDto) {
        Long companyId = LoginUserUtil.getCompanyId();
        IPage<CmsTemplateEntity> page = new Page<>(templateListDto.getPageNum(), templateListDto.getPageSize());
 
        CmsTemplateEntity template = new CmsTemplateEntity();
        template.setCompanyId(companyId);
        return this.baseMapper.selectInPage(page, template);
    }
 
    @Override
    public void delete(Long id) {
        Long companyId = LoginUserUtil.getCompanyId();
        this.baseMapper.delete(id, companyId);
    }
}