|
@@ -0,0 +1,127 @@
|
|
|
+package com.ruoyi.web.controller.system;
|
|
|
+
|
|
|
+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.system.domain.TPersonalMessage;
|
|
|
+import com.ruoyi.system.service.ITPersonalMessageService;
|
|
|
+import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
+import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 个人页留言内容
|
|
|
+ *
|
|
|
+ * @author Administrator
|
|
|
+ * @date 2020-10-21
|
|
|
+ */
|
|
|
+@Api(value = "个人页留言内容", tags = "个人页留言内容")
|
|
|
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
|
|
+@RestController
|
|
|
+@RequestMapping("/system/message" )
|
|
|
+public class TPersonalMessageController extends BaseController {
|
|
|
+
|
|
|
+ private final ITPersonalMessageService iTPersonalMessageService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询个人页留言内容列表
|
|
|
+ */
|
|
|
+ @ApiOperation("查询个人页留言内容列表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:message:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(TPersonalMessage tPersonalMessage)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ LambdaQueryWrapper<TPersonalMessage> lqw = new LambdaQueryWrapper<TPersonalMessage>();
|
|
|
+ if (tPersonalMessage.getPersonalId() != null){
|
|
|
+ lqw.eq(TPersonalMessage::getPersonalId ,tPersonalMessage.getPersonalId());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(tPersonalMessage.getType())){
|
|
|
+ lqw.eq(TPersonalMessage::getType ,tPersonalMessage.getType());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(tPersonalMessage.getContents())){
|
|
|
+ lqw.eq(TPersonalMessage::getContents ,tPersonalMessage.getContents());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(tPersonalMessage.getModel())){
|
|
|
+ lqw.eq(TPersonalMessage::getModel ,tPersonalMessage.getModel());
|
|
|
+ }
|
|
|
+ List<TPersonalMessage> list = iTPersonalMessageService.list(lqw);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出个人页留言内容列表
|
|
|
+ */
|
|
|
+ @ApiOperation("导出个人页留言内容列表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:message:export')" )
|
|
|
+ @Log(title = "个人页留言内容" , businessType = BusinessType.EXPORT)
|
|
|
+ @GetMapping("/export" )
|
|
|
+ public AjaxResult export(TPersonalMessage tPersonalMessage) {
|
|
|
+ LambdaQueryWrapper<TPersonalMessage> lqw = new LambdaQueryWrapper<TPersonalMessage>(tPersonalMessage);
|
|
|
+ List<TPersonalMessage> list = iTPersonalMessageService.list(lqw);
|
|
|
+ ExcelUtil<TPersonalMessage> util = new ExcelUtil<TPersonalMessage>(TPersonalMessage. class);
|
|
|
+ return util.exportExcel(list, "message" );
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取个人页留言内容详细信息
|
|
|
+ */
|
|
|
+ @ApiOperation("获取个人页留言内容详细信息")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:message:query')" )
|
|
|
+ @GetMapping(value = "/{id}" )
|
|
|
+ public AjaxResult getInfo(@PathVariable("id" ) Long id) {
|
|
|
+ return AjaxResult.success(iTPersonalMessageService.getById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增个人页留言内容
|
|
|
+ */
|
|
|
+ @ApiOperation("新增个人页留言内容")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:message:add')" )
|
|
|
+ @Log(title = "个人页留言内容" , businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ public AjaxResult add(@RequestBody TPersonalMessage tPersonalMessage) {
|
|
|
+ return toAjax(iTPersonalMessageService.save(tPersonalMessage) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改个人页留言内容
|
|
|
+ */
|
|
|
+ @ApiOperation("修改个人页留言内容")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:message:edit')" )
|
|
|
+ @Log(title = "个人页留言内容" , businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@RequestBody TPersonalMessage tPersonalMessage) {
|
|
|
+ return toAjax(iTPersonalMessageService.updateById(tPersonalMessage) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除个人页留言内容
|
|
|
+ */
|
|
|
+ @ApiOperation("删除个人页留言内容")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:message:remove')" )
|
|
|
+ @Log(title = "个人页留言内容" , businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{ids}" )
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids) {
|
|
|
+ return toAjax(iTPersonalMessageService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
|
|
+ }
|
|
|
+}
|