package com.ruoyi.web.controller.system;
|
|
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.system.domain.NotifyChannelConfig;
|
import com.ruoyi.system.service.INotifyChannelConfigService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.List;
|
|
/**
|
* 通知渠道配置Controller
|
*
|
* @author ruoyi
|
* @date 2025-12-07
|
*/
|
@RestController
|
@RequestMapping("/system/notify/channel/config")
|
public class NotifyChannelConfigController extends BaseController {
|
@Autowired
|
private INotifyChannelConfigService notifyChannelConfigService;
|
|
/**
|
* 查询通知渠道配置列表
|
*/
|
@PreAuthorize("@ss.hasPermi('system:notify:channel:config:list')")
|
@GetMapping("/list")
|
public TableDataInfo list(NotifyChannelConfig notifyChannelConfig) {
|
startPage();
|
List<NotifyChannelConfig> list = notifyChannelConfigService.selectNotifyChannelConfigList(notifyChannelConfig);
|
return getDataTable(list);
|
}
|
|
/**
|
* 获取通知渠道配置详细信息
|
*/
|
@PreAuthorize("@ss.hasPermi('system:notify:channel:config:query')")
|
@GetMapping(value = "/{id}")
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
return AjaxResult.success(notifyChannelConfigService.selectNotifyChannelConfigById(id));
|
}
|
|
/**
|
* 新增通知渠道配置
|
*/
|
@PreAuthorize("@ss.hasPermi('system:notify:channel:config:add')")
|
@Log(title = "通知渠道配置", businessType = BusinessType.INSERT)
|
@PostMapping
|
public AjaxResult add(@RequestBody NotifyChannelConfig notifyChannelConfig) {
|
return toAjax(notifyChannelConfigService.insertNotifyChannelConfig(notifyChannelConfig));
|
}
|
|
/**
|
* 修改通知渠道配置
|
*/
|
@PreAuthorize("@ss.hasPermi('system:notify:channel:config:edit')")
|
@Log(title = "通知渠道配置", businessType = BusinessType.UPDATE)
|
@PutMapping
|
public AjaxResult edit(@RequestBody NotifyChannelConfig notifyChannelConfig) {
|
return toAjax(notifyChannelConfigService.updateNotifyChannelConfig(notifyChannelConfig));
|
}
|
|
/**
|
* 删除通知渠道配置
|
*/
|
@PreAuthorize("@ss.hasPermi('system:notify:channel:config:remove')")
|
@Log(title = "通知渠道配置", businessType = BusinessType.DELETE)
|
@DeleteMapping("/{ids}")
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
return toAjax(notifyChannelConfigService.deleteNotifyChannelConfigByIds(ids));
|
}
|
}
|