|
@@ -0,0 +1,90 @@
|
|
|
+package com.ruoyi.app.controller;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.ruoyi.app.domain.TbFamilyEvents;
|
|
|
+import com.ruoyi.app.service.ITbFamilyEventsService;
|
|
|
+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 io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 家族大事件
|
|
|
+ *
|
|
|
+ * @author liuhj
|
|
|
+ * @date 2020-10-14
|
|
|
+ */
|
|
|
+@Api(value = "家族大事件", tags = "家族大事件")
|
|
|
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
|
|
+@RestController
|
|
|
+@RequestMapping("/app/events" )
|
|
|
+public class FamilyEventsController extends BaseController {
|
|
|
+
|
|
|
+ private final ITbFamilyEventsService iTbFamilyEventsService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询家族大事件列表
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "家族大事件列表", notes = "家族大事件列表")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(TbFamilyEvents tbFamilyEvents)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ List<TbFamilyEvents> list = iTbFamilyEventsService.queryList(tbFamilyEvents);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取家族大事件详细信息
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "家族大事件详细信息", notes = "家族大事件详细信息")
|
|
|
+ @GetMapping(value = "/{id}" )
|
|
|
+ public AjaxResult detail(@PathVariable("id" ) Long id) {
|
|
|
+ return AjaxResult.success(iTbFamilyEventsService.getById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增家族大事件
|
|
|
+ */
|
|
|
+ @ApiOperation("新增家族大事件")
|
|
|
+ @Log(title = "家族大事件" , businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping("/add")
|
|
|
+ public AjaxResult add(@RequestBody TbFamilyEvents tbFamilyEvents) {
|
|
|
+ return toAjax(iTbFamilyEventsService.save(tbFamilyEvents) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改家族大事件
|
|
|
+ */
|
|
|
+ @ApiOperation("修改家族大事件")
|
|
|
+ @Log(title = "家族大事件" , businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping("/update")
|
|
|
+ public AjaxResult edit(@RequestBody TbFamilyEvents tbFamilyEvents) {
|
|
|
+ Date date = new Date();
|
|
|
+ tbFamilyEvents.setUpdateTime(date);
|
|
|
+ return toAjax(iTbFamilyEventsService.updateById(tbFamilyEvents) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除家族大事件
|
|
|
+ */
|
|
|
+ @ApiOperation("删除家族大事件")
|
|
|
+ @Log(title = "家族大事件" , businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/del")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids) {
|
|
|
+ return toAjax(iTbFamilyEventsService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
|
|
+ }
|
|
|
+}
|