package com.philisense.www.controller.app;

import com.philisense.www.common.config.CommonConst;
import com.philisense.www.service.EbookArticleService;
import com.philisense.www.annotation.log.OperateLog;
import com.philisense.www.service.EbookArticleTxtService;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.Node;
import org.jsoup.select.Elements;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.philisense.www.controller.BaseUtilController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(CommonConst.APP_REST_SERVICE_PREFICX+"ebookarticle")
@Api(tags = "EbookArticleControllerForApp |一个用来操作-{在线电子写作表}-业务模块的控制器")
public class EbookArticleControllerForApp extends BaseUtilController{

        @Autowired
        private EbookArticleService ebookArticleService;
        @Autowired
        private EbookArticleTxtService ebookArticleTxtService;


        @GetMapping( "/delete")
        @ApiOperation(value="根据-{在线电子写作表}-主键删除记录", notes="成功返回:{\"success\":true,\"message\",\"数据删除成功\"},失败返回:{\"success\":false,\"message\",\"数据删除失败\"}")
        @ApiImplicitParam(paramType="query", name = "recordid", value = "记录主键", required = true,  dataTypeClass = String.class)
        @OperateLog(name = "根据-{在线电子写作表}-主键删除记录",value = "delete",type = "APP")
        public Map<String, Object> deleteByPrimaryKeyForEbookArticleForApp(HttpServletRequest request , HttpServletResponse response,@RequestParam String recordid)
        {
                Map<String, Object> result = new HashMap<String, Object>();
                try {
                        int flag = ebookArticleService.deleteByPrimaryKey(recordid);
                        if(1<=flag) {
                        result.put(DATASUCCESS, SUCCESSFLAG);
                        result.put(DATAMESSAGE, DELETE_SUCCESS_MSG);
                        }else{
                        result.put(DATASUCCESS, ERRORFLAG);
                        result.put(DATAMESSAGE, DELETE_FAIL_MSG);
                        }

                }catch(Exception e){
                        result.put(DATASUCCESS, ERRORFLAG);
                        result.put(DATAMESSAGE, DELETE_FAIL_MSG+e.getMessage());
                }
                return result;
        }

