package com.iailab.module.system.service.app;
|
|
import com.iailab.framework.common.pojo.PageResult;
|
import com.iailab.framework.common.util.object.BeanUtils;
|
import com.iailab.framework.tenant.core.aop.TenantIgnore;
|
import com.iailab.module.system.controller.admin.app.vo.AppGroupPageReqVO;
|
import com.iailab.module.system.controller.admin.app.vo.AppGroupSaveReqVO;
|
import com.iailab.module.system.dal.dataobject.app.AppGroupDO;
|
import com.iailab.module.system.dal.mysql.app.AppGroupMapper;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.stereotype.Service;
|
import org.springframework.transaction.annotation.Transactional;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
|
/**
|
* @author Houzhongjian
|
* @Description
|
* @createTime 2024年09月20日
|
*/
|
@Service
|
@Slf4j
|
public class AppGroupServiceImpl implements AppGroupService {
|
|
@Resource
|
private AppGroupMapper appGroupMapper;
|
|
|
@Override
|
@Transactional(rollbackFor = Exception.class)
|
@TenantIgnore
|
public Long create(AppGroupSaveReqVO createReqVO) {
|
AppGroupDO appGroup = BeanUtils.toBean(createReqVO, AppGroupDO.class);
|
appGroupMapper.insert(appGroup);
|
return appGroup.getId();
|
}
|
|
@Override
|
@Transactional(rollbackFor = Exception.class)
|
@TenantIgnore
|
public Long update(AppGroupSaveReqVO createReqVO) {
|
AppGroupDO appGroup = BeanUtils.toBean(createReqVO, AppGroupDO.class);
|
appGroupMapper.updateById(appGroup);
|
return appGroup.getId();
|
}
|
|
@Override
|
@Transactional(rollbackFor = Exception.class)
|
@TenantIgnore
|
public void delete(Long id) {
|
AppGroupDO appGroup = new AppGroupDO();
|
appGroup.setId(id);
|
appGroupMapper.deleteById(id);
|
}
|
|
@Override
|
public AppGroupDO getInfo(Long id) {
|
return appGroupMapper.selectById(id);
|
}
|
|
@Override
|
public PageResult<AppGroupDO> getPage(AppGroupPageReqVO pageReqVO) {
|
return appGroupMapper.selectPage(pageReqVO);
|
}
|
|
@Override
|
public List<AppGroupDO> getList(){
|
return appGroupMapper.selectList();
|
}
|
|
}
|