新增通知类型维护

This commit is contained in:
2025-11-01 16:17:22 +08:00
parent 9cc6647027
commit 16f25f908d
7 changed files with 618 additions and 0 deletions

View File

@@ -0,0 +1,108 @@
package com.vetti.web.controller.hotake;
import java.util.List;
import com.vetti.hotake.domain.dto.HotakeSysNoticeTypeDto;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.vetti.common.annotation.Log;
import com.vetti.common.core.controller.BaseController;
import com.vetti.common.core.domain.AjaxResult;
import com.vetti.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.vetti.hotake.domain.HotakeSysNoticeType;
import com.vetti.hotake.service.IHotakeSysNoticeTypeService;
import com.vetti.common.utils.poi.ExcelUtil;
import com.vetti.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/**
* 通知类型Controller
*
* @author ID
* @date 2025-11-01
*/
@Api(tags = "通知类型")
@RestController
@RequestMapping("/hotake/sysNoticeType")
public class HotakeSysNoticeTypeController extends BaseController {
@Autowired
private IHotakeSysNoticeTypeService hotakeSysNoticeTypeService;
/**
* 查询通知类型列表
*/
@ApiOperation("查询通知类型列表")
@PreAuthorize("@ss.hasPermi('hotake:sysNoticeType:list')")
@GetMapping("/list")
public TableDataInfo list(HotakeSysNoticeType hotakeSysNoticeType) {
startPage();
List<HotakeSysNoticeTypeDto> list = hotakeSysNoticeTypeService.selectHotakeSysNoticeTypeList(hotakeSysNoticeType);
return getDataTable(list);
}
@ApiOperation("查询通知类型列表")
@PreAuthorize("@ss.hasPermi('hotake:sysNoticeType:list')")
@GetMapping("/listall")
public AjaxResult listAll(HotakeSysNoticeType hotakeSysNoticeType) {
return AjaxResult.success(hotakeSysNoticeTypeService.selectHotakeSysNoticeTypeList(hotakeSysNoticeType));
}
/**
* 导出通知类型列表
*/
@ApiOperation("导出通知类型列表")
@PreAuthorize("@ss.hasPermi('hotake:sysNoticeType:export')")
@Log(title = "通知类型", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(HotakeSysNoticeType hotakeSysNoticeType) {
List<HotakeSysNoticeTypeDto> list = hotakeSysNoticeTypeService.selectHotakeSysNoticeTypeList(hotakeSysNoticeType);
ExcelUtil<HotakeSysNoticeTypeDto> util = new ExcelUtil<>(HotakeSysNoticeTypeDto.class);
return util.exportExcel(list, "通知类型数据");
}
/**
* 获取通知类型详细信息
*/
@ApiOperation("获取通知类型详细信息")
@PreAuthorize("@ss.hasPermi('hotake:sysNoticeType:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(hotakeSysNoticeTypeService.selectHotakeSysNoticeTypeById(id));
}
/**
* 新增通知类型
*/
@ApiOperation("新增通知类型")
@PreAuthorize("@ss.hasPermi('hotake:sysNoticeType:add')")
@Log(title = "通知类型", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestPart(value = "files", required = false) List<MultipartFile> files, HotakeSysNoticeType hotakeSysNoticeType) {
return toAjax(hotakeSysNoticeTypeService.insertHotakeSysNoticeType(files, hotakeSysNoticeType));
}
/**
* 修改通知类型
*/
@ApiOperation("修改通知类型(不修改图片不需要传files只要修改一个所有图片都需要传)")
@PreAuthorize("@ss.hasPermi('hotake:sysNoticeType:edit')")
@Log(title = "通知类型", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestPart(value = "files", required = false) List<MultipartFile> files, HotakeSysNoticeType hotakeSysNoticeType) {
return toAjax(hotakeSysNoticeTypeService.updateHotakeSysNoticeType(files, hotakeSysNoticeType));
}
/**
* 删除通知类型
*/
@ApiOperation("删除通知类型")
@PreAuthorize("@ss.hasPermi('hotake:sysNoticeType:remove')")
@Log(title = "通知类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(hotakeSysNoticeTypeService.deleteHotakeSysNoticeTypeByIds(ids));
}
}