|
@@ -0,0 +1,105 @@
|
|
|
+package com.caimei.wxController;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.caimei.model.ResponseJson;
|
|
|
+import com.caimei.model.vo.*;
|
|
|
+import com.caimei.service.*;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author Aslee
|
|
|
+ */
|
|
|
+@Api(tags = "微信资料库API")
|
|
|
+@Slf4j
|
|
|
+@RestController
|
|
|
+@RequiredArgsConstructor
|
|
|
+@RequestMapping("/wx/data")
|
|
|
+public class WxDataApi {
|
|
|
+ private final ArticleService articleService;
|
|
|
+ private final ImageService imageService;
|
|
|
+ private final VideoService videoService;
|
|
|
+ private final FileService fileService;
|
|
|
+ private final AuthClubService authClubService;
|
|
|
+
|
|
|
+ @ApiOperation("资料库文章列表")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id"),
|
|
|
+ @ApiImplicitParam(name = "articleName", required = false, value = "文章名称"),
|
|
|
+ @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
|
|
|
+ @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
|
|
|
+ })
|
|
|
+ @GetMapping("/article/list")
|
|
|
+ public ResponseJson<PageInfo<WxArticleListVo>> getWxArticleList(Integer authUserId, String articleName,
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
|
+ return articleService.getWxArticleList(authUserId, articleName, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("资料库文章回显数据")
|
|
|
+ @ApiImplicitParam(name = "articleId", value = "文章id", required = true)
|
|
|
+ @GetMapping("/article/form/data")
|
|
|
+ public ResponseJson<ArticleFormVo> getArticleFormData(Integer articleId) {
|
|
|
+ return articleService.getArticleFormData(articleId);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("资料库图片列表")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id"),
|
|
|
+ @ApiImplicitParam(name = "imageName", required = false, value = "文章名称"),
|
|
|
+ @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
|
|
|
+ @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
|
|
|
+ })
|
|
|
+ @GetMapping("/image/list")
|
|
|
+ public ResponseJson<PageInfo<WxImageListVo>> getWxImageList(Integer authUserId, String imageName,
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
|
+ return imageService.getWxImageList(authUserId, imageName, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("资料库视频列表")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id"),
|
|
|
+ @ApiImplicitParam(name = "videoName", required = false, value = "文章名称"),
|
|
|
+ @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
|
|
|
+ @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
|
|
|
+ })
|
|
|
+ @GetMapping("/video/list")
|
|
|
+ public ResponseJson<PageInfo<WxVideoListVo>> getWxVideoList(Integer authUserId, String videoName,
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
|
+ return videoService.getWxVideoList(authUserId, videoName, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("资料库文件列表")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "authUserId", required = true, value = "供应商用户id"),
|
|
|
+ @ApiImplicitParam(name = "fileName", required = false, value = "文章名称"),
|
|
|
+ @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
|
|
|
+ @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
|
|
|
+ })
|
|
|
+ @GetMapping("/file/list")
|
|
|
+ public ResponseJson<PageInfo<WxFileListVo>> getWxFileList(Integer authUserId, String fileName,
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
|
+ return fileService.getWxFileList(authUserId, fileName, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation("提交意见反馈")
|
|
|
+ @ApiImplicitParam(name = "params", required = true, value = "供应商用户id")
|
|
|
+ @GetMapping("/feedback/submit")
|
|
|
+ public ResponseJson submitFeedback(@RequestBody String params) {
|
|
|
+ JSONObject paramsMap = JSONObject.parseObject(params);
|
|
|
+ Integer clubUserId = paramsMap.getInteger("clubUserId");
|
|
|
+ String content = paramsMap.getString("content");
|
|
|
+ return authClubService.submitFeedback(clubUserId, content);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|