xyz.migoo.framework.infra.controller.developer.sms.SmsLogController Maven / Gradle / Ivy
package xyz.migoo.framework.infra.controller.developer.sms;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.migoo.framework.common.pojo.PageResult;
import xyz.migoo.framework.common.pojo.Result;
import xyz.migoo.framework.infra.controller.developer.sms.vo.log.SmsLogPageReqVO;
import xyz.migoo.framework.infra.controller.developer.sms.vo.log.SmsLogRespVO;
import xyz.migoo.framework.infra.convert.developer.sms.SmsLogConvert;
import xyz.migoo.framework.infra.dal.dataobject.developer.sms.SmsLogDO;
import xyz.migoo.framework.infra.service.developer.sms.SmsLogService;
@RestController
@RequestMapping("/developer/sms/log")
@Validated
public class SmsLogController {
@Resource
private SmsLogService smsLogService;
@GetMapping
@PreAuthorize("@ss.hasPermission('developer:sms:log:query')")
public Result> getSmsLogPage(@Valid SmsLogPageReqVO pageVO) {
PageResult pageResult = smsLogService.getSmsLogPage(pageVO);
return Result.getSuccessful(SmsLogConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/{id}")
@PreAuthorize("@ss.hasPermission('developer:sms:log:query')")
public Result getData(@PathVariable("id") Long id) {
return Result.getSuccessful(SmsLogConvert.INSTANCE.convert(smsLogService.getData(id)));
}
}