Browse Source

【项目开发】

1.增加代码示例
ChenYL 9 months ago
parent
commit
007e88dc42
20 changed files with 1075 additions and 10 deletions
  1. 1 0
      .idea/inspectionProfiles/Project_Default.xml
  2. 5 0
      data-easy/pom.xml
  3. 112 0
      data-easy/src/main/java/com/dataeasy/server/MpEntryController.java
  4. 37 0
      data-easy/src/main/java/com/dataeasy/server/core/config/WxMpProperties.java
  5. 23 1
      data-easy/src/main/resources/application-dev.yaml
  6. 3 3
      product-hunt/src/main/java/com/producthunt/server/AppEncryptor.java
  7. 50 4
      product-hunt/src/main/java/com/producthunt/server/TestController.java
  8. 1 0
      product-hunt/src/main/java/com/producthunt/server/core/config/FeignConfig.java
  9. 27 0
      product-hunt/src/main/java/com/producthunt/server/core/config/HzApiConfig.java
  10. 33 0
      product-hunt/src/main/java/com/producthunt/server/feign/FinanceFeign.java
  11. 32 0
      product-hunt/src/main/java/com/producthunt/server/feign/HzApiFeign.java
  12. 208 0
      product-hunt/src/main/java/com/producthunt/server/feign/dto/BondResponse.java
  13. 177 0
      product-hunt/src/main/java/com/producthunt/server/feign/dto/DaLeTouResponse.java
  14. 26 0
      product-hunt/src/main/java/com/producthunt/server/feign/dto/FinanceRequest.java
  15. 29 0
      product-hunt/src/main/java/com/producthunt/server/feign/dto/HzApiBaseResponse.java
  16. 22 0
      product-hunt/src/main/java/com/producthunt/server/feign/dto/HzApiRequest.java
  17. 122 0
      product-hunt/src/main/java/com/producthunt/server/feign/dto/ShuangSeQiuResponse.java
  18. 153 0
      product-hunt/src/main/java/com/producthunt/server/feign/dto/StockResponse.java
  19. 7 1
      product-hunt/src/main/resources/application-dev.yaml
  20. 7 1
      product-hunt/src/main/resources/application-prod.yaml

+ 1 - 0
.idea/inspectionProfiles/Project_Default.xml

@@ -1,5 +1,6 @@
 <component name="InspectionProjectProfileManager">
   <profile version="1.0">
     <option name="myName" value="Project Default" />
+    <inspection_tool class="SerializableHasSerialVersionUIDField" enabled="true" level="WARNING" enabled_by_default="true" />
   </profile>
 </component>

+ 5 - 0
data-easy/pom.xml

@@ -103,6 +103,11 @@
             <artifactId>wechatpay-java</artifactId>
             <version>${wechatpay.version}</version>
         </dependency>
+        <dependency>
+            <groupId>com.github.binarywang</groupId>
+            <artifactId>wx-java-mp-spring-boot-starter</artifactId>
+            <version>4.7.0</version>
+        </dependency>
     </dependencies>
 
     <!-- 配置阿里云仓库 -->

+ 112 - 0
data-easy/src/main/java/com/dataeasy/server/MpEntryController.java

