houzhongjian
2024-12-26 b482efaf698d5fd3920ff63ccde1c819f9eb34ba
提交 | 用户 | 时间
818a01 1 package com.iailab.module.system.service.app;
H 2
3 import com.iailab.framework.common.pojo.PageResult;
4 import com.iailab.framework.common.util.object.BeanUtils;
5 import com.iailab.framework.tenant.core.aop.TenantIgnore;
6 import com.iailab.module.system.controller.admin.app.vo.AppGroupPageReqVO;
7 import com.iailab.module.system.controller.admin.app.vo.AppGroupSaveReqVO;
8 import com.iailab.module.system.dal.dataobject.app.AppGroupDO;
9 import com.iailab.module.system.dal.mysql.app.AppGroupMapper;
10 import lombok.extern.slf4j.Slf4j;
11 import org.springframework.stereotype.Service;
12 import org.springframework.transaction.annotation.Transactional;
13
14 import javax.annotation.Resource;
15 import java.util.List;
16
17 /**
18  * @author Houzhongjian
19  * @Description
20  * @createTime 2024年09月20日
21  */
22 @Service
23 @Slf4j
24 public class AppGroupServiceImpl implements AppGroupService {
25
26     @Resource
27     private AppGroupMapper appGroupMapper;
28
29
30     @Override
31     @Transactional(rollbackFor = Exception.class)
32     @TenantIgnore
33     public Long create(AppGroupSaveReqVO createReqVO) {
34         AppGroupDO appGroup = BeanUtils.toBean(createReqVO, AppGroupDO.class);
35         appGroupMapper.insert(appGroup);
36         return appGroup.getId();
37     }
38
39     @Override
40     @Transactional(rollbackFor = Exception.class)
41     @TenantIgnore
42     public Long update(AppGroupSaveReqVO createReqVO) {
43         AppGroupDO appGroup = BeanUtils.toBean(createReqVO, AppGroupDO.class);
44         appGroupMapper.updateById(appGroup);
45         return appGroup.getId();
46     }
47
48     @Override
49     @Transactional(rollbackFor = Exception.class)
50     @TenantIgnore
51     public void delete(Long id) {
52         AppGroupDO appGroup = new AppGroupDO();
53         appGroup.setId(id);
54         appGroupMapper.deleteById(id);
55     }
56
57     @Override
58     public AppGroupDO getInfo(Long id) {
59         return appGroupMapper.selectById(id);
60     }
61
62     @Override
63     public PageResult<AppGroupDO> getPage(AppGroupPageReqVO pageReqVO) {
64         return appGroupMapper.selectPage(pageReqVO);
65     }
66
67     @Override
68     public List<AppGroupDO> getList(){
69         return appGroupMapper.selectList();
70     }
71
72 }