fzzj před 9 měsíci
rodič
revize
612d85a995
29 změnil soubory, kde provedl 615 přidání a 88 odebrání
  1. 12
    0
      RuoYi-Vue/pom.xml
  2. 44
    2
      RuoYi-Vue/ruoyi-admin/src/main/resources/application.yml
  3. 8
    29
      RuoYi-Vue/ruoyi-novel/pom.xml
  4. 1
    1
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/config/PhpDataSyncTask.java
  5. 4
    1
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/config/ScheduledTasks.java
  6. 5
    0
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/controller/ChapterController.java
  7. 9
    0
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/controller/NovelAdController.java
  8. 22
    0
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/domain/AdCountRequest.java
  9. 7
    0
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/domain/AdLog.java
  10. 13
    0
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/domain/AdPlatformConfig.java
  11. 15
    0
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/domain/ChapterDTO.java
  12. 5
    0
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/domain/NovelChapter.java
  13. 3
    0
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/domain/NovelContent.java
  14. 3
    0
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/domain/RoyaltySummary.java
  15. 8
    0
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/domain/StoryOption.java
  16. 4
    0
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/mapper/AdLogMapper.java
  17. 13
    4
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/mapper/RoyaltySummaryMapper.java
  18. 1
    0
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/mapper/VoteRecordMapper.java
  19. 12
    0
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/service/AdService.java
  20. 13
    0
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/service/ChapterService.java
  21. 2
    0
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/service/IAdService.java
  22. 67
    0
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/service/impl/AdConfigServiceImpl.java
  23. 82
    0
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/service/impl/AdLogServiceImpl.java
  24. 39
    14
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/service/impl/AdServiceImpl.java
  25. 81
    0
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/service/impl/AdSyncServiceImpl.java
  26. 45
    5
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/service/impl/ChapterServiceImpl.java
  27. 45
    5
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/service/impl/FinanceServiceImpl.java
  28. 26
    1
      RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/utils/JwtUtil.java
  29. 26
    26
      RuoYi-Vue/ruoyi-novel/src/main/resources/application.yml

+ 12
- 0
RuoYi-Vue/pom.xml Zobrazit soubor

@@ -40,7 +40,19 @@
40 40
     <!-- 依赖声明 -->
41 41
     <dependencyManagement>
42 42
         <dependencies>
43
+            <!-- MyBatis-Plus 核心依赖 -->
44
+            <dependency>
45
+                <groupId>com.baomidou</groupId>
46
+                <artifactId>mybatis-plus-boot-starter</artifactId>
47
+                <version>3.4.1</version> <!-- 2023年稳定版,兼容Spring Boot 2.7.x -->
48
+            </dependency>
43 49
 
50
+            <!-- 注解处理器(避免IDE报错) -->
51
+            <dependency>
52
+                <groupId>com.baomidou</groupId>
53
+                <artifactId>mybatis-plus-annotation</artifactId>
54
+                <version>3.4.1</version>
55
+            </dependency>
44 56
             <!-- 覆盖SpringFramework的依赖配置-->
45 57
             <dependency>
46 58
                 <groupId>org.springframework</groupId>

+ 44
- 2
RuoYi-Vue/ruoyi-admin/src/main/resources/application.yml Zobrazit soubor

@@ -89,7 +89,43 @@ spring:
89 89
         max-active: 8
90 90
         # #连接池最大阻塞等待时间(使用负值表示没有限制)
91 91
         max-wait: -1ms
92
-
92
+# PHP系统配置
93
+php:
94
+  data:
95
+    url: http://php-system.com/api/data/royalty
96
+  notify:
97
+    url: http://php-system.com/api/vote/notify
98
+  jwt:
99
+    secret: your_shared_jwt_secret
100
+# 广告平台配置
101
+ad:
102
+  platforms:
103
+    tencent:
104
+      url: https://ad.tencent.com/track
105
+      auth-token: your_tencent_token
106
+    pangle:
107
+      url: https://ad.pangle.com/api/v1/event
108
+      auth-token: your_pangle_token
109
+# DeepSeek AI配置
110
+deepseek:
111
+  api:
112
+    key: your_deepseek_api_key
113
+    url: https://api.deepseek.com/v1/story/generate
114
+    model: novel-pro-1.0
115
+  prompt:
116
+    template: |
117
+      基于以下小说上下文:
118
+      {上一章内容}
119
+      用户选择了选项:{选项文本}
120
+      投票分布:{投票统计}
121
+      请生成800-1200字的新章节
122
+# 分账规则配置
123
+royalty:
124
+  base-rate: 0.15
125
+  vip-bonus-rate: 0.05
126
+handling:
127
+  fee:
128
+    rate: 0.05
93 129
 # token配置
94 130
 token:
95 131
   # 令牌自定义标识
@@ -107,7 +143,13 @@ mybatis:
107 143
   mapperLocations: classpath*:mapper/**/*Mapper.xml
108 144
   # 加载全局的配置文件
109 145
   configLocation: classpath:mybatis/mybatis-config.xml
110
-
146
+mybatis-plus:
147
+  global-config:
148
+    db-config:
149
+      table-prefix: novel_  # 自动为所有实体类添加表前缀:cite[5]:cite[9]
150
+      id-type: assign_id  # 雪花算法(避免每个实体类单独配@TableId):cite[5]:cite[9]
151
+  configuration:
152
+    map-underscore-to-camel-case: true
111 153
 # PageHelper分页插件
112 154
 pagehelper:
113 155
   helperDialect: mysql

+ 8
- 29
RuoYi-Vue/ruoyi-novel/pom.xml Zobrazit soubor

@@ -39,39 +39,18 @@
39 39
             <groupId>com.ruoyi</groupId>
40 40
             <artifactId>ruoyi-common</artifactId>
41 41
         </dependency>
42
+        <!-- MyBatis-Plus 核心依赖 -->
42 43
         <dependency>
