添加日志
This commit is contained in:
parent
d8be35ed68
commit
6d6f3f1d6b
@ -0,0 +1,19 @@
|
||||
package com.sunyard.chsm.constant;
|
||||
|
||||
/**
|
||||
* @author liulu
|
||||
* @since 2024/11/1
|
||||
*/
|
||||
public interface AuditLogConst {
|
||||
|
||||
String ADD = "新增";
|
||||
String UPDATE = "新增";
|
||||
String DELETE = "删除";
|
||||
String IMPORT = "导入";
|
||||
String EXPORT = "导出";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,11 +1,13 @@
|
||||
package com.sunyard.chsm.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sunyard.chsm.constant.AuditLogConst;
|
||||
import com.sunyard.chsm.dto.AppQuery;
|
||||
import com.sunyard.chsm.dto.AppSave;
|
||||
import com.sunyard.chsm.dto.AppView;
|
||||
import com.sunyard.chsm.model.R;
|
||||
import com.sunyard.chsm.service.ApplicationService;
|
||||
import com.sunyard.ssp.common.annotation.AuditControllerLog;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
@ -54,6 +56,7 @@ public class ApplicationController {
|
||||
* @return id
|
||||
*/
|
||||
@PostMapping
|
||||
@AuditControllerLog(description = "创建应用", operateType = AuditLogConst.ADD)
|
||||
public R<String> save(@Valid @RequestBody AppSave save) {
|
||||
Long id = applicationService.save(save);
|
||||
return R.data(String.valueOf(id));
|
||||
@ -65,6 +68,7 @@ public class ApplicationController {
|
||||
* @param id 应用id
|
||||
* @return
|
||||
*/
|
||||
@AuditControllerLog(description = "启用应用", operateType = AuditLogConst.UPDATE)
|
||||
@PostMapping("/enable")
|
||||
public R<Void> enable(Long id) {
|
||||
Assert.notNull(id, "应用id不能为空");
|
||||
@ -78,6 +82,7 @@ public class ApplicationController {
|
||||
* @param id 应用id
|
||||
* @return
|
||||
*/
|
||||
@AuditControllerLog(description = "停用应用", operateType = AuditLogConst.UPDATE)
|
||||
@PostMapping("/disable")
|
||||
public R<Void> disable(Long id) {
|
||||
Assert.notNull(id, "应用id不能为空");
|
||||
@ -105,6 +110,7 @@ public class ApplicationController {
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping
|
||||
@AuditControllerLog(description = "删除应用", operateType = AuditLogConst.DELETE)
|
||||
public R<Void> delete(Long id) {
|
||||
Assert.notNull(id, "应用id不能为空");
|
||||
applicationService.delete(id);
|
||||
|
@ -1,11 +1,13 @@
|
||||
package com.sunyard.chsm.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sunyard.chsm.constant.AuditLogConst;
|
||||
import com.sunyard.chsm.dto.ApiGroupDTO;
|
||||
import com.sunyard.chsm.dto.CryptoServiceDTO;
|
||||
import com.sunyard.chsm.enums.ApiFunEnum;
|
||||
import com.sunyard.chsm.model.R;
|
||||
import com.sunyard.chsm.service.CryptoServiceService;
|
||||
import com.sunyard.ssp.common.annotation.AuditControllerLog;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
@ -86,6 +88,7 @@ public class CryptoServiceController {
|
||||
* @return 密码服务id
|
||||
*/
|
||||
@PostMapping
|
||||
@AuditControllerLog(description = "创建密码服务", operateType = AuditLogConst.ADD)
|
||||
public R<String> saveService(@Valid @RequestBody CryptoServiceDTO.CSSave save) {
|
||||
Long id = cryptoServiceService.save(save);
|
||||
return R.data(String.valueOf(id));
|
||||
@ -98,12 +101,41 @@ public class CryptoServiceController {
|
||||
* @return 密码服务id
|
||||
*/
|
||||
@PutMapping
|
||||
@AuditControllerLog(description = "修改密码服务", operateType = AuditLogConst.UPDATE)
|
||||
public R<Void> updateService(@Valid @RequestBody CryptoServiceDTO.CSSave update) {
|
||||
Assert.notNull(update.getId(), "密码服务id不能为空");
|
||||
cryptoServiceService.update(update);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用密码服务
|
||||
*
|
||||
* @param id id
|
||||
* @return
|
||||
*/
|
||||
@AuditControllerLog(description = "启用密码服务", operateType = AuditLogConst.UPDATE)
|
||||
@PostMapping("/enable")
|
||||
public R<Void> enable(Long id) {
|
||||
Assert.notNull(id, "应用id不能为空");
|
||||
cryptoServiceService.enable(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 停用密码服务
|
||||
*
|
||||
* @param id id
|
||||
* @return
|
||||
*/
|
||||
@AuditControllerLog(description = "停用密码服务", operateType = AuditLogConst.UPDATE)
|
||||
@PostMapping("/disable")
|
||||
public R<Void> disable(Long id) {
|
||||
Assert.notNull(id, "应用id不能为空");
|
||||
cryptoServiceService.disable(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除密码服务
|
||||
*
|
||||
@ -111,6 +143,7 @@ public class CryptoServiceController {
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping
|
||||
@AuditControllerLog(description = "删除密码服务", operateType = AuditLogConst.DELETE)
|
||||
public R<Void> deleteService(Long id) {
|
||||
Assert.notNull(id, "密码服务id不能为空");
|
||||
cryptoServiceService.delete(id);
|
||||
|
@ -1,11 +1,13 @@
|
||||
package com.sunyard.chsm.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sunyard.chsm.constant.AuditLogConst;
|
||||
import com.sunyard.chsm.dto.DeviceDTO;
|
||||
import com.sunyard.chsm.dto.ManufacturersDeviceDTO;
|
||||
import com.sunyard.chsm.enums.ManufacturerModelEnum;
|
||||
import com.sunyard.chsm.model.R;
|
||||
import com.sunyard.chsm.service.DeviceService;
|
||||
import com.sunyard.ssp.common.annotation.AuditControllerLog;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -111,6 +113,7 @@ public class DeviceController {
|
||||
* @return id
|
||||
*/
|
||||
@PostMapping
|
||||
@AuditControllerLog(description = "添加密码设备", operateType = AuditLogConst.ADD)
|
||||
public R<String> save(@Valid @RequestBody DeviceDTO.DeviceSave save) {
|
||||
Long id = deviceService.save(save);
|
||||
return R.data(String.valueOf(id));
|
||||
@ -123,6 +126,7 @@ public class DeviceController {
|
||||
* @return void
|
||||
*/
|
||||
@PutMapping
|
||||
@AuditControllerLog(description = "修改密码设备", operateType = AuditLogConst.UPDATE)
|
||||
public R<Void> update(@Valid @RequestBody DeviceDTO.DeviceSave update) {
|
||||
deviceService.update(update);
|
||||
return R.ok();
|
||||
@ -135,6 +139,7 @@ public class DeviceController {
|
||||
* @return void
|
||||
*/
|
||||
@DeleteMapping
|
||||
@AuditControllerLog(description = "删除密码设备", operateType = AuditLogConst.DELETE)
|
||||
public R<Void> delete(Long id) {
|
||||
deviceService.delete(id);
|
||||
return R.ok();
|
||||
|
@ -1,9 +1,11 @@
|
||||
package com.sunyard.chsm.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sunyard.chsm.constant.AuditLogConst;
|
||||
import com.sunyard.chsm.dto.DeviceGroupDTO;
|
||||
import com.sunyard.chsm.model.R;
|
||||
import com.sunyard.chsm.service.DeviceGroupService;
|
||||
import com.sunyard.ssp.common.annotation.AuditControllerLog;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -49,6 +51,7 @@ public class DeviceGroupController {
|
||||
* @return id
|
||||
*/
|
||||
@PostMapping
|
||||
@AuditControllerLog(description = "添加设备组", operateType = AuditLogConst.ADD)
|
||||
public R<String> save(@Valid @RequestBody DeviceGroupDTO.DGSave save) {
|
||||
Long id = deviceGroupService.save(save);
|
||||
return R.data(String.valueOf(id));
|
||||
@ -61,6 +64,7 @@ public class DeviceGroupController {
|
||||
* @return void
|
||||
*/
|
||||
@PutMapping
|
||||
@AuditControllerLog(description = "修改设备组", operateType = AuditLogConst.UPDATE)
|
||||
public R<Void> update(@Valid @RequestBody DeviceGroupDTO.DGSave update) {
|
||||
deviceGroupService.update(update);
|
||||
return R.ok();
|
||||
@ -73,6 +77,7 @@ public class DeviceGroupController {
|
||||
* @return void
|
||||
*/
|
||||
@DeleteMapping
|
||||
@AuditControllerLog(description = "删除设备组", operateType = AuditLogConst.DELETE)
|
||||
public R<Void> delete(Long id) {
|
||||
deviceGroupService.delete(id);
|
||||
return R.ok();
|
||||
|
@ -1,10 +1,12 @@
|
||||
package com.sunyard.chsm.controller;
|
||||
|
||||
import com.sunyard.chsm.constant.AuditLogConst;
|
||||
import com.sunyard.chsm.dto.KeyInfoDTO;
|
||||
import com.sunyard.chsm.enums.KeyStatus;
|
||||
import com.sunyard.chsm.model.Option;
|
||||
import com.sunyard.chsm.model.R;
|
||||
import com.sunyard.chsm.service.KeyInfoService;
|
||||
import com.sunyard.ssp.common.annotation.AuditControllerLog;
|
||||
import com.sunyard.ssp.common.exception.SspwebException;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -53,6 +55,7 @@ public class KeyInfoController {
|
||||
* @return id
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
@AuditControllerLog(description = "创建密钥", operateType = AuditLogConst.ADD)
|
||||
public R<String> save(@Valid @RequestBody KeyInfoDTO.KeySave save) {
|
||||
Long id = keyInfoService.save(save);
|
||||
return R.data(String.valueOf(id));
|
||||
@ -65,6 +68,7 @@ public class KeyInfoController {
|
||||
* @return id
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@AuditControllerLog(description = "更新密钥", operateType = AuditLogConst.UPDATE)
|
||||
public R<Void> save(@Valid @RequestBody KeyInfoDTO.KeyUpdate update) {
|
||||
keyInfoService.update(update);
|
||||
return R.ok();
|
||||
@ -93,6 +97,7 @@ public class KeyInfoController {
|
||||
* @return id
|
||||
*/
|
||||
@PostMapping("/enable")
|
||||
@AuditControllerLog(description = "启用密钥", operateType = AuditLogConst.UPDATE)
|
||||
public R<Void> enableKey(@Valid @RequestBody KeyInfoDTO.IDs param) {
|
||||
keyInfoService.enableKey(param.getIds());
|
||||
return R.ok();
|
||||
@ -105,6 +110,7 @@ public class KeyInfoController {
|
||||
* @return id
|
||||
*/
|
||||
@PostMapping("/disable")
|
||||
@AuditControllerLog(description = "停用密钥", operateType = AuditLogConst.UPDATE)
|
||||
public R<Void> disableKey(@Valid @RequestBody KeyInfoDTO.IDs param) {
|
||||
keyInfoService.disableKey(param.getIds());
|
||||
return R.ok();
|
||||
@ -117,6 +123,7 @@ public class KeyInfoController {
|
||||
* @return id
|
||||
*/
|
||||
@PostMapping("/archive")
|
||||
@AuditControllerLog(description = "归档密钥", operateType = AuditLogConst.UPDATE)
|
||||
public R<Void> archiveKey(@Valid @RequestBody KeyInfoDTO.IDs param) {
|
||||
keyInfoService.archiveKey(param.getIds());
|
||||
return R.ok();
|
||||
@ -129,6 +136,7 @@ public class KeyInfoController {
|
||||
* @return id
|
||||
*/
|
||||
@PostMapping("/destroy")
|
||||
@AuditControllerLog(description = "销毁密钥", operateType = AuditLogConst.DELETE)
|
||||
public R<Void> destroyKey(@Valid @RequestBody KeyInfoDTO.IDs param) {
|
||||
keyInfoService.destroyKey(param.getIds());
|
||||
return R.ok();
|
||||
|
@ -1,9 +1,11 @@
|
||||
package com.sunyard.chsm.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sunyard.chsm.constant.AuditLogConst;
|
||||
import com.sunyard.chsm.dto.KeyTemplateDTO;
|
||||
import com.sunyard.chsm.model.R;
|
||||
import com.sunyard.chsm.service.KeyTemplateService;
|
||||
import com.sunyard.ssp.common.annotation.AuditControllerLog;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -17,6 +19,7 @@ import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 密钥模版管理接口
|
||||
*
|
||||
* @author liulu
|
||||
* @since 2024/10/22
|
||||
*/
|
||||
@ -48,6 +51,7 @@ public class KeyTemplateController {
|
||||
* @return id
|
||||
*/
|
||||
@PostMapping
|
||||
@AuditControllerLog(description = "添加密钥模版", operateType = AuditLogConst.ADD)
|
||||
public R<String> save(@Valid @RequestBody KeyTemplateDTO.KTSave save) {
|
||||
Long id = keyTemplateService.save(save);
|
||||
return R.data(String.valueOf(id));
|
||||
@ -60,6 +64,7 @@ public class KeyTemplateController {
|
||||
* @return void
|
||||
*/
|
||||
@PutMapping
|
||||
@AuditControllerLog(description = "修改密钥模版", operateType = AuditLogConst.UPDATE)
|
||||
public R<Void> update(@Valid @RequestBody KeyTemplateDTO.KTSave update) {
|
||||
keyTemplateService.update(update);
|
||||
return R.ok();
|
||||
@ -72,6 +77,7 @@ public class KeyTemplateController {
|
||||
* @return void
|
||||
*/
|
||||
@DeleteMapping
|
||||
@AuditControllerLog(description = "删除密钥模版", operateType = AuditLogConst.DELETE)
|
||||
public R<Void> delete(Long id) {
|
||||
keyTemplateService.delete(id);
|
||||
return R.ok();
|
||||
|
@ -16,5 +16,9 @@ public interface CryptoServiceService {
|
||||
|
||||
void update(CryptoServiceDTO.CSSave update);
|
||||
|
||||
void enable(Long id);
|
||||
|
||||
void disable(Long id);
|
||||
|
||||
void delete(Long id);
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import javax.annotation.Resource;
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional
|
||||
public class ApplicationServiceImpl implements ApplicationService {
|
||||
|
||||
@Resource
|
||||
|
@ -39,6 +39,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional
|
||||
public class CryptoServiceServiceImpl implements CryptoServiceService {
|
||||
|
||||
@Resource
|
||||
@ -100,7 +101,6 @@ public class CryptoServiceServiceImpl implements CryptoServiceService {
|
||||
servicePage.getSize(), servicePage.getTotal()).setRecords(viewList);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Long save(CryptoServiceDTO.CSSave save) {
|
||||
|
||||
@ -125,7 +125,6 @@ public class CryptoServiceServiceImpl implements CryptoServiceService {
|
||||
return service.getId();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void update(CryptoServiceDTO.CSSave update) {
|
||||
CryptoService exist = cryptoServiceMapper.selectById(update.getId());
|
||||
@ -155,7 +154,34 @@ public class CryptoServiceServiceImpl implements CryptoServiceService {
|
||||
saveApis(update.getApiList(), exist.getId());
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void enable(Long id) {
|
||||
CryptoService cs = cryptoServiceMapper.selectById(id);
|
||||
Assert.notNull(cs, "密码服务不存在");
|
||||
Assert.isTrue(Objects.equals(EnableStatus.DISABLED.getCode(), cs.getStatus()),
|
||||
"当前密码服务不是停用状态,不支持启用");
|
||||
|
||||
CryptoService upCs = new CryptoService();
|
||||
upCs.setId(id);
|
||||
upCs.setStatus(EnableStatus.ENABLED.getCode());
|
||||
upCs.setUpdateTime(LocalDateTime.now());
|
||||
cryptoServiceMapper.updateById(upCs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disable(Long id) {
|
||||
CryptoService cs = cryptoServiceMapper.selectById(id);
|
||||
Assert.notNull(cs, "密码服务不存在");
|
||||
Assert.isTrue(Objects.equals(EnableStatus.ENABLED.getCode(), cs.getStatus()),
|
||||
"当前密码服务不是停用状态,不支持启用");
|
||||
|
||||
CryptoService upCs = new CryptoService();
|
||||
upCs.setId(id);
|
||||
upCs.setStatus(EnableStatus.DISABLED.getCode());
|
||||
upCs.setUpdateTime(LocalDateTime.now());
|
||||
cryptoServiceMapper.updateById(upCs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(Long id) {
|
||||
CryptoService exist = cryptoServiceMapper.selectById(id);
|
||||
|
@ -32,6 +32,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Slf4j
|
||||
@Service("sp_DeviceGroupServiceImpl")
|
||||
@Transactional
|
||||
public class DeviceGroupServiceImpl implements DeviceGroupService {
|
||||
|
||||
@Resource
|
||||
@ -79,7 +80,6 @@ public class DeviceGroupServiceImpl implements DeviceGroupService {
|
||||
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Long save(DeviceGroupDTO.DGSave save) {
|
||||
|
||||
@ -108,7 +108,6 @@ public class DeviceGroupServiceImpl implements DeviceGroupService {
|
||||
return add.getId();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void update(DeviceGroupDTO.DGSave update) {
|
||||
Assert.notNull(update.getId(), "id不能为空");
|
||||
@ -152,7 +151,6 @@ public class DeviceGroupServiceImpl implements DeviceGroupService {
|
||||
Assert.isNull(exist, "设备组名称已存在");
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void delete(Long id) {
|
||||
Assert.notNull(id, "id不能为空");
|
||||
|
@ -31,6 +31,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Slf4j
|
||||
@Service("sp_DeviceServiceImpl")
|
||||
@Transactional
|
||||
public class DeviceServiceImpl implements DeviceService {
|
||||
|
||||
@Resource
|
||||
@ -112,7 +113,6 @@ public class DeviceServiceImpl implements DeviceService {
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Long save(DeviceDTO.DeviceSave save) {
|
||||
ManufacturerEnum manufacturer = ManufacturerEnum.of(save.getManufacturer());
|
||||
@ -135,7 +135,6 @@ public class DeviceServiceImpl implements DeviceService {
|
||||
return device.getId();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void update(DeviceDTO.DeviceSave update) {
|
||||
Assert.notNull(update.getId(), "id不能为空");
|
||||
@ -154,7 +153,6 @@ public class DeviceServiceImpl implements DeviceService {
|
||||
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void delete(Long id) {
|
||||
spDeviceMapper.deleteById(id);
|
||||
|
@ -71,6 +71,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional
|
||||
public class KeyInfoServiceImpl implements KeyInfoService {
|
||||
|
||||
@Resource
|
||||
@ -151,7 +152,6 @@ public class KeyInfoServiceImpl implements KeyInfoService {
|
||||
return new Page<KeyInfoDTO.KeyView>(page.getCurrent(), page.getSize(), page.getTotal()).setRecords(viewList);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Long save(KeyInfoDTO.KeySave save) {
|
||||
|
||||
@ -196,7 +196,6 @@ public class KeyInfoServiceImpl implements KeyInfoService {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void update(KeyInfoDTO.KeyUpdate update) {
|
||||
List<Long> ids = update.getIds();
|
||||
|
@ -14,6 +14,7 @@ import com.sunyard.chsm.service.KeyTemplateService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
@ -34,6 +35,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional
|
||||
public class KeyTemplateServiceImpl implements KeyTemplateService {
|
||||
|
||||
@Resource
|
||||
|
@ -17,7 +17,7 @@ import java.util.zip.ZipOutputStream;
|
||||
@Service
|
||||
public class LogDownloadServiceImpl implements LogDownloadService {
|
||||
|
||||
private static final String LOG_BASE_PATH = "./log/";
|
||||
private static final String LOG_BASE_PATH = "logs/";
|
||||
private static final DateTimeFormatter folderFormatter = DateTimeFormatter.ofPattern("yyyy-MM"); // 用于遍历月份的目录格式
|
||||
private static final DateTimeFormatter fileFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); // 用于解析文件名中的日期格式
|
||||
|
||||
@ -63,7 +63,7 @@ public class LogDownloadServiceImpl implements LogDownloadService {
|
||||
*/
|
||||
private boolean isRelevantLogFile(Path path, LocalDate startDate, LocalDate endDate) {
|
||||
String fileName = path.getFileName().toString();
|
||||
if (!fileName.endsWith(".log.gz")) {
|
||||
if (!fileName.endsWith(".log")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user