        @PostMapping( "/get")
        @ApiOperation(value="根据-{在线电子写作表}-主键查询记录", notes="成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"datarecord\":\"{}\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
        @ApiImplicitParam(paramType="body", name = "recordid", value = "记录主键", required = true,  dataTypeClass = String.class)
        @OperateLog(name = "根据-{在线电子写作表}-主键查询记录",value = "query",type = "APP")
        public Map<String, Object> selectByPrimaryKeyForEbookArticleForApp(HttpServletRequest request , HttpServletResponse response,@RequestBody  Map<String, Object> map)
        {
                Map<String, Object> result = new HashMap<String, Object>();
                try {

                        Map<String, Object> articlemap = ebookArticleService.selectByPrimaryKey(map.get("recordid")+"");
                        Map<String, Object> tempmap = new HashMap<String,Object>();
                        tempmap.put("article_id",map.get("recordid")+"");
                        Map<String, Object> articletxtmap = ebookArticleTxtService.getOne(tempmap);
                        articlemap.put("txtid",articletxtmap.get("id"));
                        articlemap.put("html_content", articletxtmap.get("txt"));

                        /*Document doc = Jsoup.parseBodyFragment(articletxtmap.get("txt") + "");
                        Elements elementsByTag = doc.getElementsByTag("span");
                        List<Element> waitingNodes = new ArrayList<>();
                        for (Element element : elementsByTag) {
                                if(isWaitingHandleSpanNode(element)) {
                                        waitingNodes.add(element);
                                }
                        }
                        for (Element waitingNode : waitingNodes) {
                                handleSpanNode(waitingNode);
                        }

                        articlemap.put("html_content", doc.body().html());*/

                        result.put(DATASUCCESS, SUCCESSFLAG);
                        result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
                        result.put(DATARECORD, articlemap);
                }catch(Exception e){
                        result.put(DATASUCCESS, ERRORFLAG);
                        result.put(DATAMESSAGE, QUERY_FAIL_MSG+e.getMessage());
                }
                return result;
        }


        @PostMapping( "/insert")
        @ApiOperation(value="根据-{在线电子写作表}-对象插入记录", notes="成功返回:{\"success\":true,\"message\",\"数据插入成功\"},失败返回:{\"success\":false,\"message\",\"数据插入失败\"}")
        @ApiImplicitParams({
        @ApiImplicitParam(paramType="body", name = "id", value = "文章编号", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_title", value = "文章标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_id", value = "文章分类编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_origin", value = "文章来源", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_origin_address", value = "文章来源链接", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_author", value = "文章作者", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_abstract", value = "文章摘要", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_content", value = "文章正文", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image", value = "文章图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_keyword", value = "文章关键字", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_link", value = "相关文章", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_goods", value = "相关内容", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_start_time", value = "文章有效期开始时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_end_time", value = "文章有效期结束时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_publish_time", value = "文章发布时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_click", value = "文章点击量", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_sort", value = "文章排序0-255", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_flag", value = "文章推荐标志0-未推荐，1-已推荐", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_flag", value = "文章是否允许评论1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_admin", value = "文章审核管理员", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_time", value = "文章审核时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_state", value = "1-草稿、2-待审核、3-已发布、4-回收站", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_name", value = "发布者用户名 ", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_id", value = "发布者编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_type", value = "文章类型1-管理员发布，2-用户投稿", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attachment_path", value = "文章附件路径", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image_all", value = "文章全部图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_modify_time", value = "文章修改时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_tag", value = "文章标签", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_count", value = "文章评论数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_1", value = "文章心情1", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_2", value = "文章心情2", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_3", value = "文章心情3", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_4", value = "文章心情4", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_5", value = "文章心情5", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_6", value = "文章心情6", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_short", value = "文章短标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_flag", value = "文章态度开关1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_image_flag", value = "文章推荐标志(图文)", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_share_count", value = "文章分享数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_reason", value = "审核失败原因", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_name", value = "文章分类名称", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_display", value = "文章是否显示", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_agree_count", value = "文章点赞数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_link", value = "文章外部链接", required = true,  dataTypeClass = String.class)
        })
        @OperateLog(name = "根据-{在线电子写作表}-对象插入记录",value = "insert",type = "APP")
        public Map<String, Object>  insertForEbookArticleForApp(HttpServletRequest request , HttpServletResponse response,@RequestBody Map<String, Object> map)
        {
                Map<String, Object> result = new HashMap<String, Object>();
                try {
                        map.put("id", UUID.randomUUID().toString().replaceAll("-", ""));

                        ebookArticleService.insert(map);
                        result.put(DATASUCCESS, SUCCESSFLAG);
                        result.put(DATAMESSAGE, INSERT_SUCCESS_MSG);
                }catch(Exception e){
                        result.put(DATASUCCESS, ERRORFLAG);
                        result.put(DATAMESSAGE, INSERT_FAIL_MSG+e.getMessage());
                }
                return result;
        }

        @PostMapping( "/update")
        @ApiOperation(value="根据-{在线电子写作表}-对象更新记录", notes="成功返回:{\"success\":true,\"message\",\"数据更新成功\"},失败返回:{\"success\":false,\"message\",\"数据更新失败\"}")
        @ApiImplicitParams({
        @ApiImplicitParam(paramType="body", name = "id", value = "文章编号", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_title", value = "文章标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_id", value = "文章分类编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_origin", value = "文章来源", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_origin_address", value = "文章来源链接", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_author", value = "文章作者", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_abstract", value = "文章摘要", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_content", value = "文章正文", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image", value = "文章图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_keyword", value = "文章关键字", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_link", value = "相关文章", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_goods", value = "相关内容", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_start_time", value = "文章有效期开始时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_end_time", value = "文章有效期结束时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_publish_time", value = "文章发布时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_click", value = "文章点击量", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_sort", value = "文章排序0-255", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_flag", value = "文章推荐标志0-未推荐，1-已推荐", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_flag", value = "文章是否允许评论1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_admin", value = "文章审核管理员", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_time", value = "文章审核时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_state", value = "1-草稿、2-待审核、3-已发布、4-回收站", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_name", value = "发布者用户名 ", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_id", value = "发布者编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_type", value = "文章类型1-管理员发布，2-用户投稿", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attachment_path", value = "文章附件路径", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image_all", value = "文章全部图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_modify_time", value = "文章修改时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_tag", value = "文章标签", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_count", value = "文章评论数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_1", value = "文章心情1", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_2", value = "文章心情2", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_3", value = "文章心情3", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_4", value = "文章心情4", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_5", value = "文章心情5", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_6", value = "文章心情6", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_short", value = "文章短标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_flag", value = "文章态度开关1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_image_flag", value = "文章推荐标志(图文)", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_share_count", value = "文章分享数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_reason", value = "审核失败原因", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_name", value = "文章分类名称", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_display", value = "文章是否显示", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_agree_count", value = "文章点赞数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_link", value = "文章外部链接", required = true,  dataTypeClass = String.class)
        })
        @OperateLog(name = "根据-{在线电子写作表}-对象更新记录",value = "update",type = "APP")
        public Map<String, Object>  updateForEbookArticleForApp(HttpServletRequest request , HttpServletResponse response,@RequestBody Map<String, Object> map)
        {
                Map<String, Object> result = new HashMap<String, Object>();
                try {
                        String ID = map.get("id")+"";
                        if(ID.equals("")){
                                result.put(DATASUCCESS, ERRORFLAG);
                                result.put(DATAMESSAGE, UPDATE_FAIL_MSG+"记录ID不能为空");
                                return result;
                        }
                        Map<String, Object> temmap = ebookArticleService.selectByPrimaryKey(ID);
                        if(null== temmap || temmap.size()==0){
                                result.put(DATASUCCESS, ERRORFLAG);
                                result.put(DATAMESSAGE, UPDATE_FAIL_MSG+ID+"记录不存在");
                                return result;
                        }

                        temmap.putAll(map);

                        int flag = ebookArticleService.update(temmap);

                        if(1<=flag){
                                result.put(DATASUCCESS, SUCCESSFLAG);
                                result.put(DATAMESSAGE, UPDATE_SUCCESS_MSG);
                        }else{
                                result.put(DATASUCCESS, ERRORFLAG);
                                result.put(DATAMESSAGE, UPDATE_FAIL_MSG);
                        }

                }catch(Exception e){
                        result.put(DATASUCCESS, ERRORFLAG);
                        result.put(DATAMESSAGE, UPDATE_FAIL_MSG+e.getMessage());
                }
                return result;
        }

        @PostMapping( "/deleteByMap")
        @ApiOperation(value="根据-{在线电子写作表}-对象Map删除记录", notes="成功返回:{\"success\":true,\"message\",\"数据删除成功\"},失败返回:{\"success\":false,\"message\",\"数据删除失败\"}")
        @ApiImplicitParams({
        @ApiImplicitParam(paramType="body", name = "id", value = "文章编号", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_title", value = "文章标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_id", value = "文章分类编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_origin", value = "文章来源", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_origin_address", value = "文章来源链接", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_author", value = "文章作者", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_abstract", value = "文章摘要", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_content", value = "文章正文", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image", value = "文章图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_keyword", value = "文章关键字", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_link", value = "相关文章", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_goods", value = "相关内容", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_start_time", value = "文章有效期开始时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_end_time", value = "文章有效期结束时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_publish_time", value = "文章发布时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_click", value = "文章点击量", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_sort", value = "文章排序0-255", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_flag", value = "文章推荐标志0-未推荐，1-已推荐", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_flag", value = "文章是否允许评论1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_admin", value = "文章审核管理员", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_time", value = "文章审核时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_state", value = "1-草稿、2-待审核、3-已发布、4-回收站", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_name", value = "发布者用户名 ", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_id", value = "发布者编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_type", value = "文章类型1-管理员发布，2-用户投稿", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attachment_path", value = "文章附件路径", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image_all", value = "文章全部图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_modify_time", value = "文章修改时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_tag", value = "文章标签", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_count", value = "文章评论数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_1", value = "文章心情1", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_2", value = "文章心情2", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_3", value = "文章心情3", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_4", value = "文章心情4", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_5", value = "文章心情5", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_6", value = "文章心情6", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_short", value = "文章短标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_flag", value = "文章态度开关1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_image_flag", value = "文章推荐标志(图文)", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_share_count", value = "文章分享数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_reason", value = "审核失败原因", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_name", value = "文章分类名称", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_display", value = "文章是否显示", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_agree_count", value = "文章点赞数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_link", value = "文章外部链接", required = true,  dataTypeClass = String.class)
        })
        @OperateLog(name = "根据-{在线电子写作表}-对象Map删除记录",value = "delete",type = "APP")
        public Map<String, Object>  deleteByMapForEbookArticleForApp(HttpServletRequest request , HttpServletResponse response,@RequestBody Map<String, Object> map)
        {
        Map<String, Object> result = new HashMap<String, Object>();
        try {
        int flag = ebookArticleService.deleteByMap(map);
        if(1<=flag) {
        result.put(DATASUCCESS, SUCCESSFLAG);
        result.put(DATAMESSAGE, DELETE_SUCCESS_MSG);
        }else{
        result.put(DATASUCCESS, ERRORFLAG);
        result.put(DATAMESSAGE, DELETE_FAIL_MSG);
        }

        }catch(Exception e){
        result.put(DATASUCCESS, ERRORFLAG);
        result.put(DATAMESSAGE, DELETE_FAIL_MSG+e.getMessage());
        }
        return result;
        }

        @PostMapping( "/updateByMap")
        @ApiOperation(value="根据-{在线电子写作表}-对象Map更新记录", notes="成功返回:{\"success\":true,\"message\",\"数据更新成功\"},失败返回:{\"success\":false,\"message\",\"数据更新失败\"}")
        @ApiImplicitParams({
        @ApiImplicitParam(paramType="body", name = "id", value = "文章编号", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_title", value = "文章标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_id", value = "文章分类编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_origin", value = "文章来源", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_origin_address", value = "文章来源链接", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_author", value = "文章作者", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_abstract", value = "文章摘要", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_content", value = "文章正文", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image", value = "文章图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_keyword", value = "文章关键字", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_link", value = "相关文章", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_goods", value = "相关内容", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_start_time", value = "文章有效期开始时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_end_time", value = "文章有效期结束时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_publish_time", value = "文章发布时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_click", value = "文章点击量", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_sort", value = "文章排序0-255", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_flag", value = "文章推荐标志0-未推荐，1-已推荐", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_flag", value = "文章是否允许评论1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_admin", value = "文章审核管理员", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_time", value = "文章审核时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_state", value = "1-草稿、2-待审核、3-已发布、4-回收站", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_name", value = "发布者用户名 ", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_id", value = "发布者编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_type", value = "文章类型1-管理员发布，2-用户投稿", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attachment_path", value = "文章附件路径", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image_all", value = "文章全部图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_modify_time", value = "文章修改时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_tag", value = "文章标签", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_count", value = "文章评论数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_1", value = "文章心情1", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_2", value = "文章心情2", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_3", value = "文章心情3", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_4", value = "文章心情4", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_5", value = "文章心情5", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_6", value = "文章心情6", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_short", value = "文章短标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_flag", value = "文章态度开关1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_image_flag", value = "文章推荐标志(图文)", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_share_count", value = "文章分享数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_reason", value = "审核失败原因", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_name", value = "文章分类名称", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_display", value = "文章是否显示", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_agree_count", value = "文章点赞数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_link", value = "文章外部链接", required = true,  dataTypeClass = String.class)
        })
        @OperateLog(name = "根据-{在线电子写作表}-对象Map更新记录",value = "update",type = "APP")
        public Map<String, Object>  updateByMapForEbookArticleForApp(HttpServletRequest request , HttpServletResponse response,@RequestBody Map<String, Object> map)
        {
        Map<String, Object> result = new HashMap<String, Object>();
        try {


        int flag = ebookArticleService.updateByMap(map);
        if(1<=flag){
        result.put(DATASUCCESS, SUCCESSFLAG);
        result.put(DATAMESSAGE, UPDATE_SUCCESS_MSG);
        }else{
        result.put(DATASUCCESS, ERRORFLAG);
        result.put(DATAMESSAGE, UPDATE_FAIL_MSG);
        }

        }catch(Exception e){
        result.put(DATASUCCESS, ERRORFLAG);
        result.put(DATAMESSAGE, UPDATE_FAIL_MSG+e.getMessage());
        }
        return result;
        }
        @PostMapping( "/getOne")
        @ApiOperation(value="根据-{在线电子写作表}-对象Map查询记录", notes="成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"datarecord\":\"{}\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
        @ApiImplicitParams({
        @ApiImplicitParam(paramType="body", name = "id", value = "文章编号", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_title", value = "文章标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_id", value = "文章分类编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_origin", value = "文章来源", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_origin_address", value = "文章来源链接", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_author", value = "文章作者", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_abstract", value = "文章摘要", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_content", value = "文章正文", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image", value = "文章图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_keyword", value = "文章关键字", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_link", value = "相关文章", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_goods", value = "相关内容", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_start_time", value = "文章有效期开始时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_end_time", value = "文章有效期结束时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_publish_time", value = "文章发布时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_click", value = "文章点击量", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_sort", value = "文章排序0-255", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_flag", value = "文章推荐标志0-未推荐，1-已推荐", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_flag", value = "文章是否允许评论1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_admin", value = "文章审核管理员", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_time", value = "文章审核时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_state", value = "1-草稿、2-待审核、3-已发布、4-回收站", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_name", value = "发布者用户名 ", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_id", value = "发布者编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_type", value = "文章类型1-管理员发布，2-用户投稿", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attachment_path", value = "文章附件路径", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image_all", value = "文章全部图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_modify_time", value = "文章修改时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_tag", value = "文章标签", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_count", value = "文章评论数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_1", value = "文章心情1", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_2", value = "文章心情2", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_3", value = "文章心情3", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_4", value = "文章心情4", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_5", value = "文章心情5", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_6", value = "文章心情6", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_short", value = "文章短标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_flag", value = "文章态度开关1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_image_flag", value = "文章推荐标志(图文)", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_share_count", value = "文章分享数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_reason", value = "审核失败原因", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_name", value = "文章分类名称", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_display", value = "文章是否显示", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_agree_count", value = "文章点赞数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_link", value = "文章外部链接", required = true,  dataTypeClass = String.class)
        })
        @OperateLog(name = "根据-{在线电子写作表}-对象Map查询记录",value = "query",type = "APP")
        public Map<String, Object>  getOneForEbookArticleForApp(HttpServletRequest request , HttpServletResponse response,@RequestBody Map<String, Object> map)
        {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

        result.put(DATASUCCESS, SUCCESSFLAG);
        result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
        result.put(DATARECORD, ebookArticleService.getOne(map));
        }catch(Exception e){
        result.put(DATASUCCESS, ERRORFLAG);
        result.put(DATAMESSAGE, QUERY_FAIL_MSG+e.getMessage());
        }
        return result;
        }

        @PostMapping( "/getAll")
        @ApiOperation(value="根据-{在线电子写作表}-对象Map查询所有记录", notes="成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
        @ApiImplicitParams({
        @ApiImplicitParam(paramType="body", name = "id", value = "文章编号", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_title", value = "文章标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_id", value = "文章分类编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_origin", value = "文章来源", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_origin_address", value = "文章来源链接", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_author", value = "文章作者", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_abstract", value = "文章摘要", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_content", value = "文章正文", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image", value = "文章图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_keyword", value = "文章关键字", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_link", value = "相关文章", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_goods", value = "相关内容", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_start_time", value = "文章有效期开始时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_end_time", value = "文章有效期结束时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_publish_time", value = "文章发布时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_click", value = "文章点击量", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_sort", value = "文章排序0-255", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_flag", value = "文章推荐标志0-未推荐，1-已推荐", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_flag", value = "文章是否允许评论1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_admin", value = "文章审核管理员", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_time", value = "文章审核时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_state", value = "1-草稿、2-待审核、3-已发布、4-回收站", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_name", value = "发布者用户名 ", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_id", value = "发布者编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_type", value = "文章类型1-管理员发布，2-用户投稿", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attachment_path", value = "文章附件路径", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image_all", value = "文章全部图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_modify_time", value = "文章修改时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_tag", value = "文章标签", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_count", value = "文章评论数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_1", value = "文章心情1", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_2", value = "文章心情2", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_3", value = "文章心情3", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_4", value = "文章心情4", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_5", value = "文章心情5", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_6", value = "文章心情6", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_short", value = "文章短标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_flag", value = "文章态度开关1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_image_flag", value = "文章推荐标志(图文)", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_share_count", value = "文章分享数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_reason", value = "审核失败原因", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_name", value = "文章分类名称", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_display", value = "文章是否显示", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_agree_count", value = "文章点赞数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_link", value = "文章外部链接", required = true,  dataTypeClass = String.class)
        })
        @OperateLog(name = "根据-{在线电子写作表}-对象Map查询所有记录",value = "query",type = "APP")
        public Map<String, Object>  getAllForEbookArticleForApp(HttpServletRequest request , HttpServletResponse response,@RequestBody Map<String, Object> map)
        {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

        result.put(DATASUCCESS, SUCCESSFLAG);
        result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
        result.put(DATALIST, ebookArticleService.getAll(map));
        }catch(Exception e){
        result.put(DATASUCCESS, ERRORFLAG);
        result.put(DATAMESSAGE, QUERY_FAIL_MSG+e.getMessage());
        }
        return result;
        }

        @PostMapping( "/queryPage")
        @ApiOperation(value="根据-{在线电子写作表}-对象Map分页记录", notes="成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
        @ApiImplicitParams({
        @ApiImplicitParam(paramType="body", name = "id", value = "文章编号", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_title", value = "文章标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_id", value = "文章分类编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_origin", value = "文章来源", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_origin_address", value = "文章来源链接", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_author", value = "文章作者", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_abstract", value = "文章摘要", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_content", value = "文章正文", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image", value = "文章图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_keyword", value = "文章关键字", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_link", value = "相关文章", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_goods", value = "相关内容", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_start_time", value = "文章有效期开始时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_end_time", value = "文章有效期结束时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_publish_time", value = "文章发布时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_click", value = "文章点击量", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_sort", value = "文章排序0-255", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_flag", value = "文章推荐标志0-未推荐，1-已推荐", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_flag", value = "文章是否允许评论1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_admin", value = "文章审核管理员", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_time", value = "文章审核时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_state", value = "1-草稿、2-待审核、3-已发布、4-回收站", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_name", value = "发布者用户名 ", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_id", value = "发布者编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_type", value = "文章类型1-管理员发布，2-用户投稿", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attachment_path", value = "文章附件路径", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image_all", value = "文章全部图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_modify_time", value = "文章修改时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_tag", value = "文章标签", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_count", value = "文章评论数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_1", value = "文章心情1", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_2", value = "文章心情2", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_3", value = "文章心情3", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_4", value = "文章心情4", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_5", value = "文章心情5", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_6", value = "文章心情6", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_short", value = "文章短标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_flag", value = "文章态度开关1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_image_flag", value = "文章推荐标志(图文)", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_share_count", value = "文章分享数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_reason", value = "审核失败原因", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_name", value = "文章分类名称", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_display", value = "文章是否显示", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_agree_count", value = "文章点赞数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_link", value = "文章外部链接", required = true,  dataTypeClass = String.class)
        })
        @OperateLog(name = "根据-{在线电子写作表}-对象Map分页记录",value = "query",type = "APP")
        public Map<String, Object>  queryPageForEbookArticleForApp(HttpServletRequest request , HttpServletResponse response,@RequestBody Map<String, Object> map)
        {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

        int currentPage = map.get(DATACURRENT)!=null?Integer.parseInt(map.get(DATACURRENT)+"")-1:0;
        int pageSize = map.get(PAGESIZE)!=null?Integer.parseInt(map.get(PAGESIZE)+""):10;
        int pageStart = currentPage*pageSize ;

        map.put(PAGESIZE,pageSize);
        map.put(PAGESTART,pageStart);

        int total = ebookArticleService.count(map);
        List<Map<String, Object>> datalist = new ArrayList<Map<String, Object>>();
        if(total>0){
        datalist = ebookArticleService.queryPage(map);
        }
        result.put(DATASUCCESS, SUCCESSFLAG);
        result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
        result.put(DATALIST,datalist);
        Map<String, Object> pagemode = new HashMap<String, Object>();
        pagemode.put(DATATOTAL,total);
        pagemode.put(PAGESIZE,map.get(PAGESIZE)!=null?map.get(PAGESIZE):10);
        pagemode.put(DATACURRENT,map.get(DATACURRENT)!=null?map.get(DATACURRENT):0);
        result.put(PAGINATION,pagemode);
        }catch(Exception e){
        result.put(DATASUCCESS, ERRORFLAG);
        result.put(DATAMESSAGE, QUERY_FAIL_MSG+e.getMessage());
        }
        return result;
        }

        @PostMapping( "/count")
        @ApiOperation(value="根据-{在线电子写作表}-对象Map统计查询总数记录", notes="成功返回:{\"success\":true,\"message\",\"数据查询成功\",\"data\":\"[]\"},失败返回:{\"success\":false,\"message\",\"数据查询失败\"}")
        @ApiImplicitParams({
        @ApiImplicitParam(paramType="body", name = "id", value = "文章编号", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_title", value = "文章标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_id", value = "文章分类编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_origin", value = "文章来源", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_origin_address", value = "文章来源链接", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_author", value = "文章作者", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_abstract", value = "文章摘要", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_content", value = "文章正文", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image", value = "文章图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_keyword", value = "文章关键字", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_link", value = "相关文章", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_goods", value = "相关内容", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_start_time", value = "文章有效期开始时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_end_time", value = "文章有效期结束时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_publish_time", value = "文章发布时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_click", value = "文章点击量", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_sort", value = "文章排序0-255", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_flag", value = "文章推荐标志0-未推荐，1-已推荐", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_flag", value = "文章是否允许评论1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_admin", value = "文章审核管理员", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_time", value = "文章审核时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_state", value = "1-草稿、2-待审核、3-已发布、4-回收站", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_name", value = "发布者用户名 ", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_id", value = "发布者编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_type", value = "文章类型1-管理员发布，2-用户投稿", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attachment_path", value = "文章附件路径", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image_all", value = "文章全部图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_modify_time", value = "文章修改时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_tag", value = "文章标签", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_count", value = "文章评论数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_1", value = "文章心情1", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_2", value = "文章心情2", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_3", value = "文章心情3", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_4", value = "文章心情4", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_5", value = "文章心情5", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_6", value = "文章心情6", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_short", value = "文章短标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_flag", value = "文章态度开关1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_image_flag", value = "文章推荐标志(图文)", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_share_count", value = "文章分享数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_reason", value = "审核失败原因", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_name", value = "文章分类名称", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_display", value = "文章是否显示", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_agree_count", value = "文章点赞数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_link", value = "文章外部链接", required = true,  dataTypeClass = String.class)
        })
        @OperateLog(name = "根据-{在线电子写作表}-对象Map统计查询总数记录",value = "query",type = "APP")
        public Map<String, Object>  countForEbookArticleForApp(HttpServletRequest request , HttpServletResponse response,@RequestBody Map<String, Object> map)
        {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

        result.put(DATASUCCESS, SUCCESSFLAG);
        result.put(DATAMESSAGE, QUERY_SUCCESS_MSG);
        result.put(DATATOTAL, ebookArticleService.count(map));
        }catch(Exception e){
        result.put(DATASUCCESS, ERRORFLAG);
        result.put(DATAMESSAGE, QUERY_FAIL_MSG+e.getMessage());
        }
        return result;
        }