43
-            <groupId>istrator..m2.repository.com.baomidou</groupId>
44
-            <artifactId>mybatis-plus-annotation</artifactId>
45
-            <version>3.5.3.1</version>
46
-        </dependency>
47
-        <dependency>
48
-            <groupId>org.aspectj</groupId>
49
-            <artifactId>aspectjweaver</artifactId>
50
-        </dependency>
51
-        <dependency>
52
-            <groupId>istrator..m2.repository.com.baomidou</groupId>
53
-            <artifactId>mybatis-plus-core</artifactId>
54
-            <version>3.5.3.1</version>
55
-        </dependency>
56
-        <dependency>
57
-            <groupId>istrator..m2.repository.com.baomidou</groupId>
58
-            <artifactId>mybatis-plus-annotation</artifactId>
59
-            <version>3.5.2</version>
60
-        </dependency>
61
-        <dependency>
62
-            <groupId>istrator..m2.repository.com.baomidou</groupId>
63
-            <artifactId>mybatis-plus-annotation</artifactId>
64
-            <version>3.5.1</version>
44
+            <groupId>com.baomidou</groupId>
45
+            <artifactId>mybatis-plus-boot-starter</artifactId>
46
+            <version>3.4.1</version> <!-- 2023年稳定版,兼容Spring Boot 2.7.x -->
65 47
         </dependency>
48
+
49
+        <!-- 注解处理器(避免IDE报错) -->
66 50
         <dependency>
67
-            <groupId>istrator..m2.repository.com.baomidou</groupId>
51
+            <groupId>com.baomidou</groupId>
68 52
             <artifactId>mybatis-plus-annotation</artifactId>
69
-            <version>3.3.1</version>
70
-        </dependency>
71
-        <dependency>
72
-            <groupId>com.tencentcloudapi</groupId>
73
-            <artifactId>tencentcloud-sdk-java</artifactId>
74
-            <version>3.1.2</version>
53
+            <version>3.4.1</version>
75 54
         </dependency>
76 55
     </dependencies>
77 56
 

+ 1
- 1
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/config/PhpDataSyncTask.java Zobrazit soubor

@@ -2,7 +2,7 @@ package com.ruoyi.novel.config;
2 2
 
3 3
 import com.ruoyi.novel.domain.RoyaltySummary;
4 4
 import com.ruoyi.novel.mapper.RoyaltySummaryMapper;
5
-import lombok.Value;
5
+import org.springframework.beans.factory.annotation.Value;
6 6
 import org.springframework.beans.factory.annotation.Autowired;
7 7
 import org.springframework.scheduling.annotation.Scheduled;
8 8
 import org.springframework.stereotype.Component;

+ 4
- 1
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/config/ScheduledTasks.java Zobrazit soubor

@@ -3,16 +3,19 @@ package com.ruoyi.novel.config;
3 3
 import com.ruoyi.novel.service.IAdService;
4 4
 import com.ruoyi.novel.service.IFinanceService;
5 5
 import com.ruoyi.novel.service.IVoteService;
6
+import org.slf4j.Logger;
7
+import org.slf4j.LoggerFactory;
6 8
 import org.springframework.beans.factory.annotation.Autowired;
7 9
 import org.springframework.context.annotation.Configuration;
8 10
 import org.springframework.scheduling.annotation.EnableScheduling;
9 11
 import org.springframework.scheduling.annotation.Scheduled;
10 12
 
13
+
11 14
 // ScheduledTasks.java
12 15
 @Configuration
13 16
 @EnableScheduling