@@ -0,0 +1,112 @@
+package com.dataeasy.server;
+
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.mp.api.WxMpMessageRouter;
+import me.chanjar.weixin.mp.api.WxMpService;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author tyuio
+ * @version 1.0.0
+ * @description TODO
+ * @date 2025/2/28 16:39
+ */
+@Component
+@RestController
+@Slf4j
+public class MpEntryController {
+
+    @Autowired
+    private WxMpService wxMpService;
+    @Autowired
+    private WxMpMessageRouter wxMpMessageRouter;
+
+    /**
+     * 微信接入
+     *
+     * @param signature 签名
+     * @param timestamp 时间戳
+     * @param nonce     随机数
+     * @param echoStr   随机字符串
+     * @return 接入成功返回 echoStr 的值,否则随便返回
+     */
+    @GetMapping("/WeChat/token")
+    public String entry(@RequestParam("signature") String signature,
+                        @RequestParam("timestamp") String timestamp,
+                        @RequestParam("nonce") String nonce,
+                        @RequestParam("echostr") String echoStr) {
+        log.info("微信公众号/服务号接入传递的参数 signature:[{}],timestamp:[{}],nonce:[{}],echostr:[{}]",
+                signature, timestamp, nonce, echoStr);
+
+        if (StringUtils.isAnyBlank(signature, timestamp, nonce, echoStr)) {
+            log.error("接收到微信认证信息,参数非法,存在为空的参数");
+            return "error";
+        }
+
+        boolean result = wxMpService.checkSignature(timestamp, nonce, signature);
+        log.info("微信公众号/服务号接入成功?[{}]", result);
+        return result ? echoStr : "error";
+    }
+
+    /**
+     * 微信回调
+     *
+     * @param requestBody 回复
+     * @param signature 签名
+     * @param timestamp 时间戳
+     * @param nonce 随机数
+     * @param openid 用户id
+     * @param encType 未知参数
+     * @param msgSignature 未知参数
+     * @return xml
+     */
+    @PostMapping("/WeChat/token")
+    public String entryCallback(@RequestBody String requestBody,
+                                @RequestParam("signature") String signature,
+                                @RequestParam("timestamp") String timestamp,
+                                @RequestParam("nonce") String nonce,
+                                @RequestParam("openid") String openid,
+                                @RequestParam(name = "encrypt_type", required = false) String encType,
+                                @RequestParam(name = "msg_signature", required = false) String msgSignature) {
+//        log.info("\n接收微信请求:[openid=[{}], [signature=[{}], encType=[{}], msgSignature=[{}],"
+//                        + " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ",
+//                openid, signature, encType, msgSignature, timestamp, nonce, requestBody);
+
+        if (!wxMpService.checkSignature(timestamp, nonce, signature)) {
+            throw new IllegalArgumentException("非法请求,可能属于伪造的请求!");
+        }
+
+        String out = null;
+        if (encType == null) {
+            // 明文传输的消息
+            WxMpXmlMessage inMessage = WxMpXmlMessage.fromXml(requestBody);
+            WxMpXmlOutMessage outMessage = this.wxMpMessageRouter.route(inMessage);
+            if (outMessage == null) {
+                return "";
+            }
+            out = outMessage.toXml();
+        } else if ("aes".equalsIgnoreCase(encType)) {
+            // aes加密的消息
+            WxMpXmlMessage inMessage = WxMpXmlMessage.fromEncryptedXml(requestBody, wxMpService.getWxMpConfigStorage(),
+                    timestamp, nonce, msgSignature);
+            log.info("\n消息解密后内容为:\n[{}] ", inMessage.toString());
+            WxMpXmlOutMessage outMessage = this.wxMpMessageRouter.route(inMessage);
+            if (outMessage == null) {
+                return "";
+            }
+            out = outMessage.toEncryptedXml(wxMpService.getWxMpConfigStorage());
+        }
+        log.info("\n组装回复信息:[{}]", out);
+        return out;
+    }
+}
+

+ 37 - 0
data-easy/src/main/java/com/dataeasy/server/core/config/WxMpProperties.java

@@ -0,0 +1,37 @@
+package com.dataeasy.server.core.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author tyuio
+ * @version 1.0.0
+ * @description 微信配置
+ * @date 2025/2/28 16:38
+ */
+@Data
+@Component
+@ConfigurationProperties(prefix = "wx")
+public class WxMpProperties {
+
+    /**
+     * 设置微信公众号的appid
+     */
+    private String appId;
+
+    /**
+     * 设置微信公众号的app secret
+     */
+    private String secret;
+
+    /**
+     * 设置微信公众号的token
+     */
+    private String token;
+
+    /**
+     * 设置微信公众号的EncodingAESKey
+     */
+    private String aesKey;
+}

+ 23 - 1
data-easy/src/main/resources/application-dev.yaml

@@ -10,4 +10,26 @@ biz:
       app-id: 0123456789
       secret: 0123456789
   token:
-    password: 0123456789
+    password: 0123456789
+
+logging:
+  level: debug
+
+# 公众号配置(必填)
+wx:
+  mp:
+    app-id: wx076677ddbd348bbc
+    secret: 87972dca143f21348ff65c7ac19be1cc
+    token: Csy2001
+    aes-key: 123424
+    use-stable-access-token: false
+#  wx.mp.app-id=appId
+#  wx.mp.secret=@secret
+#  wx.mp.token=@token
+#  wx.mp.aes-key=@aesKey
+#  wx.mp.use-stable-access-token=@useStableAccessToken
+#wx:
+#  appId:
+#
+#
+#  aesKey: rdDwt7K448074aL7Mt6QwOBPYCwIHqSaN

