|
|
@@ -0,0 +1,54 @@
|
|
|
+package com.gree.mall.manager.controller.message;
|
|
|
+
|
|
|
+import cn.hutool.core.lang.TypeReference;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.gree.mall.manager.annotation.ZfireList;
|
|
|
+import com.gree.mall.manager.bean.message.MessageVO;
|
|
|
+import com.gree.mall.manager.helper.ResponseHelper;
|
|
|
+import com.gree.mall.manager.logic.message.MessageLogic;
|
|
|
+import com.gree.mall.manager.zfire.bean.ZfireParamBean;
|
|
|
+import com.gree.mall.manager.zfire.util.FieldUtils;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
+@Slf4j
|
|
|
+@RestController
|
|
|
+@Api(value = "联系留言API", tags ={"联系留言API"} )
|
|
|
+@RequestMapping(value = "/message", produces = "application/json; charset=utf-8")
|
|
|
+public class MessageController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ MessageLogic messageLogic;
|
|
|
+
|
|
|
+ @ZfireList
|
|
|
+ @PostMapping("/list")
|
|
|
+ @ApiOperation(value = "列表")
|
|
|
+ public ResponseHelper<IPage<MessageVO>> list(
|
|
|
+ @RequestBody ZfireParamBean zfireParamBean
|
|
|
+ ) {
|
|
|
+ IPage<MessageVO> page = messageLogic.list(zfireParamBean);
|
|
|
+ return ResponseHelper.success(page, new TypeReference<MessageVO>() {});
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/list/export")
|
|
|
+ @ApiOperation(value = "列表-导出")
|
|
|
+ public void listExport(
|
|
|
+ @RequestBody ZfireParamBean zfireParamBean,
|
|
|
+ HttpServletRequest request,
|
|
|
+ HttpServletResponse response
|
|
|
+ ) throws Exception {
|
|
|
+ //2.查询要导出的内容
|
|
|
+ IPage<MessageVO> page = messageLogic.list(zfireParamBean);
|
|
|
+ //3.导出
|
|
|
+ FieldUtils.exportData(page.getRecords(), zfireParamBean.getExportFields(), request, response);
|
|
|
+ }
|
|
|
+}
|