14 17
 public class ScheduledTasks {
15
-
18
+    private static final Logger log = LoggerFactory.getLogger(ScheduledTasks.class);
16 19
     @Autowired
17 20
     private IAdService adService;
18 21
 

+ 5
- 0
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/controller/ChapterController.java Zobrazit soubor

@@ -1,7 +1,9 @@
1 1
 package com.ruoyi.novel.controller;
2 2
 
3 3
 import com.ruoyi.common.core.domain.AjaxResult;
4
+import com.ruoyi.novel.domain.ChapterDTO;
4 5
 import com.ruoyi.novel.domain.NovelChapter;
6
+import com.ruoyi.novel.service.ChapterService;
5 7
 import org.springframework.beans.factory.annotation.Autowired;
6 8
 import org.springframework.web.bind.annotation.*;
7 9
 
@@ -25,4 +27,7 @@ public class ChapterController {
25 27
     public AjaxResult saveChapter(@RequestBody ChapterDTO dto) {
26 28
         return toAjax(chapterService.saveChapter(dto.getChapter(), dto.getContent()));
27 29
     }
30
+    private AjaxResult toAjax(int result) {
31
+        return result > 0 ? AjaxResult.success() : AjaxResult.error();
32
+    }
28 33
 }

+ 9
- 0
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/controller/NovelAdController.java Zobrazit soubor

@@ -1,7 +1,16 @@
1 1
 package com.ruoyi.novel.controller;
2 2
 //# 广告计数接口
3 3
 
4
+import com.ruoyi.novel.service.AdService;
4 5
 import org.springframework.beans.factory.annotation.Autowired;
6
+import org.springframework.data.redis.core.RedisTemplate;
7
+import org.springframework.http.HttpStatus;
8
+import org.springframework.http.ResponseEntity;
9
+import org.springframework.web.bind.annotation.*;
10
+
11
+import java.time.Duration;
12
+import java.util.Arrays;
13
+import java.util.List;
5 14
 
6 15
 @RestController
7 16
 @RequestMapping("/ad")

+ 22
- 0
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/domain/AdCountRequest.java Zobrazit soubor

@@ -0,0 +1,22 @@
1
+package com.ruoyi.novel.domain;
2
+
3
+import lombok.Data;
4
+
5
+import javax.validation.constraints.NotBlank;
6
+import javax.validation.constraints.NotNull;
7
+
8
+// AdCountRequest.java
9
+@Data
10
+public class AdCountRequest {
11
+    @NotNull(message = "用户ID不能为空")
12
+    private Long userId;
13
+
14
+    @NotNull(message = "章节ID不能为空")
15
+    private Long chapterId;
16
+
17
+    @NotBlank(message = "广告平台不能为空")
18
+    private String adPlatform;
19
+
20
+    @NotBlank(message = "设备ID不能为空")
21
+    private String deviceId;
22
+}

+ 7
- 0
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/domain/AdLog.java Zobrazit soubor

@@ -1,7 +1,11 @@
1 1
 package com.ruoyi.novel.domain;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.*;
3 4
 import lombok.Data;
4 5
 
6
+import javax.validation.constraints.NotBlank;
7
+import javax.validation.constraints.NotNull;
8
+import javax.validation.constraints.Size;
5 9
 import java.util.Date;
6 10
 
7 11
 // AdLog.java
@@ -28,4 +32,7 @@ public class AdLog {
28 32
 
29 33
     // 状态字段:0-未同步 1-已同步
30 34
     private Integer syncStatus;
35
+
36
+    // 确保有默认构造方法
37
+    public AdLog() {}
31 38
 }

+ 13
- 0
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/domain/AdPlatformConfig.java Zobrazit soubor

@@ -1,5 +1,9 @@
1 1
 package com.ruoyi.novel.domain;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.TableId;
4
+import com.baomidou.mybatisplus.annotation.TableName;
5
+import lombok.Data;
6
+
3 7
 @Data
4 8
 @TableName("novel_ad_config")
5 9
 public class AdPlatformConfig {
@@ -10,4 +14,13 @@ public class AdPlatformConfig {
10 14
     private String apiUrl;
11 15
     private String authToken;
12 16
     private String paramsTemplate;
17
+
18
+    // 添加带参数的构造方法
19
+    public AdPlatformConfig(String code, String name, String url, String token, String params) {
20
+        this.platformCode = code;
21
+        this.platformName = name;
22
+        this.apiUrl = url;
23
+        this.authToken = token;
24
+        this.paramsTemplate = params;
25
+    }
13 26
 }

+ 15
- 0
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/domain/ChapterDTO.java Zobrazit soubor

@@ -0,0 +1,15 @@
1
+package com.ruoyi.novel.domain;
2
+
3
+import lombok.Data;
4
+
5
+import javax.validation.constraints.NotBlank;
6
+import javax.validation.constraints.NotNull;
7
+
8
+@Data
9
+public class ChapterDTO {
10
+    @NotNull(message = "章节不能为空")
11
+    private NovelChapter chapter;
12
+
13
+    @NotBlank(message = "内容不能为空")
14
+    private String content;
15
+}

+ 5
- 0
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/domain/NovelChapter.java Zobrazit soubor

@@ -1,4 +1,9 @@
1 1
 package com.ruoyi.novel.domain;
2
+
3
+import lombok.Data;
4
+
5
+import java.util.Date;
6
+
2 7
 // NovelChapter.java
3 8
 @Data
4 9
 public class NovelChapter {

+ 3
- 0
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/domain/NovelContent.java Zobrazit soubor

@@ -1,4 +1,7 @@
1 1
 package com.ruoyi.novel.domain;
2
+
3
+import lombok.Data;
4
+
2 5
 // NovelContent.java
3 6
 @Data
4 7
 public class NovelContent {

+ 3
- 0
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/domain/RoyaltySummary.java Zobrazit soubor

@@ -1,8 +1,11 @@
1 1
 package com.ruoyi.novel.domain;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.TableId;
4
+import com.baomidou.mybatisplus.annotation.TableName;
3 5
 import lombok.Data;
4 6
 
5 7
 import java.math.BigDecimal;
8
+import java.util.Date;
6 9
 
7 10
 // RoyaltySummary.java
8 11
 // RoyaltySummary.java

+ 8
- 0
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/domain/StoryOption.java Zobrazit soubor

@@ -1,5 +1,13 @@
1 1
 package com.ruoyi.novel.domain;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import lombok.Data;
7
+
8
+import javax.validation.constraints.NotBlank;
9
+import javax.validation.constraints.NotNull;
10
+
3 11
 // StoryOption.java
4 12
 @Data
5 13
 @TableName("novel_story_option")

+ 4
- 0
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/mapper/AdLogMapper.java Zobrazit soubor

@@ -1,9 +1,13 @@
1 1
 package com.ruoyi.novel.mapper;
2 2
 
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3 4
 import com.ruoyi.novel.domain.AdLog;
4 5
 import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
5 7
 import org.apache.ibatis.annotations.Select;
6 8
 
9
+import java.util.List;
10
+
7 11
 // AdLogMapper.java
8 12
 @Mapper
9 13
 public interface AdLogMapper extends BaseMapper<AdLog> {

+ 13
- 4
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/mapper/RoyaltySummaryMapper.java Zobrazit soubor

@@ -1,10 +1,8 @@
1 1
 package com.ruoyi.novel.mapper;
2 2
 
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3 4
 import com.ruoyi.novel.domain.RoyaltySummary;
4
-import org.apache.ibatis.annotations.Mapper;
5
-import org.apache.ibatis.annotations.Param;
6
-import org.apache.ibatis.annotations.Select;
7
-import org.apache.ibatis.annotations.Update;
5
+import org.apache.ibatis.annotations.*;
8 6
 
9 7
 // RoyaltySummaryMapper.java
10 8
 @Mapper
@@ -21,4 +19,15 @@ public interface RoyaltySummaryMapper extends BaseMapper<RoyaltySummary> {
21 19
             "VALUES (#{authorId}, #{month}, #{totalReads}, NOW()) " +
22 20
             "ON DUPLICATE KEY UPDATE total_reads = #{totalReads}, last_sync_time = NOW()")
23 21
     int upsertSummary(RoyaltySummary summary);
22
+
23
+
24
+    // 添加 insertOrUpdate 方法
25
+    @Insert("<script>" +
26
+            "INSERT INTO novel_royalty_summary (author_id, month, total_reads, last_sync_time) " +
27
+            "VALUES (#{authorId}, #{month}, #{totalReads}, NOW()) " +
28
+            "ON DUPLICATE KEY UPDATE " +
29
+            "total_reads = VALUES(total_reads), " +
30
+            "last_sync_time = NOW()" +
31
+            "</script>")
32
+    int insertOrUpdate(RoyaltySummary summary);
24 33
 }

+ 1
- 0
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/mapper/VoteRecordMapper.java Zobrazit soubor

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.novel.mapper;
2 2
 
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3 4
 import com.ruoyi.novel.domain.VoteRecord;
4 5
 import org.apache.ibatis.annotations.Mapper;
5 6
 import org.apache.ibatis.annotations.Param;

+ 12
- 0
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/service/AdService.java Zobrazit soubor

@@ -0,0 +1,12 @@
1
+package com.ruoyi.novel.service;
2
+
3
+import com.ruoyi.novel.domain.AdLog;
4
+import org.springframework.stereotype.Service;
5
+
6
+import java.util.List;
7
+@Service
8
+// AdService.java
9
+public interface AdService {
10
+    void logAdView(AdCountRequest request);
11
+    List<AdLog> getAdLogsByUser(Long userId);
12
+}

+ 13
- 0
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/service/ChapterService.java Zobrazit soubor

@@ -0,0 +1,13 @@
1
+package com.ruoyi.novel.service;
2
+
3
+import com.ruoyi.novel.domain.NovelChapter;
4
+
5
+import java.util.List;
6
+
7
+// ChapterService.java
8
+public interface ChapterService {
9
+    List<NovelChapter> selectChapterListByNovelId(Long novelId);
10
+    int saveChapter(NovelChapter chapter, String content);
11
+    NovelChapter getChapterById(Long chapterId);
12
+    int deleteChapters(Long[] ids);
13
+}

+ 2
- 0
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/service/IAdService.java Zobrazit soubor

@@ -2,9 +2,11 @@ package com.ruoyi.novel.service;
2 2
 
3 3
 import com.ruoyi.novel.domain.AdLog;
4 4
 import com.ruoyi.novel.domain.AdPlatformConfig;
5
+import org.springframework.stereotype.Service;
5 6
 
6 7
 import java.util.Map;
7 8
 
9
+@Service
8 10
 public interface IAdService {
9 11
     void logAdView(AdLog adLog);
10 12
     void syncWithAdPlatform(AdLog adLog);

+ 67
- 0
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/service/impl/AdConfigServiceImpl.java Zobrazit soubor

@@ -0,0 +1,67 @@
1
+package com.ruoyi.novel.service.impl;
2
+
3
+import com.ruoyi.novel.domain.AdPlatformConfig;
4
+import org.springframework.beans.factory.annotation.Autowired;
5
+import org.springframework.stereotype.Service;
6
+
7
+import javax.annotation.PostConstruct;
8
+import java.util.HashMap;
9
+import java.util.Map;
10
+import java.util.function.Function;
11
+import java.util.stream.Collectors;
12
+
13
+// AdConfigServiceImpl.java
14
+@Service
15
+public class AdConfigServiceImpl implements AdConfigService {
16
+
17
+    @Autowired
18
+    private AdPlatformConfigMapper configMapper;
19
+
20
+    private Map<String, AdPlatformConfig> adConfigCache;
21
+    private final Object lock = new Object();
22
+
23
+    @PostConstruct
24
+    public void init() {
25
+        refreshConfigCache();
26
+    }
27
+
28
+    @Override
29
+    public void refreshConfigCache() {
30
+        synchronized (lock) {
31
+            adConfigCache = configMapper.selectList(null).stream()
32
+                    .collect(Collectors.toMap(AdPlatformConfig::getPlatformCode, Function.identity()));
33
+
34
+            // 如果数据库为空,初始化默认配置
35
+            if (adConfigCache.isEmpty()) {
36
+                initDefaultConfigs();
37
+            }
38
+        }
39
+    }
40
+
41
+    private void initDefaultConfigs() {
42
+        adConfigCache = new HashMap<>();
43
+        adConfigCache.put("tencent", new AdPlatformConfig(
44
+                "tencent", "腾讯广告",
45
+                "https://ad.tencent.com/track",
46
+                "default_tencent_token",
47
+                "{\"user_id\":\"${userId}\",\"content_id\":\"${chapterId}\"}"
48
+        ));
49
+        adConfigCache.put("pangle", new AdPlatformConfig(
50
+                "pangle", "穿山甲",
51
+                "https://ad.pangle.com/api/v1/event",
52
+                "default_pangle_token",
53
+                "{\"user\":\"${userId}\",\"content_id\":\"${chapterId}\"}"
54
+        ));
55
+
56
+        // 保存默认配置到数据库
57
+        adConfigCache.values().forEach(configMapper::insert);
58
+    }
59
+
60
+    @Override
61
+    public AdPlatformConfig getConfig(String platformCode) {
62
+        if (adConfigCache == null) {
63
+            refreshConfigCache();
64
+        }
65
+        return adConfigCache.get(platformCode);
66
+    }
67
+}

+ 82
- 0
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/service/impl/AdLogServiceImpl.java Zobrazit soubor

@@ -0,0 +1,82 @@
1
+package com.ruoyi.novel.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.ruoyi.common.exception.ServiceException;
5
+import com.ruoyi.novel.domain.AdLog;
6
+import com.ruoyi.novel.domain.AdPlatformConfig;
7
+import com.ruoyi.novel.mapper.AdLogMapper;
8
+import lombok.extern.slf4j.Slf4j;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.scheduling.annotation.Async;
11
+import org.springframework.scheduling.annotation.Scheduled;
12
+import org.springframework.stereotype.Service;
13
+import org.springframework.transaction.annotation.Transactional;
14
+
15
+import java.util.List;
16
+
17
+// AdLogServiceImpl.java
18
+@Service
19
+@Slf4j
20
+public class AdLogServiceImpl implements AdLogService {
21
+
22
+    @Autowired
23
+    private AdLogMapper adLogMapper;
24
+
25
+    @Autowired
26
+    private AdConfigService adConfigService;
27
+
28
+    @Autowired
29
+    private AdSyncService adSyncService;
30
+
31
+    @Override
32
+    @Transactional
33
+    public void logAdView(AdLog adLog) {
34
+        // 1. 保存到数据库
35
+        adLog.setSyncStatus(0); // 0=未同步
36
+        adLogMapper.insert(adLog);
37
+
38
+        // 2. 异步同步到广告平台
39
+        syncAdLogAsync(adLog);
40
+    }
41
+
42
+    @Async
43
+    public void syncAdLogAsync(AdLog adLog) {
44
+        try {
45
+            AdPlatformConfig config = adConfigService.getConfig(adLog.getAdPlatform());
46
+            if (config == null) {
47
+                throw new ServiceException("广告平台配置不存在: " + adLog.getAdPlatform());
48
+            }
49
+
50
+            // 根据平台选择同步方式
51
+            switch (adLog.getAdPlatform()) {
52
+                case "tencent":
53
+                    adSyncService.syncToTencent(adLog, config);
54
+                    break;
55
+                case "pangle":
56
+                    adSyncService.syncToPangle(adLog, config);
57
+                    break;
58
+                default:
59
+                    throw new ServiceException("不支持的广告平台: " + adLog.getAdPlatform());
60
+            }
61
+
62
+            // 更新同步状态
63
+            adLog.setSyncStatus(1); // 1=同步成功
64
+        } catch (Exception e) {
65
+            log.error("广告同步失败: {}", e.getMessage());
66
+            adLog.setSyncStatus(2); // 2=同步失败
67
+        }
68
+        adLogMapper.updateById(adLog);
69
+    }
70
+
71
+    @Scheduled(fixedRate = 300000) // 每5分钟执行一次
72
+    public void retryFailedSyncs() {
73
+        List<AdLog> failedLogs = adLogMapper.selectList(
74
+                new QueryWrapper<AdLog>().eq("sync_status", 2)
75
+        );
76
+
77
+        failedLogs.forEach(log -> {
78
+            log.info("重试广告同步: ID={}, 平台={}", log.getId(), log.getAdPlatform());
79
+            syncAdLogAsync(log);
80
+        });
81
+    }
82
+}

+ 39
- 14
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/service/impl/AdServiceImpl.java Zobrazit soubor

@@ -1,23 +1,29 @@
1 1
 package com.ruoyi.novel.service.impl;
2 2
 
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.ruoyi.novel.config.ScheduledTasks;
5
+import com.ruoyi.novel.domain.AdCountRequest;
3 6
 import com.ruoyi.novel.domain.AdLog;
4 7
 import com.ruoyi.novel.domain.AdPlatformConfig;
5 8
 import com.ruoyi.novel.mapper.AdLogMapper;
6 9
 import com.ruoyi.novel.service.IAdService;
7 10
 import com.ruoyi.novel.utils.AdPlatformClient;
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
8 13
 import org.springframework.beans.factory.annotation.Autowired;
9 14
 import org.springframework.scheduling.annotation.Async;
10 15
 import org.springframework.scheduling.annotation.Scheduled;
11 16
 import org.springframework.stereotype.Service;
12 17
 import org.springframework.transaction.annotation.Transactional;
13 18
 
19
+import java.util.Date;
14 20
 import java.util.HashMap;
15 21
 import java.util.List;
16 22
 import java.util.Map;
17 23
 
18 24
 @Service
19 25
 public class AdServiceImpl implements IAdService {
20
-
26
+    private static final Logger logger = LoggerFactory.getLogger(AdServiceImpl.class);
21 27
     @Autowired
22 28
     private AdLogMapper adLogMapper;
23 29
 
@@ -32,7 +38,7 @@ public class AdServiceImpl implements IAdService {
32 38
         // 防止重复记录
33 39
         int count = adLogMapper.countByUserAndChapter(adLog.getUserId(), adLog.getChapterId());
34 40
         if (count > 0) {
35
-            log.warn("Duplicate ad log: user={}, chapter={}", adLog.getUserId(), adLog.getChapterId());
41
+            logger.warn("Duplicate ad log: user={}, chapter={}", adLog.getUserId(), adLog.getChapterId());
36 42
             return;
37 43
         }
38 44
 
@@ -47,19 +53,26 @@ public class AdServiceImpl implements IAdService {
47 53
             adPlatformClient.syncAdPlatform(adLog);
48 54
             adLog.setSyncStatus(1); // 同步成功
49 55
         } catch (Exception e) {
50
-            log.error("Ad sync failed: {}", e.getMessage());
56
+            logger.error("Ad sync failed: {}", e.getMessage());
51 57
             adLog.setSyncStatus(2); // 同步失败
52 58
         }
53 59
         adLogMapper.updateById(adLog);
54 60
     }
55 61
 
56 62
     @Override
57
-    @Scheduled(fixedRate = 300000) // 每5分钟执行一次
63
+    @Scheduled(fixedRateString = "${scheduled.ad-retry-interval:300000}") // 默认5分钟重试
58 64
     public void retryFailedSyncs() {
59
-        List<AdLog> failedLogs = adLogMapper.selectUnsyncedLogs();
60
-        failedLogs.forEach(log -> {
61
-            log.info("Retrying ad sync for log: {}", log.getId());
62
-            this.syncWithAdPlatform(log);
65
+        List<AdLog> failedLogs = adLogMapper.selectList(
66
+                new QueryWrapper<AdLog>().eq("sync_status", 2) // 2=同步失败状态
67
+        );
68
+        failedLogs.forEach(adLog -> {
69
+            try {
70
+                syncWithAdPlatform(adLog);  // 调用同步方法
71
+                adLog.setSyncStatus(1);      // 更新为成功状态
72
+                adLogMapper.updateById(adLog);
73
+            } catch (Exception e) {
74
+                logger.error("广告同步重试失败: ID={}", adLog.getId(), e);
75
+            }
63 76
         });
64 77
     }
65 78
 
@@ -82,12 +95,24 @@ public class AdServiceImpl implements IAdService {
82 95
         }
83 96
         return adConfigCache;
84 97
     }
85
-//    @Override
86
-//    @Transactional
87
-//    public void logAdView(AdLog adLog) {
88
-//        adLogMapper.insertAdLog(adLog);
89
-//    }
98
+    @Override
99
+    public void logAdView(AdCountRequest request) {
100
+        AdLog log = new AdLog();
101
+        log.setUserId(request.getUserId());
102
+        log.setChapterId(request.getChapterId());
103
+        log.setAdPlatform(request.getAdPlatform());
104
+        log.setDeviceId(request.getDeviceId());
105
+        log.setViewTime(new Date());
106
+        log.setSyncStatus(0); // 未同步
90 107
 
108
+        adLogMapper.insert(log);
109
+    }
110
+    @Override
111
+    public List<AdLog> getAdLogsByUser(Long userId) {
112
+        return adLogMapper.selectList(
113
+                new QueryWrapper<AdLog>().eq("user_id", userId)
114
+        );
115
+    }
91 116
     @Override
92 117
     public void syncWithAdPlatform(AdLog adLog) {
93 118
         // 根据平台选择不同实现
@@ -99,7 +124,7 @@ public class AdServiceImpl implements IAdService {
99 124
                 adPlatformClient.syncPangle(adLog);
100 125
                 break;
101 126
             default:
102
-                log.warn("Unknown ad platform: {}", adLog.getAdPlatform());
127
+                logger.warn("Unknown ad platform: {}", adLog.getAdPlatform());
103 128
         }
104 129
     }
105 130
 }

+ 81
- 0
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/service/impl/AdSyncServiceImpl.java Zobrazit soubor

@@ -0,0 +1,81 @@
1
+package com.ruoyi.novel.service.impl;
2
+
3
+import com.ruoyi.common.exception.ServiceException;
4
+import com.ruoyi.novel.domain.AdLog;
5
+import com.ruoyi.novel.domain.AdPlatformConfig;
6
+import lombok.extern.slf4j.Slf4j;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.http.*;
9
+import org.springframework.stereotype.Service;
10
+import org.springframework.web.client.RestTemplate;
11
+import org.springframework.web.util.UriComponentsBuilder;
12
+
13
+// AdSyncServiceImpl.java
14
+@Service
15
+@Slf4j
16
+public class AdSyncServiceImpl implements AdSyncService {
17
+
18
+    @Autowired
19
+    private RestTemplate restTemplate;
20
+
21
+    @Override
22
+    public void syncToTencent(AdLog adLog, AdPlatformConfig config) {
23
+        // 1. 构建请求参数
24
+        String payload = buildTencentPayload(adLog, config);
25
+
26
+        // 2. 创建请求头
27
+        HttpHeaders headers = new HttpHeaders();
28
+        headers.setContentType(MediaType.APPLICATION_JSON);
29
+        headers.setBearerAuth(config.getAuthToken());
30
+
31
+        // 3. 发送请求
32
+        HttpEntity<String> entity = new HttpEntity<>(payload, headers);
33
+        ResponseEntity<String> response = restTemplate.postForEntity(
34
+                config.getApiUrl(), entity, String.class);
35
+
36
+        // 4. 处理响应
37
+        if (response.getStatusCode() != HttpStatus.OK) {
38
+            throw new ServiceException("腾讯广告同步失败: " + response.getBody());
39
+        }
40
+        log.info("腾讯广告同步成功: chapter={}, user={}", adLog.getChapterId(), adLog.getUserId());
41
+    }
42
+
43
+    private String buildTencentPayload(AdLog adLog, AdPlatformConfig config) {
44
+        // 使用模板生成请求体
45
+        return config.getParamsTemplate()
46
+                .replace("${userId}", adLog.getUserId().toString())
47
+                .replace("${chapterId}", adLog.getChapterId().toString())
48
+                .replace("${timestamp}", String.valueOf(System.currentTimeMillis()));
49
+    }
50
+
51
+    @Override
52
+    public void syncToPangle(AdLog adLog, AdPlatformConfig config) {
53
+        // 1. 构建请求URL
54
+        String url = buildPangleUrl(adLog, config);
55
+
56
+        // 2. 创建请求头
57
+        HttpHeaders headers = new HttpHeaders();
58
+        headers.setBearerAuth(config.getAuthToken());
59
+
60
+        // 3. 发送请求
61
+        HttpEntity<?> entity = new HttpEntity<>(headers);
62
+        ResponseEntity<String> response = restTemplate.exchange(
63
+                url, HttpMethod.GET, entity, String.class);
64
+
65
+        // 4. 处理响应
66
+        if (response.getStatusCode() != HttpStatus.OK) {
67
+            throw new ServiceException("穿山甲同步失败: " + response.getBody());
68
+        }
69
+        log.info("穿山甲同步成功: chapter={}, user={}", adLog.getChapterId(), adLog.getUserId());
70
+    }
71
+
72
+    private String buildPangleUrl(AdLog adLog, AdPlatformConfig config) {
73
+        // 构建带参数的URL
74
+        return UriComponentsBuilder.fromHttpUrl(config.getApiUrl())
75
+                .queryParam("user", adLog.getUserId())
76
+                .queryParam("content_id", adLog.getChapterId())
77
+                .queryParam("event", "ad_view")
78
+                .queryParam("ts", System.currentTimeMillis())
79
+                .toUriString();
80
+    }
81
+}

+ 45
- 5
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/service/impl/ChapterServiceImpl.java Zobrazit soubor

@@ -3,10 +3,13 @@ package com.ruoyi.novel.service.impl;
3 3
 import com.ruoyi.novel.domain.NovelChapter;
4 4
 import com.ruoyi.novel.domain.NovelContent;
5 5
 import com.ruoyi.novel.mapper.NovelChapterMapper;
6
+import com.ruoyi.novel.service.ChapterService;
6 7
 import org.springframework.beans.factory.annotation.Autowired;
7 8
 import org.springframework.stereotype.Service;
8 9
 import org.springframework.transaction.annotation.Transactional;
9 10
 
11
+import java.util.List;
12
+
10 13
 // ChapterServiceImpl.java
11 14
 @Service
12 15
 public class ChapterServiceImpl implements ChapterService {
@@ -18,12 +21,49 @@ public class ChapterServiceImpl implements ChapterService {
18 21
     private NovelContentMapper contentMapper;
19 22
 
20 23
     @Override
24
+    public List<NovelChapter> selectChapterListByNovelId(Long novelId) {
25
+        return chapterMapper.selectList(
26
+                new QueryWrapper<NovelChapter>()
27
+                        .eq("novel_id", novelId)
28
+                        .orderByAsc("chapter_order")
29
+        );
30
+    }
31
+
32
+    @Override
21 33
     @Transactional
22 34
     public int saveChapter(NovelChapter chapter, String content) {
23
-        chapterMapper.insertChapter(chapter);
24
-        NovelContent novelContent = new NovelContent();
25
-        novelContent.setChapterId(chapter.getId());
26
-        novelContent.setContent(content);
27
-        return contentMapper.insertContent(novelContent);
35
+        if (chapter.getId() == null) {
36
+            // 新增章节
37
+            chapter.setCreateTime(new Date());
38
+            chapterMapper.insert(chapter);
39
+
40
+            NovelContent novelContent = new NovelContent();
41
+            novelContent.setChapterId(chapter.getId());
42
+            novelContent.setContent(content);
43
+            return contentMapper.insert(novelContent);
44
+        } else {
45
+            // 更新章节
46
+            chapter.setUpdateTime(new Date());
47
+            chapterMapper.updateById(chapter);
48
+
49
+            NovelContent novelContent = new NovelContent();
50
+            novelContent.setChapterId(chapter.getId());
51
+            novelContent.setContent(content);
52
+            return contentMapper.updateById(novelContent);
53
+        }
54
+    }
55
+
56
+    @Override
57
+    public NovelChapter getChapterById(Long chapterId) {
58
+        return chapterMapper.selectById(chapterId);
59
+    }
60
+
61
+    @Override
62
+    @Transactional
63
+    public int deleteChapters(Long[] ids) {
64
+        // 删除章节内容
65
+        contentMapper.deleteBatchIds(Arrays.asList(ids));
66
+        // 删除章节
67
+        return chapterMapper.deleteBatchIds(Arrays.asList(ids));
28 68
     }
29 69
 }

+ 45
- 5
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/service/impl/FinanceServiceImpl.java Zobrazit soubor

@@ -5,8 +5,11 @@ import com.ruoyi.novel.domain.RoyaltyReport;
5 5
 import com.ruoyi.novel.domain.RoyaltySummary;
6 6
 import com.ruoyi.novel.mapper.RoyaltySummaryMapper;
7 7
 import com.ruoyi.novel.service.IFinanceService;
8
-import lombok.Value;
8
+
9
+import org.slf4j.Logger;
10
+import org.slf4j.LoggerFactory;
9 11
 import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.beans.factory.annotation.Value;
10 13
 import org.springframework.scheduling.annotation.Scheduled;
11 14
 import org.springframework.stereotype.Service;
12 15
 
@@ -17,7 +20,7 @@ import java.util.List;
17 20
 // FinanceServiceImpl.java
18 21
 @Service
19 22
 public class FinanceServiceImpl implements IFinanceService {
20
-
23
+    private static final Logger logger = LoggerFactory.getLogger(FinanceServiceImpl.class);
21 24
     @Autowired
22 25
     private RoyaltySummaryMapper royaltySummaryMapper;
23 26
     @Value("${royalty.base.rate:0.15}")
@@ -33,6 +36,16 @@ public class FinanceServiceImpl implements IFinanceService {
33 36
 
34 37
     @Override
35 38
     public RoyaltyReport calculateRoyalty(Long authorId, String month) {
39
+        // 1. 从PHP系统拉取数据(补充缺失的调用)
40
+//        RoyaltySummary summary = phpApiClient.getAuthorRoyaltySummary(authorId, month);
41
+//        // 2. 计算分成金额(补充业务逻辑)
42
+//        BigDecimal royaltyRate = getRoyaltyRate(authorId);
43
+//        BigDecimal grossAmount = summary.getTotalReads().multiply(royaltyRate);
44
+//        BigDecimal handlingFee = grossAmount.multiply(handlingFeeRate);
45
+//        BigDecimal netAmount = grossAmount.subtract(handlingFee);
46
+//        // 3. 构建报表对象
47
+//        return new RoyaltyReport(authorId, month, summary.getTotalReads(),
48
+//                royaltyRate, handlingFeeRate, handlingFee, netAmount);
36 49
         // 1. 从PHP主库获取基础数据(假设已通过定时任务同步)
37 50
         RoyaltySummary summary = royaltySummaryMapper.selectByAuthorAndMonth(authorId, month);
38 51
 
@@ -72,7 +85,7 @@ public class FinanceServiceImpl implements IFinanceService {
72 85
     @Override
73 86
     @Scheduled(cron = "0 0 2 * * ?") // 每天凌晨2点执行
74 87
     public void syncRoyaltyData() {
75
-        log.info("开始同步分账数据...");
88
+        logger.info("开始同步分账数据...");
76 89
         try {
77 90
             // 1. 从PHP主库获取数据
78 91
             List<RoyaltySummary> summaries = fetchFromPhpSystem();
@@ -82,9 +95,9 @@ public class FinanceServiceImpl implements IFinanceService {
82 95
                 royaltySummaryMapper.upsertSummary(summary);
83 96
             });
84 97
 
85
-            log.info("同步完成: {}条记录", summaries.size());
98
+            logger.info("同步完成: {}条记录", summaries.size());
86 99
         } catch (Exception e) {
87
-            log.error("分账数据同步失败: {}", e.getMessage());
100
+            logger.error("分账数据同步失败: {}", e.getMessage());
88 101
         }
89 102
     }
90 103
 
@@ -108,4 +121,31 @@ public class FinanceServiceImpl implements IFinanceService {
108 121
     public BigDecimal getHandlingFeeRate() {
109 122
         return handlingFeeRate;
110 123
     }
124
+
125
+
126
+//    @Override
127
+//    public RoyaltyReport calculateRoyalty(Long authorId, String month) {
128
+//        // 1. 从PHP系统拉取数据(补充缺失的调用)
129
+//        RoyaltySummary summary = phpApiClient.getAuthorRoyaltySummary(authorId, month);
130
+//
131
+//        // 2. 计算分成金额(补充业务逻辑)
132
+//        BigDecimal royaltyRate = getRoyaltyRate(authorId);
133
+//        BigDecimal grossAmount = summary.getTotalReads().multiply(royaltyRate);
134
+//        BigDecimal handlingFee = grossAmount.multiply(handlingFeeRate);
135
+//        BigDecimal netAmount = grossAmount.subtract(handlingFee);
136
+//
137
+//        // 3. 构建报表对象
138
+//        return new RoyaltyReport(authorId, month, summary.getTotalReads(),
139
+//                royaltyRate, handlingFeeRate, handlingFee, netAmount);
140
+//    }
141
+//
142
+//    // 补充缺失的辅助方法
143
+//    private BigDecimal getRoyaltyRate(Long authorId) {
144
+//        Author author = authorService.getById(authorId);
145
+//        BigDecimal rate = baseRoyaltyRate;
146
+//        if (author.isVip()) {
147
+//            rate = rate.add(vipBonusRate); // VIP作者加成
148
+//        }
149
+//        return rate.min(new BigDecimal("0.35")); // 上限35%:cite[4]
150
+//    }
111 151
 }

+ 26
- 1
RuoYi-Vue/ruoyi-novel/src/main/java/com/ruoyi/novel/utils/JwtUtil.java Zobrazit soubor

@@ -3,12 +3,20 @@ package com.ruoyi.novel.utils;
3 3
 import io.jsonwebtoken.Claims;
4 4
 import io.jsonwebtoken.Jwts;
5 5
 import io.jsonwebtoken.SignatureAlgorithm;
6
+import org.springframework.beans.factory.annotation.Value;
6 7
 
8
+
9
+import java.nio.charset.StandardCharsets;
7 10
 import java.util.Date;
8 11
 
9 12
 // JwtUtil.java
10 13
 public class JwtUtil {
11
-    private static final String SECRET = "your_jwt_secret_key";
14
+    private static String SECRET = "your_jwt_secret_key";
15
+    @Value("${jwt.secret}")
16
+    public void setSecret(String secret) {
17
+        SECRET = secret;
18
+    }
19
+
12 20
     private static final long EXPIRE = 86400; // 24小时
13 21
     public static String generateToken(Long userId) {
14 22
         Date now = new Date();
@@ -44,4 +52,21 @@ public class JwtUtil {
44 52
                 .getBody();
45 53
         return Long.parseLong(claims.getSubject());
46 54
     }
55
+
56
+    // 补充Token解析方法
57
+    public static Claims parseToken(String token) {
58
+        return Jwts.parser()
59
+                .setSigningKey(SECRET.getBytes(StandardCharsets.UTF_8))
60
+                .parseClaimsJws(token)
61
+                .getBody();
62
+    }
63
+
64
+    // 补充缺失的Token生成方法
65
+//    public static String generateToken(Long userId) {
66
+//        return Jwts.builder()
67
+//                .setSubject(userId.toString())
68
+//                .setExpiration(new Date(System.currentTimeMillis() + 86400 * 1000))
69
+//                .signWith(SignatureAlgorithm.HS512, SECRET)
70
+//                .compact();
71
+//    }
47 72
 }

+ 26
- 26
RuoYi-Vue/ruoyi-novel/src/main/resources/application.yml Zobrazit soubor

@@ -1,26 +1,26 @@
1
-# 广告平台配置
2
-ad:
3
-  tencent:
4
-    url: https://ad.tencent.com/track
5
-  pangle:
6
-    url: https://ad.pangle.com/api/v1/event
7
-
8
-# DeepSeek API配置
9
-deepseek:
10
-  api:
11
-    key: your_deepseek_api_key
12
-    url: https://api.deepseek.com/v1/story/generate
13
-
14
-# PHP系统配置
15
-php:
16
-  notify:
17
-    url: http://php-system.com/api/vote/notify
18
-  data:
19
-    url: http://php-system.com/api/data
20
-
21
-# 分账规则
22
-royalty:
23
-  rate: 0.15   # 15%分成比例
24
-handling:
25
-  fee:
26
-    rate: 0.05  # 5%提现手续费
1
+## 广告平台配置
2
+#ad:
3
+#  tencent:
4
+#    url: https://ad.tencent.com/track
5
+#  pangle:
6
+#    url: https://ad.pangle.com/api/v1/event
7
+#
8
+## DeepSeek API配置
9
+#deepseek:
10
+#  api:
11
+#    key: your_deepseek_api_key
12
+#    url: https://api.deepseek.com/v1/story/generate
13
+#
14
+## PHP系统配置
15
+#php:
16
+#  notify:
17
+#    url: http://php-system.com/api/vote/notify
18
+#  data:
19
+#    url: http://php-system.com/api/data
20
+#
21
+## 分账规则
22
+#royalty:
23
+#  rate: 0.15   # 15%分成比例
24
+#handling:
25
+#  fee:
26
+#    rate: 0.05  # 5%提现手续费

Načítá se…
Zrušit
Uložit