+ 3 - 3
product-hunt/src/main/java/com/producthunt/server/AppEncryptor.java

@@ -49,8 +49,8 @@ public class AppEncryptor {
     }
 
     public static void main(String[] args) {
-        AppEncryptor appEncryptor = new AppEncryptor("7njoTmM0bbapL7d4DDHh", "PBEWithMD5AndDES");
-        appEncryptor.encryptAndShow("api", "https://api.siliconflow.cn");
-        appEncryptor.encryptAndShow("key", "sk-hgbymehndbqetoxivmgzvlzzewhgejdhzafmmummompzyfbv");
+        AppEncryptor appEncryptor = new AppEncryptor("", "PBEWithMD5AndDES");
+        appEncryptor.encryptAndShow("id", "");
+        appEncryptor.encryptAndShow("key", "");
     }
 }

+ 50 - 4
product-hunt/src/main/java/com/producthunt/server/TestController.java

@@ -3,11 +3,13 @@ package com.producthunt.server;
 import java.util.ArrayList;
 import java.util.List;
 
+import com.producthunt.server.core.config.HzApiConfig;
+import com.producthunt.server.feign.FinanceFeign;
+import com.producthunt.server.feign.dto.FinanceRequest;
+import com.producthunt.server.feign.dto.BondResponse;
+import com.producthunt.server.feign.dto.HzApiRequest;
+import com.producthunt.server.feign.dto.StockResponse;
 import org.springframework.ai.chat.client.ChatClient;
-import org.springframework.ai.chat.messages.Message;
-import org.springframework.ai.chat.prompt.Prompt;
-import org.springframework.ai.chat.prompt.PromptTemplate;
-import org.springframework.ai.chat.prompt.SystemPromptTemplate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.core.io.Resource;
@@ -18,9 +20,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.producthunt.server.core.config.ProductHuntConfig;
+import com.producthunt.server.feign.HzApiFeign;
 import com.producthunt.server.feign.ProductHuntFeign;
+import com.producthunt.server.feign.dto.DaLeTouResponse;
 import com.producthunt.server.feign.dto.OauthRequest;
 import com.producthunt.server.feign.dto.OauthResponse;
+import com.producthunt.server.feign.dto.ShuangSeQiuResponse;
 
 /**
  * @author tyuio
@@ -134,4 +139,45 @@ public class TestController {
         ChatClient chatClient = chatClientBuilder.defaultSystem(promptSystemMessage).build();
         return chatClient.prompt().user(userText).call().content();
     }
+
+
+    @Autowired
+    private HzApiFeign hzApiFeign;
+
+    @Autowired
+    private HzApiConfig hzApiConfig;
+
+    @GetMapping("/t4")
+    public DaLeTouResponse t4() {
+        HzApiRequest request = new HzApiRequest();
+        request.setId(hzApiConfig.getId());
+        request.setKey(hzApiConfig.getKey());
+        return hzApiFeign.getDaLeTou(request);
+    }
+
+    @GetMapping("/t5")
+    public ShuangSeQiuResponse t5() {
+        HzApiRequest request = new HzApiRequest();
+        request.setId(hzApiConfig.getId());
+        request.setKey(hzApiConfig.getKey());
+        return hzApiFeign.getShuangSeQiu(request);
+    }
+
+    @Autowired
+    private FinanceFeign financeFeign;
+
+    @GetMapping("/t6")
+    public List<StockResponse> t6(){
+        FinanceRequest financeRequest = new FinanceRequest();
+        financeRequest.setSymbol("全部股票");
+        return financeFeign.getStockXgsglbEm(financeRequest);
+    }
+
+    @GetMapping("/t7")
+    public List<BondResponse> t7(){
+        FinanceRequest financeRequest = new FinanceRequest();
+        financeRequest.setStartDate("20250101");
+        financeRequest.setEndDate("20250131");
+        return financeFeign.getBondCovIssueCninfo(financeRequest);
+    }
 }

+ 1 - 0
product-hunt/src/main/java/com/producthunt/server/core/config/FeignConfig.java

@@ -52,6 +52,7 @@ public class FeignConfig {
         public Jackson2HttpConverter() {
             List<MediaType> mediaTypes = new ArrayList<>();
             mediaTypes.add(MediaType.TEXT_PLAIN);
+            mediaTypes.add(MediaType.TEXT_HTML);
             setSupportedMediaTypes(mediaTypes);
         }
     }

+ 27 - 0
product-hunt/src/main/java/com/producthunt/server/core/config/HzApiConfig.java

@@ -0,0 +1,27 @@
+package com.producthunt.server.core.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author tyuio
+ * @version 1.0.0
+ * @description 接口盒子配置
+ * @date 2025/2/28 11:25
+ */
+@Data
+@Component
+@ConfigurationProperties("hz-api")
+public class HzApiConfig {
+
+    /**
+     * 账号ID
+     */
+    private String id;
+
+    /**
+     * 通讯KEY
+     */
+    private String key;
+}