        @PostMapping( "/insertBatch")
        @ApiOperation(value="根据-{在线电子写作表}-对象Map批量插入记录", notes="成功返回:{\"success\":true,\"message\",\"数据插入成功\"},失败返回:{\"success\":false,\"message\",\"数据插入失败\"}")
        @ApiImplicitParams({
        @ApiImplicitParam(paramType="body", name = "id", value = "文章编号", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_title", value = "文章标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_id", value = "文章分类编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_origin", value = "文章来源", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_origin_address", value = "文章来源链接", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_author", value = "文章作者", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_abstract", value = "文章摘要", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_content", value = "文章正文", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image", value = "文章图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_keyword", value = "文章关键字", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_link", value = "相关文章", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_goods", value = "相关内容", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_start_time", value = "文章有效期开始时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_end_time", value = "文章有效期结束时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_publish_time", value = "文章发布时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_click", value = "文章点击量", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_sort", value = "文章排序0-255", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_flag", value = "文章推荐标志0-未推荐，1-已推荐", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_flag", value = "文章是否允许评论1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_admin", value = "文章审核管理员", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_time", value = "文章审核时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_state", value = "1-草稿、2-待审核、3-已发布、4-回收站", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_name", value = "发布者用户名 ", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_id", value = "发布者编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_type", value = "文章类型1-管理员发布，2-用户投稿", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attachment_path", value = "文章附件路径", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image_all", value = "文章全部图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_modify_time", value = "文章修改时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_tag", value = "文章标签", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_count", value = "文章评论数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_1", value = "文章心情1", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_2", value = "文章心情2", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_3", value = "文章心情3", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_4", value = "文章心情4", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_5", value = "文章心情5", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_6", value = "文章心情6", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_short", value = "文章短标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_flag", value = "文章态度开关1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_image_flag", value = "文章推荐标志(图文)", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_share_count", value = "文章分享数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_reason", value = "审核失败原因", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_name", value = "文章分类名称", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_display", value = "文章是否显示", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_agree_count", value = "文章点赞数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_link", value = "文章外部链接", required = true,  dataTypeClass = String.class)
        })
        @OperateLog(name = "根据-{在线电子写作表}-对象Map批量插入记录",value = "insert",type = "APP")
        public Map<String, Object>  insertBatchForEbookArticleForApp(HttpServletRequest request , HttpServletResponse response,@RequestBody List<Map<String, Object>> list)
        {
        Map<String, Object> result = new HashMap<String, Object>();
        try {

        for(Map<String, Object> map:list){
        map.put("id", UUID.randomUUID().toString().replaceAll("-", ""));
        }

        ebookArticleService.insertBatch(list);
        result.put(DATASUCCESS, SUCCESSFLAG);
        result.put(DATAMESSAGE, INSERT_SUCCESS_MSG);
        }catch(Exception e){
        result.put(DATASUCCESS, ERRORFLAG);
        result.put(DATAMESSAGE, INSERT_FAIL_MSG+e.getMessage());
        }
        return result;
        }

