|
@@ -0,0 +1,121 @@
|
|
|
+package com.ruoyi.web.controller.api;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.Arrays;
|
|
|
+
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
|
+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.app.domain.TbEventsImg;
|
|
|
+import com.ruoyi.app.service.ITbEventsImgService;
|
|
|
+import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
+import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 家族大事件图片
|
|
|
+ *
|
|
|
+ * @author liuhj
|
|
|
+ * @date 2020-10-21
|
|
|
+ */
|
|
|
+@Api(value = "家族大事件图片", tags = "家族大事件图片")
|
|
|
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
|
|
+@RestController
|
|
|
+@RequestMapping("/system/img" )
|
|
|
+public class TbEventsImgController extends BaseController {
|
|
|
+
|
|
|
+ private final ITbEventsImgService iTbEventsImgService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询家族大事件图片列表
|
|
|
+ */
|
|
|
+ @ApiOperation("查询家族大事件图片列表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:img:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(TbEventsImg tbEventsImg)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ LambdaQueryWrapper<TbEventsImg> lqw = new LambdaQueryWrapper<TbEventsImg>();
|
|
|
+ if (tbEventsImg.getEventsId() != null){
|
|
|
+ lqw.eq(TbEventsImg::getEventsId ,tbEventsImg.getEventsId());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(tbEventsImg.getUrl())){
|
|
|
+ lqw.eq(TbEventsImg::getUrl ,tbEventsImg.getUrl());
|
|
|
+ }
|
|
|
+ List<TbEventsImg> list = iTbEventsImgService.list(lqw);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出家族大事件图片列表
|
|
|
+ */
|
|
|
+ @ApiOperation("导出家族大事件图片列表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:img:export')" )
|
|
|
+ @Log(title = "家族大事件图片" , businessType = BusinessType.EXPORT)
|
|
|
+ @GetMapping("/export" )
|
|
|
+ public AjaxResult export(TbEventsImg tbEventsImg) {
|
|
|
+ LambdaQueryWrapper<TbEventsImg> lqw = new LambdaQueryWrapper<TbEventsImg>(tbEventsImg);
|
|
|
+ List<TbEventsImg> list = iTbEventsImgService.list(lqw);
|
|
|
+ ExcelUtil<TbEventsImg> util = new ExcelUtil<TbEventsImg>(TbEventsImg. class);
|
|
|
+ return util.exportExcel(list, "img" );
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取家族大事件图片详细信息
|
|
|
+ */
|
|
|
+ @ApiOperation("获取家族大事件图片详细信息")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:img:query')" )
|
|
|
+ @GetMapping(value = "/{id}" )
|
|
|
+ public AjaxResult getInfo(@PathVariable("id" ) Long id) {
|
|
|
+ return AjaxResult.success(iTbEventsImgService.getById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增家族大事件图片
|
|
|
+ */
|
|
|
+ @ApiOperation("新增家族大事件图片")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:img:add')" )
|
|
|
+ @Log(title = "家族大事件图片" , businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ public AjaxResult add(@RequestBody TbEventsImg tbEventsImg) {
|
|
|
+ return toAjax(iTbEventsImgService.save(tbEventsImg) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改家族大事件图片
|
|
|
+ */
|
|
|
+ @ApiOperation("修改家族大事件图片")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:img:edit')" )
|
|
|
+ @Log(title = "家族大事件图片" , businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@RequestBody TbEventsImg tbEventsImg) {
|
|
|
+ return toAjax(iTbEventsImgService.updateById(tbEventsImg) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除家族大事件图片
|
|
|
+ */
|
|
|
+ @ApiOperation("删除家族大事件图片")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:img:remove')" )
|
|
|
+ @Log(title = "家族大事件图片" , businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{ids}" )
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids) {
|
|
|
+ return toAjax(iTbEventsImgService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
|
|
+ }
|
|
|
+}
|