提交 | 用户 | 时间
|
e7c126
|
1 |
package com.iailab.module.system.controller.admin.mail; |
H |
2 |
|
|
3 |
import com.iailab.framework.common.pojo.CommonResult; |
|
4 |
import com.iailab.framework.common.pojo.PageResult; |
|
5 |
import com.iailab.framework.common.util.object.BeanUtils; |
|
6 |
import com.iailab.module.system.controller.admin.mail.vo.log.MailLogPageReqVO; |
|
7 |
import com.iailab.module.system.controller.admin.mail.vo.log.MailLogRespVO; |
|
8 |
import com.iailab.module.system.dal.dataobject.mail.MailLogDO; |
|
9 |
import com.iailab.module.system.service.mail.MailLogService; |
|
10 |
import io.swagger.v3.oas.annotations.Operation; |
|
11 |
import io.swagger.v3.oas.annotations.Parameter; |
|
12 |
import io.swagger.v3.oas.annotations.tags.Tag; |
|
13 |
import org.springframework.security.access.prepost.PreAuthorize; |
|
14 |
import org.springframework.web.bind.annotation.GetMapping; |
|
15 |
import org.springframework.web.bind.annotation.RequestMapping; |
|
16 |
import org.springframework.web.bind.annotation.RequestParam; |
|
17 |
import org.springframework.web.bind.annotation.RestController; |
|
18 |
|
|
19 |
import javax.annotation.Resource; |
|
20 |
import javax.validation.Valid; |
|
21 |
|
|
22 |
import static com.iailab.framework.common.pojo.CommonResult.success; |
|
23 |
|
|
24 |
@Tag(name = "管理后台 - 邮件日志") |
|
25 |
@RestController |
|
26 |
@RequestMapping("/system/mail-log") |
|
27 |
public class MailLogController { |
|
28 |
|
|
29 |
@Resource |
|
30 |
private MailLogService mailLogService; |
|
31 |
|
|
32 |
@GetMapping("/page") |
|
33 |
@Operation(summary = "获得邮箱日志分页") |
|
34 |
@PreAuthorize("@ss.hasPermission('system:mail-log:query')") |
|
35 |
public CommonResult<PageResult<MailLogRespVO>> getMailLogPage(@Valid MailLogPageReqVO pageVO) { |
|
36 |
PageResult<MailLogDO> pageResult = mailLogService.getMailLogPage(pageVO); |
|
37 |
return success(BeanUtils.toBean(pageResult, MailLogRespVO.class)); |
|
38 |
} |
|
39 |
|
|
40 |
@GetMapping("/get") |
|
41 |
@Operation(summary = "获得邮箱日志") |
|
42 |
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
|
43 |
@PreAuthorize("@ss.hasPermission('system:mail-log:query')") |
|
44 |
public CommonResult<MailLogRespVO> getMailTemplate(@RequestParam("id") Long id) { |
|
45 |
MailLogDO log = mailLogService.getMailLog(id); |
|
46 |
return success(BeanUtils.toBean(log, MailLogRespVO.class)); |
|
47 |
} |
|
48 |
|
|
49 |
} |