123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- package com.ruoyi.web.controller.gallery;
- import java.util.Arrays;
- import java.util.List;
- import com.ruoyi.system.domain.grallery.ZbGalleryImg;
- import lombok.RequiredArgsConstructor;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.PutMapping;
- import org.springframework.web.bind.annotation.DeleteMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import com.ruoyi.common.annotation.Log;
- import com.ruoyi.common.core.controller.BaseController;
- import com.ruoyi.common.core.domain.AjaxResult;
- import com.ruoyi.common.enums.BusinessType;
- import com.ruoyi.system.service.IZbGalleryImgService;
- import com.ruoyi.common.utils.poi.ExcelUtil;
- import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
- import com.ruoyi.common.core.page.TableDataInfo;
- /**
- * 【请填写功能名称】Controller
- *
- * @author ruoyi
- * @date 2020-11-20
- */
- @RestController
- @RequestMapping("/gallery/img")
- @RequiredArgsConstructor
- public class ZbGalleryImgController extends BaseController {
- private final IZbGalleryImgService zbGalleryImgService;
- /**
- * 查询【请填写功能名称】列表
- */
- @PreAuthorize("@ss.hasPermi('system:img:list')")
- @GetMapping("/list")
- public TableDataInfo list(ZbGalleryImg zbGalleryImg) {
- Page<ZbGalleryImg> page = startPage(ZbGalleryImg.class);
- List<ZbGalleryImg> list = zbGalleryImgService.selectZbGalleryImgList(zbGalleryImg, page);
- return getDataTable(list, page);
- }
-
- /**
- * 导出【请填写功能名称】列表
- */
- @PreAuthorize("@ss.hasPermi('system:img:export')")
- @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
- @GetMapping("/export")
- public AjaxResult export(ZbGalleryImg zbGalleryImg) {
- Page<ZbGalleryImg> page = startPage(ZbGalleryImg.class);
- List<ZbGalleryImg> list = zbGalleryImgService.selectZbGalleryImgList(zbGalleryImg, page);
- ExcelUtil<ZbGalleryImg> util = new ExcelUtil<ZbGalleryImg>(ZbGalleryImg. class);
- return util.exportExcel(list, "img");
- }
- /**
- * 获取【请填写功能名称】详细信息
- */
- @PreAuthorize("@ss.hasPermi('system:img:query')")
- @GetMapping(value = "/{id}")
- public AjaxResult getInfo(@PathVariable("id") Long id) {
- return AjaxResult.success(zbGalleryImgService.getById(id));
- }
- /**
- * 新增【请填写功能名称】
- */
- @PreAuthorize("@ss.hasPermi('system:img:add')")
- @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody ZbGalleryImg zbGalleryImg) {
- return toAjax(zbGalleryImgService.insertZbGalleryImg(zbGalleryImg));
- }
- /**
- * 修改【请填写功能名称】
- */
- @PreAuthorize("@ss.hasPermi('system:img:edit')")
- @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@RequestBody ZbGalleryImg zbGalleryImg) {
- return toAjax(zbGalleryImgService.updateZbGalleryImg(zbGalleryImg));
- }
- /**
- * 删除【请填写功能名称】
- */
- @PreAuthorize("@ss.hasPermi('system:img:remove')")
- @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
- @DeleteMapping("/{ids}")
- public AjaxResult remove(@PathVariable Long[] ids) {
- if (ids == null || ids.length == 0) {
- return AjaxResult.error("参数不正确");
- }
- return toAjax(zbGalleryImgService.removeByIds(Arrays.asList(ids)));
- }
- }
|