+ 33 - 0
product-hunt/src/main/java/com/producthunt/server/feign/FinanceFeign.java

@@ -0,0 +1,33 @@
+package com.producthunt.server.feign;
+
+import com.producthunt.server.feign.dto.BondResponse;
+import com.producthunt.server.feign.dto.FinanceRequest;
+import com.producthunt.server.feign.dto.StockResponse;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.cloud.openfeign.SpringQueryMap;
+import org.springframework.web.bind.annotation.GetMapping;
+
+import java.util.List;
+
+/**
+ * @author tyuio
+ * @version 1.0.0
+ * @description 新股、新债数据服务接口
+ * @date 2025/2/28 15:12
+ */
+//@FeignClient(name = "stock-service", url = "http://192.168.123.242:8000")
+@FeignClient(name = "stock-service", url = "http://127.0.0.1:8000")
+public interface FinanceFeign {
+
+    /**
+     * 获取新股数据
+     */
+    @GetMapping("/api/public/stock_xgsglb_em")
+    public List<StockResponse> getStockXgsglbEm(@SpringQueryMap FinanceRequest request);
+
+    /**
+     * 获取新债数据
+     */
+    @GetMapping("/api/public/bond_cov_issue_cninfo")
+    public List<BondResponse> getBondCovIssueCninfo(@SpringQueryMap FinanceRequest request);
+}

+ 32 - 0
product-hunt/src/main/java/com/producthunt/server/feign/HzApiFeign.java

@@ -0,0 +1,32 @@
+package com.producthunt.server.feign;
+
+import com.producthunt.server.feign.dto.DaLeTouResponse;
+import com.producthunt.server.feign.dto.HzApiRequest;
+import com.producthunt.server.feign.dto.ShuangSeQiuResponse;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.cloud.openfeign.SpringQueryMap;
+import org.springframework.web.bind.annotation.GetMapping;
+
+/**
+ * @author tyuio
+ * @version 1.0.0
+ * @description 接口盒子平台接口服务
+ * @date 2025/2/28 11:27
+ */
+@FeignClient(name = "hz-api-service", url = "https://cn.apihz.cn")
+public interface HzApiFeign {
+
+    /**
+     * 获取大乐透信息
+     * @return
+     */
+    @GetMapping("/api/caipiao/daletou.php")
+    DaLeTouResponse getDaLeTou(@SpringQueryMap HzApiRequest request);
+
+    /**
+     * 获取双色球信息
+     * @return
+     */
+    @GetMapping("/api/caipiao/shuangseqiu.php")
+    ShuangSeQiuResponse getShuangSeQiu(@SpringQueryMap HzApiRequest request);
+}

+ 208 - 0
product-hunt/src/main/java/com/producthunt/server/feign/dto/BondResponse.java

