59 lines
1.8 KiB
Java
59 lines
1.8 KiB
Java
|
|
package com.whdc.controller;
|
||
|
|
|
||
|
|
import com.whdc.model.entity.SmsLog;
|
||
|
|
import com.whdc.model.group.Insert;
|
||
|
|
import com.whdc.model.group.Update;
|
||
|
|
import com.whdc.service.ISmsLogService;
|
||
|
|
import com.whdc.utils.ResultJson;
|
||
|
|
import io.swagger.annotations.Api;
|
||
|
|
import io.swagger.annotations.ApiOperation;
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.validation.annotation.Validated;
|
||
|
|
import org.springframework.web.bind.annotation.*;
|
||
|
|
|
||
|
|
import java.util.List;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 短信日志控制器
|
||
|
|
*
|
||
|
|
* @author lyf
|
||
|
|
* @since 2025-09-23
|
||
|
|
*/
|
||
|
|
@Api(tags = "短信日志 - Controller")
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/smsLog")
|
||
|
|
public class SmsLogController {
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private ISmsLogService smsLogService;
|
||
|
|
|
||
|
|
@ApiOperation(value = "分页查询")
|
||
|
|
@PostMapping(value = "page")
|
||
|
|
public ResultJson<List<SmsLog>> page(@RequestBody SmsLog dto) {
|
||
|
|
return ResultJson.ok(smsLogService.list());
|
||
|
|
}
|
||
|
|
|
||
|
|
@ApiOperation(value = "新增")
|
||
|
|
@PostMapping(value = "add")
|
||
|
|
public ResultJson<Boolean> add(@RequestBody @Validated(Insert.class) SmsLog model) {
|
||
|
|
return ResultJson.ok(smsLogService.save(model));
|
||
|
|
}
|
||
|
|
|
||
|
|
@ApiOperation(value = "修改")
|
||
|
|
@PostMapping(value = "edit")
|
||
|
|
public ResultJson<Boolean> edit(@RequestBody @Validated(Update.class) SmsLog model) {
|
||
|
|
return ResultJson.ok(smsLogService.updateById(model));
|
||
|
|
}
|
||
|
|
|
||
|
|
@ApiOperation(value = "删除")
|
||
|
|
@GetMapping(value = "del/{id}")
|
||
|
|
public ResultJson<Boolean> delete(@PathVariable("id") Long id) {
|
||
|
|
return ResultJson.ok(smsLogService.removeById(id));
|
||
|
|
}
|
||
|
|
|
||
|
|
@ApiOperation(value = "根据ID查询")
|
||
|
|
@GetMapping(value = "get/{id}")
|
||
|
|
public ResultJson<SmsLog> getById(@PathVariable("id") Long id) {
|
||
|
|
return ResultJson.ok(smsLogService.getById(id));
|
||
|
|
}
|
||
|
|
}
|