package com.iailab.module.model.mpk.service.impl;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.iailab.framework.common.util.object.ConvertUtils;
|
import com.iailab.module.model.mpk.dao.FileGroupDao;
|
import com.iailab.module.model.mpk.dto.FileGroupDTO;
|
import com.iailab.module.model.mpk.entity.FileGroupEntity;
|
import com.iailab.module.model.mpk.service.FileGroupService;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
import java.util.UUID;
|
|
/**
|
* @author PanZhibao
|
* @Description
|
* @createTime 2024年09月22日
|
*/
|
@Slf4j
|
@Service
|
public class FileGroupServiceImpl implements FileGroupService {
|
|
@Resource
|
private FileGroupDao fileGroupDao;
|
|
@Override
|
public List<FileGroupDTO> list(String menuId) {
|
QueryWrapper<FileGroupEntity> wrapper = new QueryWrapper<>();
|
wrapper.eq("menu_id", menuId)
|
.orderByAsc("sort");
|
return ConvertUtils.sourceToTarget(fileGroupDao.selectList(wrapper), FileGroupDTO.class);
|
}
|
|
@Override
|
public FileGroupEntity get(String id) {
|
return fileGroupDao.selectById(id);
|
}
|
|
@Override
|
public void create(FileGroupEntity entity) {
|
entity.setId(UUID.randomUUID().toString());
|
fileGroupDao.insert(entity);
|
}
|
|
@Override
|
public void update(FileGroupEntity entity) {
|
fileGroupDao.updateById(entity);
|
}
|
|
@Override
|
public void deleteById(String id) {
|
fileGroupDao.deleteById(id);
|
}
|
}
|