feat(IP白名单控制):
This commit is contained in:
parent
8ccac56e8b
commit
7446520dd4
|
@ -0,0 +1,91 @@
|
|||
package com.ruoyi.web.controller.board;
|
||||
|
||||
import com.ruoyi.board.domain.PubWhiteIp;
|
||||
import com.ruoyi.board.service.IPubWhiteIpService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发布源白名单Controller
|
||||
*
|
||||
* @author fuhao
|
||||
* @date 2024-09-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/white/ip")
|
||||
public class PubWhiteIpController extends BaseController {
|
||||
@Autowired
|
||||
private IPubWhiteIpService pubWhiteIpService;
|
||||
|
||||
/**
|
||||
* 查询发布源白名单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('white:ip:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(PubWhiteIp pubWhiteIp) {
|
||||
startPage();
|
||||
List<PubWhiteIp> list = pubWhiteIpService.list();
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出发布源白名单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('white:ip:export')")
|
||||
@Log(title = "发布源白名单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, PubWhiteIp pubWhiteIp) {
|
||||
List<PubWhiteIp> list = pubWhiteIpService.list();
|
||||
ExcelUtil<PubWhiteIp> util = new ExcelUtil<PubWhiteIp>(PubWhiteIp.class);
|
||||
util.exportExcel(response, list, "发布源白名单数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取发布源白名单详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('white:ip:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(pubWhiteIpService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增发布源白名单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('white:ip:add')")
|
||||
@Log(title = "发布源白名单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody PubWhiteIp pubWhiteIp) {
|
||||
return toAjax(pubWhiteIpService.save(pubWhiteIp));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发布源白名单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('white:ip:edit')")
|
||||
@Log(title = "发布源白名单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody PubWhiteIp pubWhiteIp) {
|
||||
return toAjax(pubWhiteIpService.saveOrUpdate(pubWhiteIp));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除发布源白名单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('white:ip:remove')")
|
||||
@Log(title = "发布源白名单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(pubWhiteIpService.removeByIds(ids));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue