整合提交
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
package com.weather.modules.log.service;
|
||||
|
||||
|
||||
import com.weather.common.page.PageData;
|
||||
import com.weather.common.service.BaseService;
|
||||
import com.weather.modules.log.dto.SysLogErrorDTO;
|
||||
import com.weather.modules.log.entity.SysLogErrorEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 异常日志
|
||||
*
|
||||
* @author 123
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface SysLogErrorService extends BaseService<SysLogErrorEntity> {
|
||||
|
||||
PageData<SysLogErrorDTO> page(Map<String, Object> params);
|
||||
|
||||
List<SysLogErrorDTO> list(Map<String, Object> params);
|
||||
|
||||
void save(SysLogErrorEntity entity);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
|
||||
package com.weather.modules.log.service;
|
||||
|
||||
import com.weather.common.page.PageData;
|
||||
import com.weather.common.service.BaseService;
|
||||
import com.weather.modules.log.dto.SysLogLoginDTO;
|
||||
import com.weather.modules.log.entity.SysLogLoginEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 登录日志
|
||||
*
|
||||
* @author 123
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface SysLogLoginService extends BaseService<SysLogLoginEntity> {
|
||||
|
||||
PageData<SysLogLoginDTO> page(Map<String, Object> params);
|
||||
|
||||
List<SysLogLoginDTO> list(Map<String, Object> params);
|
||||
|
||||
void save(SysLogLoginEntity entity);
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
|
||||
|
||||
package com.weather.modules.log.service;
|
||||
|
||||
import com.weather.common.page.PageData;
|
||||
import com.weather.common.service.BaseService;
|
||||
import com.weather.modules.log.dto.SysLogOperationDTO;
|
||||
import com.weather.modules.log.entity.SysLogOperationEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 操作日志
|
||||
*
|
||||
* @author 123
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface SysLogOperationService extends BaseService<SysLogOperationEntity> {
|
||||
|
||||
PageData<SysLogOperationDTO> page(Map<String, Object> params);
|
||||
|
||||
List<SysLogOperationDTO> list(Map<String, Object> params);
|
||||
|
||||
void save(SysLogOperationEntity entity);
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
|
||||
|
||||
package com.weather.modules.log.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.weather.common.constant.Constant;
|
||||
import com.weather.common.page.PageData;
|
||||
import com.weather.common.service.impl.BaseServiceImpl;
|
||||
import com.weather.common.utils.ConvertUtils;
|
||||
import com.weather.modules.log.dao.SysLogErrorDao;
|
||||
import com.weather.modules.log.dto.SysLogErrorDTO;
|
||||
import com.weather.modules.log.entity.SysLogErrorEntity;
|
||||
import com.weather.modules.log.service.SysLogErrorService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 异常日志
|
||||
*
|
||||
* @author 123
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class SysLogErrorServiceImpl extends BaseServiceImpl<SysLogErrorDao, SysLogErrorEntity> implements SysLogErrorService {
|
||||
|
||||
@Override
|
||||
public PageData<SysLogErrorDTO> page(Map<String, Object> params) {
|
||||
IPage<SysLogErrorEntity> page = baseDao.selectPage(
|
||||
getPage(params, Constant.CREATE_DATE, false),
|
||||
getWrapper(params)
|
||||
);
|
||||
|
||||
return getPageData(page, SysLogErrorDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysLogErrorDTO> list(Map<String, Object> params) {
|
||||
List<SysLogErrorEntity> entityList = baseDao.selectList(getWrapper(params));
|
||||
|
||||
return ConvertUtils.sourceToTarget(entityList, SysLogErrorDTO.class);
|
||||
}
|
||||
|
||||
private QueryWrapper<SysLogErrorEntity> getWrapper(Map<String, Object> params){
|
||||
QueryWrapper<SysLogErrorEntity> wrapper = new QueryWrapper<>();
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(SysLogErrorEntity entity) {
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
|
||||
|
||||
package com.weather.modules.log.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.weather.common.constant.Constant;
|
||||
import com.weather.common.page.PageData;
|
||||
import com.weather.common.service.impl.BaseServiceImpl;
|
||||
import com.weather.common.utils.ConvertUtils;
|
||||
import com.weather.modules.log.dao.SysLogLoginDao;
|
||||
import com.weather.modules.log.dto.SysLogLoginDTO;
|
||||
import com.weather.modules.log.entity.SysLogLoginEntity;
|
||||
import com.weather.modules.log.service.SysLogLoginService;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 登录日志
|
||||
*
|
||||
* @author 123
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class SysLogLoginServiceImpl extends BaseServiceImpl<SysLogLoginDao, SysLogLoginEntity> implements SysLogLoginService {
|
||||
|
||||
@Override
|
||||
public PageData<SysLogLoginDTO> page(Map<String, Object> params) {
|
||||
IPage<SysLogLoginEntity> page = baseDao.selectPage(
|
||||
getPage(params, Constant.CREATE_DATE, false),
|
||||
getWrapper(params)
|
||||
);
|
||||
|
||||
return getPageData(page, SysLogLoginDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysLogLoginDTO> list(Map<String, Object> params) {
|
||||
List<SysLogLoginEntity> entityList = baseDao.selectList(getWrapper(params));
|
||||
|
||||
return ConvertUtils.sourceToTarget(entityList, SysLogLoginDTO.class);
|
||||
}
|
||||
|
||||
private QueryWrapper<SysLogLoginEntity> getWrapper(Map<String, Object> params){
|
||||
String status = (String) params.get("status");
|
||||
String creatorName = (String) params.get("creatorName");
|
||||
|
||||
QueryWrapper<SysLogLoginEntity> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq(StrUtil.isNotBlank(status), "status", status);
|
||||
wrapper.like(StrUtil.isNotBlank(creatorName), "creator_name", creatorName);
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(SysLogLoginEntity entity) {
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
|
||||
|
||||
package com.weather.modules.log.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.weather.common.constant.Constant;
|
||||
import com.weather.common.page.PageData;
|
||||
import com.weather.common.service.impl.BaseServiceImpl;
|
||||
import com.weather.common.utils.ConvertUtils;
|
||||
import com.weather.modules.log.dao.SysLogOperationDao;
|
||||
import com.weather.modules.log.dto.SysLogOperationDTO;
|
||||
import com.weather.modules.log.entity.SysLogOperationEntity;
|
||||
import com.weather.modules.log.service.SysLogOperationService;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 操作日志
|
||||
*
|
||||
* @author 123
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class SysLogOperationServiceImpl extends BaseServiceImpl<SysLogOperationDao, SysLogOperationEntity> implements SysLogOperationService {
|
||||
|
||||
@Override
|
||||
public PageData<SysLogOperationDTO> page(Map<String, Object> params) {
|
||||
IPage<SysLogOperationEntity> page = baseDao.selectPage(
|
||||
getPage(params, Constant.CREATE_DATE, false),
|
||||
getWrapper(params)
|
||||
);
|
||||
|
||||
return getPageData(page, SysLogOperationDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysLogOperationDTO> list(Map<String, Object> params) {
|
||||
List<SysLogOperationEntity> entityList = baseDao.selectList(getWrapper(params));
|
||||
|
||||
return ConvertUtils.sourceToTarget(entityList, SysLogOperationDTO.class);
|
||||
}
|
||||
|
||||
private QueryWrapper<SysLogOperationEntity> getWrapper(Map<String, Object> params){
|
||||
String status = (String) params.get("status");
|
||||
|
||||
QueryWrapper<SysLogOperationEntity> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq(StrUtil.isNotBlank(status), "status", status);
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(SysLogOperationEntity entity) {
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user