        @PostMapping( "/deleteBatch")
        @ApiOperation(value="根据-{在线电子写作表}-对象Map批量删除记录", notes="成功返回:{\"success\":true,\"message\",\"数据删除成功\"},失败返回:{\"success\":false,\"message\",\"数据删除失败\"}")
        @ApiImplicitParams({
        @ApiImplicitParam(paramType="body", name = "id", value = "文章编号", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_title", value = "文章标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_id", value = "文章分类编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_origin", value = "文章来源", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_origin_address", value = "文章来源链接", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_author", value = "文章作者", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_abstract", value = "文章摘要", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_content", value = "文章正文", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image", value = "文章图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_keyword", value = "文章关键字", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_link", value = "相关文章", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_goods", value = "相关内容", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_start_time", value = "文章有效期开始时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_end_time", value = "文章有效期结束时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_publish_time", value = "文章发布时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_click", value = "文章点击量", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_sort", value = "文章排序0-255", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_flag", value = "文章推荐标志0-未推荐，1-已推荐", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_flag", value = "文章是否允许评论1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_admin", value = "文章审核管理员", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_time", value = "文章审核时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_state", value = "1-草稿、2-待审核、3-已发布、4-回收站", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_name", value = "发布者用户名 ", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_id", value = "发布者编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_type", value = "文章类型1-管理员发布，2-用户投稿", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attachment_path", value = "文章附件路径", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image_all", value = "文章全部图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_modify_time", value = "文章修改时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_tag", value = "文章标签", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_count", value = "文章评论数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_1", value = "文章心情1", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_2", value = "文章心情2", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_3", value = "文章心情3", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_4", value = "文章心情4", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_5", value = "文章心情5", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_6", value = "文章心情6", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_short", value = "文章短标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_flag", value = "文章态度开关1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_image_flag", value = "文章推荐标志(图文)", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_share_count", value = "文章分享数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_reason", value = "审核失败原因", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_name", value = "文章分类名称", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_display", value = "文章是否显示", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_agree_count", value = "文章点赞数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_link", value = "文章外部链接", required = true,  dataTypeClass = String.class)
        })
        @OperateLog(name = "根据-{在线电子写作表}-对象Map批量删除记录",value = "delete",type = "APP")
        public Map<String, Object>  deleteBatchForEbookArticleForApp(HttpServletRequest request , HttpServletResponse response,@RequestBody List<Map<String, Object>> list)
        {
        Map<String, Object> result = new HashMap<String, Object>();
        try {
        ebookArticleService.deleteBatch(list);
        result.put(DATASUCCESS, SUCCESSFLAG);
        result.put(DATAMESSAGE, DELETE_SUCCESS_MSG);

        }catch(Exception e){
        result.put(DATASUCCESS, ERRORFLAG);
        result.put(DATAMESSAGE, DELETE_FAIL_MSG+e.getMessage());
        }
        return result;
        }

