提交 | 用户 | 时间
|
8b3ee3
|
1 |
package com.iailab.module.model.mpk.service.impl; |
潘 |
2 |
|
|
3 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
4 |
import com.iailab.framework.common.util.object.ConvertUtils; |
|
5 |
import com.iailab.module.model.mpk.dao.FileGroupDao; |
|
6 |
import com.iailab.module.model.mpk.dto.FileGroupDTO; |
|
7 |
import com.iailab.module.model.mpk.entity.FileGroupEntity; |
|
8 |
import com.iailab.module.model.mpk.service.FileGroupService; |
|
9 |
import lombok.extern.slf4j.Slf4j; |
|
10 |
import org.springframework.stereotype.Service; |
|
11 |
|
|
12 |
import javax.annotation.Resource; |
|
13 |
import java.util.List; |
0a2f6f
|
14 |
import java.util.UUID; |
8b3ee3
|
15 |
|
潘 |
16 |
/** |
|
17 |
* @author PanZhibao |
|
18 |
* @Description |
|
19 |
* @createTime 2024年09月22日 |
|
20 |
*/ |
|
21 |
@Slf4j |
|
22 |
@Service |
|
23 |
public class FileGroupServiceImpl implements FileGroupService { |
|
24 |
|
|
25 |
@Resource |
|
26 |
private FileGroupDao fileGroupDao; |
|
27 |
|
|
28 |
@Override |
|
29 |
public List<FileGroupDTO> list(String menuId) { |
|
30 |
QueryWrapper<FileGroupEntity> wrapper = new QueryWrapper<>(); |
|
31 |
wrapper.eq("menu_id", menuId) |
|
32 |
.orderByAsc("sort"); |
|
33 |
return ConvertUtils.sourceToTarget(fileGroupDao.selectList(wrapper), FileGroupDTO.class); |
|
34 |
} |
|
35 |
|
|
36 |
@Override |
|
37 |
public FileGroupEntity get(String id) { |
|
38 |
return fileGroupDao.selectById(id); |
|
39 |
} |
|
40 |
|
|
41 |
@Override |
0a2f6f
|
42 |
public void create(FileGroupEntity entity) { |
潘 |
43 |
entity.setId(UUID.randomUUID().toString()); |
|
44 |
fileGroupDao.insert(entity); |
8b3ee3
|
45 |
} |
潘 |
46 |
|
|
47 |
@Override |
0a2f6f
|
48 |
public void update(FileGroupEntity entity) { |
潘 |
49 |
fileGroupDao.updateById(entity); |
8b3ee3
|
50 |
} |
潘 |
51 |
|
|
52 |
@Override |
|
53 |
public void deleteById(String id) { |
|
54 |
fileGroupDao.deleteById(id); |
|
55 |
} |
|
56 |
} |