@@ -0,0 +1,208 @@
+package com.producthunt.server.feign.dto;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonAlias;
+import lombok.Data;
+
+/**
+ * @author tyuio
+ * @version 1.0.0
+ * @description 可转债响应类
+ * @date 2025/2/28 15:18
+ */
+@Data
+public class BondResponse implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -9013840045996664294L;
+
+    /**
+     * 债券代码
+     */
+    @JsonAlias("债券代码")
+    private String bondCode;
+
+    /**
+     * 债券简称
+     */
+    @JsonAlias("债券简称")
+    private String bondShortName;
+
+    /**
+     * 公告日期
+     */
+    @JsonAlias("公告日期")
+    private String announcementDate;
+
+    /**
+     * 发行起始日
+     */
+    @JsonAlias("发行起始日")
+    private String issueStartDate;
+
+    /**
+     * 发行终止日
+     */
+    @JsonAlias("发行终止日")
+    private String issueEndDate;
+
+    /**
+     * 计划发行总量
+     */
+    @JsonAlias("计划发行总量")
+    private int plannedIssueAmount;
+
+    /**
+     * 实际发行总量
+     */
+    @JsonAlias("实际发行总量")
+    private int actualIssueAmount;
+
+    /**
+     * 发行面值
+     */
+    @JsonAlias("发行面值")
+    private int issueParValue;
+
+    /**
+     * 发行价格
+     */
+    @JsonAlias("发行价格")
+    private int issuePrice;
+
+    /**
+     * 发行方式
+     */
+    @JsonAlias("发行方式")
+    private String issueMethod;
+
+    /**
+     * 发行对象
+     */
+    @JsonAlias("发行对象")
+    private String issueTarget;
+
+    /**
+     * 发行范围
+     */
+    @JsonAlias("发行范围")
+    private String issueScope;
+
+    /**
+     * 承销方式
+     */
+    @JsonAlias("承销方式")
+    private String underwritingMethod;
+
+    /**
+     * 募资用途说明
+     */
+    @JsonAlias("募资用途说明")
+    private String fundraisingPurpose;
+
+    /**
+     * 初始转股价格
+     */
+    @JsonAlias("初始转股价格")
+    private BigDecimal initialConversionPrice;
+
+    /**
+     * 转股开始日期
+     */
+    @JsonAlias("转股开始日期")
+    private String conversionStartDate;
+
+    /**
+     * 转股终止日期
+     */
+    @JsonAlias("转股终止日期")
+    private String conversionEndDate;
+
+    /**
+     * 网上申购日期
+     */
+    @JsonAlias("网上申购日期")
+    private String onlineSubscriptionDate;
+
+    /**
+     * 网上申购代码
+     */
+    @JsonAlias("网上申购代码")
+    private String onlineSubscriptionCode;
+
+    /**
+     * 网上申购简称
+     */
+    @JsonAlias("网上申购简称")
+    private String onlineSubscriptionShortName;
+
+    /**
+     * 网上申购数量上限
+     */
+    @JsonAlias("网上申购数量上限")
+    private int onlineSubscriptionMax;
+
+    /**
+     * 网上申购数量下限
+     */
+    @JsonAlias("网上申购数量下限")
+    private BigDecimal onlineSubscriptionMin;
+
+    /**
+     * 网上申购单位
+     */
+    @JsonAlias("网上申购单位")
+    private BigDecimal onlineSubscriptionUnit;
+
+    /**
+     * 网上申购中签结果公告日及退款日
+     */
+    @JsonAlias("网上申购中签结果公告日及退款日")
+    private String onlineSubscriptionResultDate;
+
+    /**
+     * 优先申购日
+     */
+    @JsonAlias("优先申购日")
+    private String prioritySubscriptionDate;
+
+    /**
+     * 配售价格
+     */
+    @JsonAlias("配售价格")
+    private int allotmentPrice;
+
+    /**
+     * 债权登记日
+     */
+    @JsonAlias("债权登记日")
+    private String creditorRegistrationDate;
+
+    /**
+     * 优先申购缴款日
+     */
+    @JsonAlias("优先申购缴款日")
+    private String prioritySubscriptionPaymentDate;
+
+    /**
+     * 转股代码
+     */
+    @JsonAlias("转股代码")
+    private String conversionCode;
+
+    /**
+     * 交易市场
+     */
+    @JsonAlias("交易市场")
+    private String tradingMarket;
+
+    /**
+     * 债券名称
+     */
+    @JsonAlias("债券名称")
+    private String bondName;
+}

+ 177 - 0
product-hunt/src/main/java/com/producthunt/server/feign/dto/DaLeTouResponse.java