        @PostMapping( "/updateBatch")
        @ApiOperation(value="根据-{在线电子写作表}-对象Map批量更新记录", notes="成功返回:{\"success\":true,\"message\",\"数据更新成功\"},失败返回:{\"success\":false,\"message\",\"数据更新失败\"}")
        @ApiImplicitParams({
        @ApiImplicitParam(paramType="body", name = "id", value = "文章编号", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_title", value = "文章标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_id", value = "文章分类编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_origin", value = "文章来源", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_origin_address", value = "文章来源链接", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_author", value = "文章作者", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_abstract", value = "文章摘要", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_content", value = "文章正文", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image", value = "文章图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_keyword", value = "文章关键字", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_link", value = "相关文章", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_goods", value = "相关内容", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_start_time", value = "文章有效期开始时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_end_time", value = "文章有效期结束时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_publish_time", value = "文章发布时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_click", value = "文章点击量", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_sort", value = "文章排序0-255", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_flag", value = "文章推荐标志0-未推荐，1-已推荐", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_flag", value = "文章是否允许评论1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_admin", value = "文章审核管理员", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_time", value = "文章审核时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_state", value = "1-草稿、2-待审核、3-已发布、4-回收站", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_name", value = "发布者用户名 ", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_publisher_id", value = "发布者编号", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_type", value = "文章类型1-管理员发布，2-用户投稿", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attachment_path", value = "文章附件路径", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_image_all", value = "文章全部图片", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_modify_time", value = "文章修改时间", required = true, dataType = "Date", dataTypeClass = Date.class),
        @ApiImplicitParam(paramType="body", name = "article_tag", value = "文章标签", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_comment_count", value = "文章评论数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_1", value = "文章心情1", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_2", value = "文章心情2", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_3", value = "文章心情3", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_4", value = "文章心情4", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_5", value = "文章心情5", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_6", value = "文章心情6", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_short", value = "文章短标题", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_attitude_flag", value = "文章态度开关1-允许，0-不允许", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_commend_image_flag", value = "文章推荐标志(图文)", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_share_count", value = "文章分享数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_verify_reason", value = "审核失败原因", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_class_name", value = "文章分类名称", required = true,  dataTypeClass = String.class),
        @ApiImplicitParam(paramType="body", name = "article_display", value = "文章是否显示", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_agree_count", value = "文章点赞数", required = true, dataType = "int", dataTypeClass = int.class),
        @ApiImplicitParam(paramType="body", name = "article_title_link", value = "文章外部链接", required = true,  dataTypeClass = String.class)
        })
        @OperateLog(name = "根据-{在线电子写作表}-对象Map批量更新记录",value = "update",type = "APP")
        public Map<String, Object>  updateBatchForEbookArticleForApp(HttpServletRequest request , HttpServletResponse response,@RequestBody List<Map<String, Object>> list)
        {
        Map<String, Object> result = new HashMap<String, Object>();
        try {


        ebookArticleService.updateBatch(list);
        result.put(DATASUCCESS, SUCCESSFLAG);
        result.put(DATAMESSAGE, UPDATE_SUCCESS_MSG);

        }catch(Exception e){
        result.put(DATASUCCESS, ERRORFLAG);
        result.put(DATAMESSAGE, UPDATE_FAIL_MSG+e.getMessage());
        }
        return result;
        }

                /**
                 * 判断当前的span标签是否需要处理
                 * 1.如果父标签是span而且没有兄弟标签即处理 ,并且只有一个子元素的时候不是span,也可以有多个子元素
                 * @param element
                 *
                 * @return bool
                 */
                public Boolean isWaitingHandleSpanNode(Element element)
                {
                        Boolean isWaiting = false;
                        //父标签为span且无兄无弟
                        if(element.parentNode().nodeName() == "span" && element.nextSibling() == null && element.previousSibling() == null) {
                                if(element.childNodes().size() != 1){
                                        isWaiting = true;
                                }else if(element.childNodes().size() == 1 && element.childNodes().get(0).nodeName() != "span"){
                                        isWaiting = true;
                                }
                        }
                        return isWaiting;
                }

                /**
                 * 将符合条件的span节点删除，并将样式及内容交还给父亲,并且递归调用
                 * @param element
                 */
                public void handleSpanNode(Element element) {
                        String nodeStyle = element.attr("style");
                        Node parentNode = element.parentNode();
                        parentNode.attr("style", parentNode.attr("style") + ';' + nodeStyle);
                        List<Node> nodes = element.childNodesCopy();
                        if(nodes.size() > 0){
                                for (Node childNode : nodes) {
                                        Element parentElement = (Element) parentNode;
                                        parentElement.appendChild(childNode);
                                        element.remove();
                                }
                        }
                        if (isWaitingHandleSpanNode((Element) parentNode)) {
                                handleSpanNode((Element) parentNode);
                        }
                }

        }
