xueyiming 8 miesięcy temu
rodzic
commit
85741808ee

+ 0 - 2
README_副本.md

@@ -1,2 +0,0 @@
-# long-article-manage
-

+ 12 - 0
long-article-server/pom.xml

@@ -0,0 +1,12 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.tzld.piaoquan</groupId>
+        <artifactId>long-article-manage</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <artifactId>long-article-server</artifactId>
+    <name>long-article-server</name>
+    <url>http://maven.apache.org</url>
+</project>

+ 12 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/LongArticleServerApplication.java

@@ -0,0 +1,12 @@
+package com.tzld.piaoquan.longarticle;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class LongArticleServerApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(LongArticleServerApplication.class, args);
+    }
+}

+ 20 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/controller/IndexController.java

@@ -0,0 +1,20 @@
+package com.tzld.piaoquan.longarticle.controller;
+
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/")
+public class IndexController {
+
+    /**
+     * 探活
+     *
+     * @return
+     */
+    @GetMapping("/healthcheck")
+    public String healthcheck() {
+        return "ok";
+    }
+}

+ 84 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/DouyinSearch.java

@@ -0,0 +1,84 @@
+package com.tzld.piaoquan.longarticle.utils;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
+import cn.hutool.json.JSONUtil;
+import cn.hutool.json.JSONObject;
+import java.util.ArrayList;
+import java.util.List;
+
+public class DouyinSearch {
+
+    public static List<JSONObject> douyinSearch(String keyword, String sensitiveWords, String traceId) {
+        String url = "http://8.217.190.241:8888/crawler/dou_yin/top_hub_content";
+        JSONObject payload = new JSONObject();
+        payload.put("keyword", keyword);
+        payload.put("category", "全部");
+        payload.put("period", "近90天");
+        payload.put("content_modal", "视频");
+        payload.put("cursor", "");
+
+        HttpResponse response = HttpRequest.post(url)
+                .header("Content-Type", "application/json")
+                .body(payload.toString())
+                .execute();
+
+        List<JSONObject> resultList = new ArrayList<>();
+
+        try {
+            JSONObject jsonResponse = JSONUtil.parseObj(response.body());
+            List<JSONObject> dtList = jsonResponse.getByPath("data.data", List.class);
+
+            for (JSONObject obj : dtList) {
+                try {
+                    String title = obj.getStr("video_desc");
+                    String videoId = obj.getStr("video_id");
+                    int duration = obj.getInt("duration");
+
+                    if (sensitiveFlag(sensitiveWords, title) && duration < 30000) {
+                        JSONObject res = douyinDetail(videoId);
+                        if (res != null) {
+                            resultList.add(res);
+                        }
+                    }
+                } catch (Exception e) {
+                    System.out.println(e.getMessage());
+                    // 处理异常
+                }
+            }
+
+            return resultList;
+        } catch (Exception e) {
+            return new ArrayList<>();
+        }
+    }
+
+    public static JSONObject douyinDetail(String videoId) {
+        String url = "http://8.217.190.241:8888/crawler/dou_yin/detail";
+        JSONObject payload = new JSONObject();
+        payload.put("content_id", videoId);
+
+        HttpResponse response = HttpRequest.post(url)
+                .header("Content-Type", "application/json")
+                .body(payload.toString())
+                .execute();
+
+        JSONObject videoInfo = JSONUtil.parseObj(response.body()).getByPath("data.data", JSONObject.class);
+
+        if ("note".equals(videoInfo.getStr("content_type"))) {
+            return null;
+        } else {
+            return videoInfo;
+        }
+    }
+
+    private static boolean sensitiveFlag(String sensitiveWords, String title) {
+        // 实现敏感词检查逻辑
+        return true; // 示例
+    }
+
+    public static void main(String[] args) {
+        System.out.println(douyinSearch("美女", "", ""));
+    }
+}
+
+

+ 183 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/HkspSearch.java