@@ -0,0 +1,177 @@
+package com.producthunt.server.feign.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @author tyuio
+ * @version 1.0.0
+ * @description 大乐透响应类
+ * @date 2025/2/28 12:33
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class DaLeTouResponse extends HzApiBaseResponse implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -6546872761258845818L;
+
+    /**
+     * 开奖号码,以竖杠隔开
+     */
+    private String number;
+
+    /**
+     * 特别号码1,第一个尾号
+     */
+    private String number1;
+
+    /**
+     * 特别号码2,第二个尾号
+     */
+    private String number2;
+
+    /**
+     * 期号
+     */
+    private String qihao;
+
+    /**
+     * 开奖日期
+     */
+    private String time;
+
+    /**
+     * 一等奖注数
+     */
+    private Integer no1num;
+
+    /**
+     * 二等奖注数
+     */
+    private Integer no2num;
+
+    /**
+     * 三等奖注数
+     */
+    private Integer no3num;
+
+    /**
+     * 四等奖注数
+     */
+    private Integer no4num;
+
+    /**
+     * 五等奖注数
+     */
+    private Integer no5num;
+
+    /**
+     * 六等奖注数
+     */
+    private Integer no6num;
+
+    /**
+     * 七等奖注数
+     */
+    private Integer no7num;
+
+    /**
+     * 八等奖注数
+     */
+    private Integer no8num;
+
+    /**
+     * 九等奖注数
+     */
+    private Integer no9num;
+
+    /**
+     * 一等奖金额
+     */
+    private BigDecimal no1money;
+
+    /**
+     * 二等奖金额
+     */
+    private BigDecimal no2money;
+
+    /**
+     * 三等奖金额
+     */
+    private BigDecimal no3money;
+
+    /**
+     * 四等奖金额
+     */
+    private BigDecimal no4money;
+
+    /**
+     * 五等奖金额
+     */
+    private BigDecimal no5money;
+
+    /**
+     * 六等奖金额
+     */
+    private BigDecimal no6money;
+
+    /**
+     * 七等奖金额
+     */
+    private BigDecimal no7money;
+
+    /**
+     * 八等奖金额
+     */
+    private BigDecimal no8money;
+
+    /**
+     * 九等奖金额
+     */
+    private BigDecimal no9money;
+
+    /**
+     * 彩票名称
+     */
+    private String name;
+
+    /**
+     * 销售额
+     */
+    private BigDecimal xiaoshou;
+
+    /**
+     * 奖池金额
+     */
+    private BigDecimal jiangchi;
+
+    /**
+     * 截止兑奖时间
+     */
+    private String endtime;
+
+    /**
+     * 一等奖追加注数
+     */
+    private Integer no1numjia;
+
+    /**
+     * 一等奖追加奖金
+     */
+    private BigDecimal no1moneyjia;
+
+    /**
+     * 二等奖追加注数
+     */
+    private Integer no2numjia;
+
+    /**
+     * 二等奖追加奖金
+     */
+    private BigDecimal no2moneyjia;
+}

+ 26 - 0
product-hunt/src/main/java/com/producthunt/server/feign/dto/FinanceRequest.java

@@ -0,0 +1,26 @@
+package com.producthunt.server.feign.dto;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import feign.Param;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author tyuio
+ * @version 1.0.0
+ * @description 新股、新债 请求类
+ * @date 2025/2/28 15:16
+ */
+@Data
+public class FinanceRequest {
+
+    private String symbol;
+
+    @Param("start_date")
+    private String startDate;
+
+    @Param("end_date")
+    private String endDate;
+}

+ 29 - 0
product-hunt/src/main/java/com/producthunt/server/feign/dto/HzApiBaseResponse.java

@@ -0,0 +1,29 @@
+package com.producthunt.server.feign.dto;
+
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author tyuio
+ * @version 1.0.0
+ * @description 接口盒子响应基本类
+ * @date 2025/2/28 14:46
+ */
+@Data
+public class HzApiBaseResponse implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 6878917855654947788L;
+
+    /**
+     * 状态码:200-成功,400-错误
+     */
+    private Integer code;
+
+    /**
+     * 消息内容,信息提示
+     */
+    private String msg;
+}

+ 22 - 0
product-hunt/src/main/java/com/producthunt/server/feign/dto/HzApiRequest.java

