2024-09-25 11:18:01 +08:00
|
|
|
package com.gunshi.project.xyt.controller;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.gunshi.core.result.R;
|
|
|
|
|
import com.gunshi.project.xyt.entity.so.BroadcastWarnPageSo;
|
|
|
|
|
import com.gunshi.project.xyt.model.BroadcastWarn;
|
|
|
|
|
import com.gunshi.project.xyt.service.BroadcastWarnService;
|
|
|
|
|
import com.gunshi.project.xyt.validate.markers.Insert;
|
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 描述:
|
|
|
|
|
* author: xusan
|
|
|
|
|
* date: 2024-09-25 10:12:51
|
|
|
|
|
*/
|
|
|
|
|
@Tag(name = "广播预警")
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping(value="/broadcastWarn")
|
|
|
|
|
public class BroadcastWarnController {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private BroadcastWarnService service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "新增")
|
|
|
|
|
@PostMapping("/insert")
|
2024-09-26 16:08:31 +08:00
|
|
|
public R<Boolean> insert(@Validated(Insert.class) @RequestBody BroadcastWarn dto) {
|
|
|
|
|
return R.ok(service.saveData(dto));
|
2024-09-25 11:18:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "分页")
|
|
|
|
|
@PostMapping("/page")
|
|
|
|
|
public R<Page<BroadcastWarn>> page(@Validated @RequestBody BroadcastWarnPageSo page) {
|
|
|
|
|
return R.ok(service.pageQuery(page));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|