@@ -0,0 +1,183 @@
+package com.tzld.piaoquan.longarticle.utils;
+
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+
+import java.io.IOException;
+import java.net.Authenticator;
+import java.net.InetSocketAddress;
+import java.net.PasswordAuthentication;
+import java.net.Proxy;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.List;
+import java.util.UUID;
+
+public class HkspSearch {
+
+
+
+    public static void main(String[] args) throws IOException {
+        System.out.println(hkspSearch("测试", "", "ccc"));
+
+    }
+
+    public static List<JSONObject> hkspSearch(String key, String sensitiveWords, String traceId) throws IOException {
+        long timestampMilliseconds = System.currentTimeMillis();
+        String url = "https://haokan.baidu.com/haokan/ui-search/pc/search/video";
+
+        // 生成签名
+        String strings = String.format("%d_%s_%d_%d_%d", 1, key, 10, timestampMilliseconds, 1);
+        String sign = md5(strings);
+
+        JSONObject params = new JSONObject();
+        params.put("pn", 1);
+        params.put("rn", 10);
+        params.put("type", "video");
+        params.put("query", key);
+        params.put("sign", sign);
+        params.put("version", 1);
+        params.put("timestamp", timestampMilliseconds);
+
+        String base64String = Base64.getEncoder().encodeToString(UUID.randomUUID().toString().getBytes());
+
+        // 这行代码是身份验证的关键配置,不然身份验证不起作用
+        System.setProperty("jdk.http.auth.tunneling.disabledSchemes", "");
+        // 身份验证
+        Authenticator.setDefault(
+                new Authenticator() {
+                    public PasswordAuthentication getPasswordAuthentication() {
+                        return new PasswordAuthentication(
+                                "t11983523373311", "mtuhdr2z".toCharArray());
+                    }
+                }
+        );
+        // 设置代理服务器
+        Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("l901.kdltps.com", 15818));
+        HttpResponse response = HttpRequest.get(url)
+                .header("authority", "haokan.baidu.com")
+                .header("accept", "*/*")
+                .header("accept-language", "zh,en;q=0.9,zh-CN;q=0.8")
+                .header("cookie", "BIDUPSID=" + base64String)
+                .header("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0") // 假用户代理
+                .header("x-requested-with", "xmlhttprequest")
+                .timeout(120000) // 设置超时时间
+//                .setProxy(proxy)
+                .form(params)
+                .execute();
+
+        List<JSONObject> resultList = new ArrayList<>();
+        try {
+            System.out.println(response.body());
+            JSONObject jsonResponse = JSONUtil.parseObj(response.body());
+            List<JSONObject> dataList = jsonResponse.getByPath("data.list", List.class);
+
+            for (JSONObject data : dataList) {
+                try {
+                    String videoId = data.getStr("vid");
+                    String title = data.getStr("title");
+                    int duration = parseDuration(data.getStr("duration"));
+
+                    if (sensitiveFlag(sensitiveWords, title) && duration <= 300) {
+                        JSONObject res = getVideoDetail(videoId);
+                        if (res != null) {
+                            resultList.add(res);
+                        }
+                    }
+                } catch (Exception e) {
+                    // 处理异常
+                }
+            }
+
+            logging(traceId, key, dataList.size(), resultList.size());
+            return resultList;
+        } catch (Exception e) {
+            logging(traceId, key, e.getMessage());
+            return new ArrayList<>();
+        }
+    }
+
+    private static int parseDuration(String duration) {
+        String[] parts = duration.split(":");
+        return Integer.parseInt(parts[0]) * 60 + Integer.parseInt(parts[1]);
+    }
+
+    private static String md5(String input) {
+        try {
+            MessageDigest md = MessageDigest.getInstance("MD5");
+            byte[] messageDigest = md.digest(input.getBytes());
+            StringBuilder sb = new StringBuilder();
+            for (byte b : messageDigest) {
+                sb.append(String.format("%02x", b));
+            }
+            return sb.toString();
+        } catch (NoSuchAlgorithmException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    private static boolean sensitiveFlag(String sensitiveWords, String title) {
+        // 实现敏感词检查逻辑
+        return true; // 示例
+    }
+
+    private static void logging(String traceId, String key, int searchCount, int usefulCount) {
+        // 实现日志记录逻辑
+    }
+
+    private static void logging(String traceId, String key, String message) {
+        // 实现日志记录逻辑
+    }
+
+    public static JSONObject getVideoDetail(String videoId) {
+
+
+        String url = "https://haokan.baidu.com/v";
+        JSONObject params = new JSONObject();
+        params.put("vid", videoId);
+        params.put("_format", "json");
+
+        String base64String = Base64.getEncoder().encodeToString(UUID.randomUUID().toString().getBytes());
+        HttpRequest proxyHttpRequest = getProxyHttpRequest(url);
+        HttpResponse response = proxyHttpRequest
+                .header("Accept", "*/*")
+                .header("cookie", "BIDUPSID=" + base64String)
+                .header("Accept-Language", "en,zh;q=0.9,zh-CN;q=0.8")
+                .header("Cache-Control", "no-cache")
+                .header("Connection", "keep-alive")
+                .header("Content-Type", "application/x-www-form-urlencoded")
+                .header("Referer", "https://haokan.baidu.com")
+                .form(params)
+
+                .setProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("l901.kdltps.com", 15818)))
+                .basicProxyAuth("t11983523373311", "mtuhdr2z")
+                .execute();
+
+        return JSONUtil.parseObj(response.body()).getByPath("data.apiData.curVideoMeta", JSONObject.class);
+    }
+
+    public static HttpRequest getProxyHttpRequest(String url) {
+
+        // 代理的地址和端口
+        String proxyHost = "l901.kdltps.com";
+        int proxyPort = 15818;
+
+        // 用户名和密码
+        String username = "t11983523373311"; // 替换为你的用户名
+        String password = "mtuhdr2z"; // 替换为你的密码
+
+        // 创建代理请求
+        String proxyUrl = String.format("https://%s:%s@%s:%d", username, password, proxyHost, proxyPort);
+
+        // 发送请求
+        HttpRequest httpRequest = HttpRequest.get(url) // 替换为你要请求的 URL
+                .proxyAuth(proxyUrl);
+        return httpRequest;
+    }
+
+
+}