@@ -0,0 +1,22 @@
+package com.producthunt.server.feign.dto;
+
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author tyuio
+ * @version 1.0.0
+ * @description 接口盒子请求类
+ * @date 2025/2/28 14:55
+ */
+@Data
+public class HzApiRequest implements Serializable {
+    @Serial
+    private static final long serialVersionUID = 6322799959625240000L;
+
+    private String id;
+
+    private String key;
+}

+ 122 - 0
product-hunt/src/main/java/com/producthunt/server/feign/dto/ShuangSeQiuResponse.java

@@ -0,0 +1,122 @@
+package com.producthunt.server.feign.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @author tyuio
+ * @version 1.0.0
+ * @description 双色球响应类
+ * @date 2025/2/28 14:03
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ShuangSeQiuResponse extends HzApiBaseResponse implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 4298278262349046648L;
+
+    /**
+     * 开奖号码,以竖杠隔开
+     */
+    private String number;
+
+    /**
+     * 特别号码,尾号
+     */
+    private String number1;
+
+    /**
+     * 期号
+     */
+    private String qihao;
+
+    /**
+     * 开奖日期
+     */
+    private String time;
+
+    /**
+     * 一等奖注数
+     */
+    private Integer no1num;
+
+    /**
+     * 二等奖注数
+     */
+    private Integer no2num;
+
+    /**
+     * 三等奖注数
+     */
+    private Integer no3num;
+
+    /**
+     * 四等奖注数
+     */
+    private Integer no4num;
+
+    /**
+     * 五等奖注数
+     */
+    private Integer no5num;
+
+    /**
+     * 六等奖注数
+     */
+    private Integer no6num;
+
+    /**
+     * 一等奖金额
+     */
+    private BigDecimal no1money;
+
+    /**
+     * 二等奖金额
+     */
+    private BigDecimal no2money;
+
+    /**
+     * 三等奖金额
+     */
+    private BigDecimal no3money;
+
+    /**
+     * 四等奖金额
+     */
+    private BigDecimal no4money;
+
+    /**
+     * 五等奖金额
+     */
+    private BigDecimal no5money;
+
+    /**
+     * 六等奖金额
+     */
+    private BigDecimal no6money;
+
+    /**
+     * 彩票名称
+     */
+    private String name;
+
+    /**
+     * 销售额
+     */
+    private BigDecimal xiaoshou;
+
+    /**
+     * 奖池金额
+     */
+    private BigDecimal jiangchi;
+
+    /**
+     * 一等奖中奖地域
+     */
+    private String no1msg;
+}

+ 153 - 0
product-hunt/src/main/java/com/producthunt/server/feign/dto/StockResponse.java

@@ -0,0 +1,153 @@
+package com.producthunt.server.feign.dto;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonAlias;
+
+import lombok.Data;
+
+/**
+ * @author tyuio
+ * @version 1.0.0
+ * @description 新股响应类
+ * @date 2025/2/28 15:18
+ */
+@Data
+public class StockResponse implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -9013840045996664294L;
+
+    /**
+     * 股票代码
+     */
+    @JsonAlias("股票代码")
+    private String stockCode;
+
+    /**
+     * 股票简称
+     */
+    @JsonAlias("股票简称")
+    private String stockShortName;
+
+    /**
+     * 申购代码
+     */
+    @JsonAlias("申购代码")
+    private String subscriptionCode;
+
+    /**
+     * 发行总数
+     */
+    @JsonAlias("发行总数")
+    private int totalIssued;
+
+    /**
+     * 网上发行数量
+     */
+    @JsonAlias("网上发行")
+    private int onlineIssued;
+
+    /**
+     * 顶格申购需配市值
+     */
+    @JsonAlias("顶格申购需配市值")
+    private double maxMarketValueForSubscription;
+
+    /**
+     * 申购上限
+     */
+    @JsonAlias("申购上限")
+    private int subscriptionLimit;
+
+    /**
+     * 发行价格
+     */
+    @JsonAlias("发行价格")
+    private Double issuePrice;
+
+    /**
+     * 最新价
+     */
+    @JsonAlias("最新价")
+    private Double latestPrice;
+
+    /**
+     * 首日收盘价
+     */
+    @JsonAlias("首日收盘价")
+    private Double firstDayClosingPrice;
+
+    /**
+     * 申购日期
+     */
+    @JsonAlias("申购日期")
+    private String subscriptionDate;
+
+    /**
+     * 中签号公布日
+     */
+    @JsonAlias("中签号公布日")
+    private String winningNumberAnnouncementDate;
+
+    /**
+     * 中签缴款日期
+     */
+    @JsonAlias("中签缴款日期")
+    private String paymentDateForWinning;
+
+    /**
+     * 上市日期
+     */
+    @JsonAlias("上市日期")
+    private String listingDate;
+
+    /**
+     * 发行市盈率
+     */
+    @JsonAlias("发行市盈率")
+    private Double issuePERatio;
+
+    /**
+     * 行业市盈率
+     */
+    @JsonAlias("行业市盈率")
+    private double industryPERatio;
+
+    /**
+     * 中签率
+     */
+    @JsonAlias("中签率")
+    private Double winningRate;
+
+    /**
+     * 询价累计报价倍数
+     */
+    @JsonAlias("询价累计报价倍数")
+    private Double cumulativeBidMultiple;
+
+    /**
+     * 配售对象报价家数
+     */
+    @JsonAlias("配售对象报价家数")
+    private Integer biddingFirmsCount;
+
+    /**
+     * 连续一字板数量
+     */
+    @JsonAlias("连续一字板数量")
+    private String consecutiveLimitUpDays;
+
+    /**
+     * 涨幅
+     */
+    @JsonAlias("涨幅")
+    private Double increaseRate;
+
+    /**
+     * 每中一签获利
+     */
+    @JsonAlias("每中一签获利")
+    private Double profitPerWinningLot;
+}

