Commit ac018539d76573faa76dd70c722fbe58ab170d05
1 parent
9d4b2bf8
feat:【infra】【system】新增文件与短信日志详情查询接口
Showing
6 changed files
with
38 additions
and
0 deletions
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java
| @@ -72,6 +72,14 @@ public class FileController { | @@ -72,6 +72,14 @@ public class FileController { | ||
| 72 | return success(fileService.createFile(createReqVO)); | 72 | return success(fileService.createFile(createReqVO)); |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | + @GetMapping("/get") | ||
| 76 | + @Operation(summary = "获得文件") | ||
| 77 | + @Parameter(name = "id", description = "编号", required = true) | ||
| 78 | + @PreAuthorize("@ss.hasPermission('infra:file:query')") | ||
| 79 | + public CommonResult<FileRespVO> getFile(@RequestParam("id") Long id) { | ||
| 80 | + return success(BeanUtils.toBean(fileService.getFile(id), FileRespVO.class)); | ||
| 81 | + } | ||
| 82 | + | ||
| 75 | @DeleteMapping("/delete") | 83 | @DeleteMapping("/delete") |
| 76 | @Operation(summary = "删除文件") | 84 | @Operation(summary = "删除文件") |
| 77 | @Parameter(name = "id", description = "编号", required = true) | 85 | @Parameter(name = "id", description = "编号", required = true) |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java
| @@ -61,6 +61,7 @@ public interface FileService { | @@ -61,6 +61,7 @@ public interface FileService { | ||
| 61 | * @return 编号 | 61 | * @return 编号 |
| 62 | */ | 62 | */ |
| 63 | Long createFile(FileCreateReqVO createReqVO); | 63 | Long createFile(FileCreateReqVO createReqVO); |
| 64 | + FileDO getFile(Long id); | ||
| 64 | 65 | ||
| 65 | /** | 66 | /** |
| 66 | * 删除文件 | 67 | * 删除文件 |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java
| @@ -153,6 +153,11 @@ public class FileServiceImpl implements FileService { | @@ -153,6 +153,11 @@ public class FileServiceImpl implements FileService { | ||
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | @Override | 155 | @Override |
| 156 | + public FileDO getFile(Long id) { | ||
| 157 | + return validateFileExists(id); | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + @Override | ||
| 156 | public void deleteFile(Long id) throws Exception { | 161 | public void deleteFile(Long id) throws Exception { |
| 157 | // 校验存在 | 162 | // 校验存在 |
| 158 | FileDO file = validateFileExists(id); | 163 | FileDO file = validateFileExists(id); |
yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsLogController.java
| @@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogRespVO; | @@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogRespVO; | ||
| 11 | import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsLogDO; | 11 | import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsLogDO; |
| 12 | import cn.iocoder.yudao.module.system.service.sms.SmsLogService; | 12 | import cn.iocoder.yudao.module.system.service.sms.SmsLogService; |
| 13 | import io.swagger.v3.oas.annotations.Operation; | 13 | import io.swagger.v3.oas.annotations.Operation; |
| 14 | +import io.swagger.v3.oas.annotations.Parameter; | ||
| 14 | import io.swagger.v3.oas.annotations.tags.Tag; | 15 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 15 | import jakarta.annotation.Resource; | 16 | import jakarta.annotation.Resource; |
| 16 | import jakarta.servlet.http.HttpServletResponse; | 17 | import jakarta.servlet.http.HttpServletResponse; |
| @@ -18,6 +19,7 @@ import jakarta.validation.Valid; | @@ -18,6 +19,7 @@ import jakarta.validation.Valid; | ||
| 18 | import org.springframework.security.access.prepost.PreAuthorize; | 19 | import org.springframework.security.access.prepost.PreAuthorize; |
| 19 | import org.springframework.validation.annotation.Validated; | 20 | import org.springframework.validation.annotation.Validated; |
| 20 | import org.springframework.web.bind.annotation.GetMapping; | 21 | import org.springframework.web.bind.annotation.GetMapping; |
| 22 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 21 | import org.springframework.web.bind.annotation.RequestMapping; | 23 | import org.springframework.web.bind.annotation.RequestMapping; |
| 22 | import org.springframework.web.bind.annotation.RestController; | 24 | import org.springframework.web.bind.annotation.RestController; |
| 23 | 25 | ||
| @@ -44,6 +46,15 @@ public class SmsLogController { | @@ -44,6 +46,15 @@ public class SmsLogController { | ||
| 44 | return success(BeanUtils.toBean(pageResult, SmsLogRespVO.class)); | 46 | return success(BeanUtils.toBean(pageResult, SmsLogRespVO.class)); |
| 45 | } | 47 | } |
| 46 | 48 | ||
| 49 | + @GetMapping("/get") | ||
| 50 | + @Operation(summary = "获得短信日志") | ||
| 51 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||
| 52 | + @PreAuthorize("@ss.hasPermission('system:sms-log:query')") | ||
| 53 | + public CommonResult<SmsLogRespVO> getSmsLog(@RequestParam("id") Long id) { | ||
| 54 | + SmsLogDO smsLog = smsLogService.getSmsLog(id); | ||
| 55 | + return success(BeanUtils.toBean(smsLog, SmsLogRespVO.class)); | ||
| 56 | + } | ||
| 57 | + | ||
| 47 | @GetMapping("/export-excel") | 58 | @GetMapping("/export-excel") |
| 48 | @Operation(summary = "导出短信日志 Excel") | 59 | @Operation(summary = "导出短信日志 Excel") |
| 49 | @PreAuthorize("@ss.hasPermission('system:sms-log:export')") | 60 | @PreAuthorize("@ss.hasPermission('system:sms-log:export')") |
yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsLogService.java
| @@ -59,6 +59,14 @@ public interface SmsLogService { | @@ -59,6 +59,14 @@ public interface SmsLogService { | ||
| 59 | LocalDateTime receiveTime, String apiReceiveCode, String apiReceiveMsg); | 59 | LocalDateTime receiveTime, String apiReceiveCode, String apiReceiveMsg); |
| 60 | 60 | ||
| 61 | /** | 61 | /** |
| 62 | + * 获得短信日志 | ||
| 63 | + * | ||
| 64 | + * @param id 日志编号 | ||
| 65 | + * @return 短信日志 | ||
| 66 | + */ | ||
| 67 | + SmsLogDO getSmsLog(Long id); | ||
| 68 | + | ||
| 69 | + /** | ||
| 62 | * 获得短信日志分页 | 70 | * 获得短信日志分页 |
| 63 | * | 71 | * |
| 64 | * @param pageReqVO 分页查询 | 72 | * @param pageReqVO 分页查询 |
yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceImpl.java
| @@ -80,6 +80,11 @@ public class SmsLogServiceImpl implements SmsLogService { | @@ -80,6 +80,11 @@ public class SmsLogServiceImpl implements SmsLogService { | ||
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | @Override | 82 | @Override |
| 83 | + public SmsLogDO getSmsLog(Long id) { | ||
| 84 | + return smsLogMapper.selectById(id); | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + @Override | ||
| 83 | public PageResult<SmsLogDO> getSmsLogPage(SmsLogPageReqVO pageReqVO) { | 88 | public PageResult<SmsLogDO> getSmsLogPage(SmsLogPageReqVO pageReqVO) { |
| 84 | return smsLogMapper.selectPage(pageReqVO); | 89 | return smsLogMapper.selectPage(pageReqVO); |
| 85 | } | 90 | } |