+ 56 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/KimiAPI.java

@@ -0,0 +1,56 @@
+package com.tzld.piaoquan.longarticle.utils;
+
+import cn.hutool.http.HttpRequest;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class KimiAPI {
+
+    /**
+     * 聊天端点
+     */
+    static String chatEndpoint = "https://api.moonshot.cn/v1/chat/completions";
+    /**
+     * api密匙
+     */
+    static String apiKey = "Bearer sk-5DqYCa88kche6nwIWjLE1p4oMm8nXrR9kQMKbBolNAWERu7q";
+
+    /**
+     * 发送消息
+     *
+     * @param txt 内容
+     * @return {@link String}
+     */
+    public static String chat(String txt) {
+        Map<String, Object> paramMap = new HashMap<>();
+        paramMap.put("model", "moonshot-v1-8k");
+        List<Map<String, String>> dataList = new ArrayList<>();
+        dataList.add(new HashMap<String, String>() {{
+            put("role", "user");
+            put("content", txt);
+        }});
+        paramMap.put("messages", dataList);
+        JSONObject message = null;
+        try {
+            String body = HttpRequest.post(chatEndpoint)
+                    .header("Authorization", apiKey)
+                    .header("Content-Type", "application/json")
+                    .body(JSONObject.toJSONString(paramMap))
+                    .execute()
+                    .body();
+            JSONObject jsonObject = JSONObject.parseObject(body);
+            JSONArray choices = jsonObject.getJSONArray("choices");
+            JSONObject result = choices.getJSONObject(0);
+            message = result.getJSONObject("message");
+            return message.getString("content");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return "";
+    }
+}

+ 88 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/OpenAIAPI.java

@@ -0,0 +1,88 @@
+package com.tzld.piaoquan.longarticle.utils;
+
+import cn.hutool.core.convert.ConvertException;
+import cn.hutool.http.HttpException;
+import cn.hutool.http.HttpRequest;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.*;
+
+public class OpenAIAPI {
+
+    /**
+     * 聊天端点
+     */
+    static String chatEndpoint = "https://api.openai.com/v1/chat/completions";
+    /**
+     * api密匙
+     */
+    static String apiKey = "Bearer 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";
+
+    /**
+     * 发送消息
+     *
+     * @param txt 内容
+     * @return {@link String}
+     */
+    public static String chat(String txt) {
+        Map<String, Object> paramMap = new HashMap<>();
+        paramMap.put("model", "gpt-3.5-turbo");
+        List<Map<String, String>> dataList = new ArrayList<>();
+        dataList.add(new HashMap<String, String>() {{
+            put("role", "user");
+            put("content", txt);
+        }});
+        paramMap.put("messages", dataList);
+        JSONObject message = null;
+        try {
+            String body = HttpRequest.post(chatEndpoint)
+                    .header("Authorization", apiKey)
+                    .header("Content-Type", "application/json")
+                    .body(JSONObject.toJSONString(paramMap))
+                    .execute()
+                    .body();
+            JSONObject jsonObject = JSONObject.parseObject(body);
+            JSONArray choices = jsonObject.getJSONArray("choices");
+            JSONObject result = choices.getJSONObject(0);
+            message = result.getJSONObject("message");
+        } catch (HttpException e) {
+            return "出现了异常";
+        } catch (ConvertException e) {
+            return "出现了异常";
+        }
+        return message.getString("content");
+    }
+
+    public static String promptGenerate(String promptType) {
+        if (Objects.equals(promptType, "title")) {
+            return " 请将以上标题改写成适合小程序点击和传播的小程序标题,小程序标题的写作规范如下,请学习后进行小程序标题的编写。直接输出最终的小程序标题\n" +
+                    "                小程序标题写作规范:\n" +
+                    "                1.要点前置:将最重要的信息放在标题的最前面,以快速吸引读者的注意力。例如,“5月一辈子同学,三辈子亲,送给我的老同学,听哭无数人!”中的“5月”和“一辈子同学,三辈子亲”都是重要的信息点。\n" +
+                    "                2.激发情绪:使用能够触动人心的语言,激发读者的情感共鸣。如“只剩两人同学聚会,看后感动落泪。”使用“感动落泪”激发读者的同情和怀旧情绪。\n" +
+                    "                3.使用数字和特殊符号:数字可以提供具体性,而特殊符号如“\uD83D\uDD34”、“\uD83D\uDE04”、“\uD83D\uDD25”等可以吸引视觉注意力,增加点击率。\n" +
+                    "                4.悬念和好奇心:创建悬念或提出问题,激发读者的好奇心。例如,“太神奇了!长江水位下降,重庆出现惊奇一幕!”中的“惊奇一幕”就是一个悬念。\n" +
+                    "                5.名人效应:如果内容与知名人士相关,提及他们的名字可以增加标题的吸引力。\n" +
+                    "                6.社会价值观:触及读者的文化和社会价值观,如家庭、友情、国家荣誉等。\n" +
+                    "                7.标点符号的运用:使用感叹号、问号等标点来增强语气和情感表达。\n" +
+                    "                8.直接的语言:使用直白、口语化的语言,易于理解,如“狗屁股,笑死我了!”。\n" +
+                    "                9.热点人物或事件:提及当前的热点人物或事件,利用热点效应吸引读者。\n" +
+                    "                10.字数适中:保持标题在10-20个字之间,既不过长也不过短,确保信息的完整性和吸引力。\n" +
+                    "                11.适当的紧迫感:使用“最新”、“首次”、“紧急”等词汇,创造一种紧迫感,促使读者立即行动。\n" +
+                    "                12.情感或价值诉求:使用如“感动”、“泪目”、“经典”等词汇,直接与读者的情感或价值观产生共鸣。\n" +
+                    "                避免误导:确保标题准确反映内容,避免夸大或误导读者。";
+
+        } else if (Objects.equals(promptType, "text")) {
+            return "请从我给你的文章中挖掘出以下信息并且返回如下结果。\n" +
+                    "                你返回的结果是一个 json, 格式如下:\n" +
+                    "                {\n" +
+                    "                    \"content_keys\": [] # 同时提供三个与文章内容高度相关的关键词,这些关键词将用于网络上搜索相关视频内容,\n" +
+                    "                    \"content_title\": 一个总结性的标题,该标题应简洁并能够反映文章的主要内容\n" +
+                    "                }\n" +
+                    "                你需要处理的文本是:";
+        } else {
+            return "用中文帮我回答以下问题";
+        }
+    }
+
+}

+ 85 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/getContentUtil.java

@@ -0,0 +1,85 @@
+package com.tzld.piaoquan.longarticle.utils;
+
+import com.alibaba.fastjson.JSONObject;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.Objects;
+
+public class getContentUtil {
+    public static void main(String[] args) {
+        String articleTitle = "中国宣布重大消息,韩国被吓,美国不服气,俄罗斯和朝鲜都笑了!";
+        String articleContent = "在当前国际政治舞台上,中朝关系、朝鲜半岛安全局势以及广泛的国际政治关系如同一副错综复杂的画卷,引人注目。\n" +
+                "近期,中国外交部副部长孙卫东带领的代表团访问平壤的消息,为这幅画卷添上了新的一笔,引发了外界对中朝关系未来走向的广泛关注。\n" +
+                "自1949年10月6日中华人民共和国与朝鲜民主主义人民共和国正式建交以来,两国之间的友好合作关系历经风雨,但总体上保持稳定发展。\n" +
+                "两国在多个领域展开了深入合作,包括文化、教育、科技、体育和民生等领域,这些合作不仅加深了两国人民之间的相互理解和友谊,也为地区乃至全球的和平与发展作出了贡献。\n" +
+                "在经济领域,作为朝鲜的重要贸易伙伴和物质援助国,中国对于朝鲜的经济发展起着至关重要的支持作用。中国提供的各种援助,帮助朝鲜在经济上保持稳定,助推其发展。\n" +
+                "而在政治领域,中国一直致力于推动实现半岛无核化,维护朝鲜半岛及地区的和平稳定。在这一过程中,中朝两国保持了密切的沟通与协调。\n" +
+                "\n" +
+                "然而,朝鲜半岛的局势一直是国际政治关系中的一个热点问题。近年来,美国、日本和韩国加强了对朝鲜的军事压力,通过扩大联合军演、部署战略武器等方式,不断提升在半岛的军事存在感,这无疑增加了地区的紧张气氛。对此,俄罗斯表达了对朝鲜的支持,批评美日韩的军事行动,认为这些行动加剧了地区的不稳定因素。\n" +
+                "在这个背景下,中国外交部副部长孙卫东此次访问朝鲜,显得尤为重要。此访旨在深化中朝传统友好,特别是在两国建交75周年之际,进一步加强经济合作,并就朝鲜半岛局势等共同关心的国际和地区问题交换意见。\n" +
+                "这次访问不仅是两国关系发展的一个里程碑,也是在当前复杂国际形势下,中国致力于维护地区和平稳定、推动构建人类命运共同体理念的一个重要体现。\n" +
+                "中朝双方的此次接触,无疑将为推动解决朝鲜半岛问题、维护地区和平稳定发挥积极作用。作为朝鲜半岛问题的直接相关方和重要的地区国家,中国一直倡导通过对话和协商解决问题,反对外部势力的军事干预和压力策略,这一立场在当前形势下显得尤为重要。\n" +
+                "\n" +
+                "未来,随着国际形势的不断变化,中朝之间的合作将更加多元化和深入。两国之间不仅在经济上互为支持,在维护地区和平稳定、推动构建更加公正合理的国际政治经济新秩序方面,也将发挥更加积极的作用。\n" +
+                "作为国际社会的一份子,希望所有国家都能本着相互尊重、平等互利的原则,共同努力,为实现地区乃至全球的和平、稳定与发展作出应有的贡献。\n" +
+                "在国际政治的大棋局中,中朝关系、朝鲜半岛的安全局势和国际政治关系的发展方向,始终是全球关注的焦点。本次中国外交部副部长孙卫东访问朝鲜,不仅是对两国传统友谊的再次肯定,更是在复杂的国际环境中,为维护地区和平稳定、推动构建人类命运共同体贡献中国的智慧和力量。\n" +
+                "让我们共同关注并支持这一重要的外交行动,期待它为地区乃至全球的和平与发展带来积极影响。转发此消息,让更多人了解国际局势的最新动向,共同为世界和平与稳定发声。";
+        String titleTxt = articleTitle + "\n" + promptGenerate("title");
+//        String kimiTitle = KimiAPI.chat(titleTxt);
+        String kimiTitle = "";
+        if (StringUtils.isEmpty(kimiTitle)) {
+            kimiTitle = OpenAIAPI.chat(titleTxt);
+        }
+        if (StringUtils.isEmpty(kimiTitle)) {
+            //TODO 处理异常
+            System.out.println("error");
+        }
+        kimiTitle = kimiTitle.replaceAll("'", "").replaceAll("\"", "").replace("\\", "");
+        System.out.println(kimiTitle);
+        String contentTxt = promptGenerate("text") + "\n" + articleContent;
+//        String kimiContent = KimiAPI.chat(contentTxt);
+        String kimiContent = "";
+        if (StringUtils.isEmpty(kimiContent)) {
+            kimiContent = OpenAIAPI.chat(contentTxt);
+        }
+        if (StringUtils.isEmpty(kimiContent)) {
+            //TODO 处理异常
+            System.out.println("error");
+        }
+        JSONObject jsonObject = JSONObject.parseObject(kimiContent);
+
+
+    }
+
+
+    public static String promptGenerate(String promptType) {
+        if (Objects.equals(promptType, "title")) {
+            return " 请将以上标题改写成适合小程序点击和传播的小程序标题,小程序标题的写作规范如下,请学习后进行小程序标题的编写。直接输出最终的小程序标题\n" +
+                    "                小程序标题写作规范:\n" +
+                    "                1.要点前置:将最重要的信息放在标题的最前面,以快速吸引读者的注意力。例如,“5月一辈子同学,三辈子亲,送给我的老同学,听哭无数人!”中的“5月”和“一辈子同学,三辈子亲”都是重要的信息点。\n" +
+                    "                2.激发情绪:使用能够触动人心的语言,激发读者的情感共鸣。如“只剩两人同学聚会,看后感动落泪。”使用“感动落泪”激发读者的同情和怀旧情绪。\n" +
+                    "                3.使用数字和特殊符号:数字可以提供具体性,而特殊符号如“\uD83D\uDD34”、“\uD83D\uDE04”、“\uD83D\uDD25”等可以吸引视觉注意力,增加点击率。\n" +
+                    "                4.悬念和好奇心:创建悬念或提出问题,激发读者的好奇心。例如,“太神奇了!长江水位下降,重庆出现惊奇一幕!”中的“惊奇一幕”就是一个悬念。\n" +
+                    "                5.名人效应:如果内容与知名人士相关,提及他们的名字可以增加标题的吸引力。\n" +
+                    "                6.社会价值观:触及读者的文化和社会价值观,如家庭、友情、国家荣誉等。\n" +
+                    "                7.标点符号的运用:使用感叹号、问号等标点来增强语气和情感表达。\n" +
+                    "                8.直接的语言:使用直白、口语化的语言,易于理解,如“狗屁股,笑死我了!”。\n" +
+                    "                9.热点人物或事件:提及当前的热点人物或事件,利用热点效应吸引读者。\n" +
+                    "                10.字数适中:保持标题在10-20个字之间,既不过长也不过短,确保信息的完整性和吸引力。\n" +
+                    "                11.适当的紧迫感:使用“最新”、“首次”、“紧急”等词汇,创造一种紧迫感,促使读者立即行动。\n" +
+                    "                12.情感或价值诉求:使用如“感动”、“泪目”、“经典”等词汇,直接与读者的情感或价值观产生共鸣。\n" +
+                    "                避免误导:确保标题准确反映内容,避免夸大或误导读者。";
+
+        } else if (Objects.equals(promptType, "text")) {
+            return "请从我给你的文章中挖掘出以下信息并且返回如下结果。\n" +
+                    "                你返回的结果是一个 json, 格式如下:\n" +
+                    "                {\n" +
+                    "                    \"content_keys\": [] # 同时提供三个与文章内容高度相关的关键词,这些关键词将用于网络上搜索相关视频内容,\n" +
+                    "                    \"content_title\": 一个总结性的标题,该标题应简洁并能够反映文章的主要内容\n" +
+                    "                }\n" +
+                    "                你需要处理的文本是:";
+        } else {
+            return "用中文帮我回答以下问题";
+        }
+    }
+}

+ 185 - 0
pom.xml

@@ -0,0 +1,185 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>com.tzld.commons</groupId>
+        <artifactId>supom</artifactId>
+        <version>1.0.6</version>
+    </parent>
+    <packaging>pom</packaging>
+    <modules>
+        <module>long-article-server</module>
+    </modules>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>com.tzld.piaoquan</groupId>
+    <artifactId>long-article-manage</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <name>long-article-manage</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-logging</artifactId>
+                </exclusion>
+            </exclusions>
+
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-log4j2</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>io.lettuce</groupId>
+            <artifactId>lettuce-core</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-pool2</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mybatis.generator</groupId>
+            <artifactId>mybatis-generator-core</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+
+        <!-- druid数据源 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid</artifactId>
+            <version>1.1.23</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>3.5.3.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.18.12</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.5.14</version> <!-- 使用最新版本 -->
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpmime -->
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpmime</artifactId>
+            <version>4.5.14</version>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore -->
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpcore</artifactId>
+            <version>4.4.16</version>
+        </dependency>
+
+
+
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>31.1-jre</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.aliyun.odps</groupId>
+            <artifactId>odps-sdk-core</artifactId>
+            <version>0.27.2-public</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.xuxueli</groupId>
+            <artifactId>xxl-job-core</artifactId>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.17.1</version>
+        </dependency>
+
+        <!--XML 解析包-->
+        <dependency>
+            <groupId>org.jdom</groupId>
+            <artifactId>jdom2</artifactId>
+            <version>2.0.6</version>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/cn.hutool/hutool-all -->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.8.33</version>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/cn.hutool/hutool-core -->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-core</artifactId>
+            <version>5.8.33</version>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/cn.hutool/hutool-http -->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-http</artifactId>
+            <version>5.8.33</version>
+        </dependency>
+
+
+
+    </dependencies>
+</project>