+ 7 - 1
product-hunt/src/main/resources/application-dev.yaml

@@ -15,6 +15,12 @@ logging:
     com.producthunt.server: debug
     org.springframework.ai.chat.client.advisor=DEBUG:
 
+# Product Hunt平台配置
 product-hunt:
   client-id: ENC(ANqnssfEBJfIYM2s2D4ZHw1kwndMGp1zxxz3/c1VrsoiwauH5SQq/dB9NObC1AnnI19/AodFB8/bEja1xf+zXw==)
-  client-secret: ENC(RnNMBLx32FzSOlA21bzg6vcYpaVqrmGlMj5rKQtr+/LuVCBAP7fad9YjeqOt0kfrJvrYZ9z8/DR76aDv7PxiUw==)
+  client-secret: ENC(RnNMBLx32FzSOlA21bzg6vcYpaVqrmGlMj5rKQtr+/LuVCBAP7fad9YjeqOt0kfrJvrYZ9z8/DR76aDv7PxiUw==)
+
+# 接口盒子平台配置
+hz-api:
+  id: ENC(2myOnTLci1DlpQfDkcqN2fGoM24y/fairiO5hH7braM=)
+  key: ENC(SK18qyEQdxOACJ2xeNLTGbUZEDi+wRkvDBs4lL/+wCc1ANFwD42P2Q7Ssl3U3uu9fVRQ3BdgV2o=)

+ 7 - 1
product-hunt/src/main/resources/application-prod.yaml

@@ -15,6 +15,12 @@ logging:
   level:
     com.producthunt.server: info
 
+# Product Hunt平台配置
 product-hunt:
   client-id: ENC(uiT7ZiWWHooEYfs42QqDWMxwMgE18uEaE7PMVB2/AYURrn//Jd54BO6Q1a/J6mGFdrQwiO02X0YZeobglUXW2A==)
-  client-secret: ENC(3DYuspmnbTjlJJ0H+kzpvtoiEzKZXNQD5tKDDkI8K85funxQKMj5fTaLOjsepB40BO4HzTD5SBDDy9WTfUbVSA==)
+  client-secret: ENC(3DYuspmnbTjlJJ0H+kzpvtoiEzKZXNQD5tKDDkI8K85funxQKMj5fTaLOjsepB40BO4HzTD5SBDDy9WTfUbVSA==)
+
+# 接口盒子平台配置
+hz-api:
+  id: ENC(xOmDcVBaAxOJHC1bazlmG8m3E082uCTZ4o8jxT7Fi8Q=)
+  key: ENC(I2SZcgbv6EEyEndn4FSMihTlTxVZ3zhxaQAIeJAOdeos3ZH4Nb8QalW1L1phlIK8C/FdPmnsEw8=)