作者 钟来

完善上线功能

@@ -4,6 +4,7 @@ import com.ruoyi.common.config.RuoYiConfig; @@ -4,6 +4,7 @@ import com.ruoyi.common.config.RuoYiConfig;
4 import com.zhonglai.luhui.config.TokenConfig; 4 import com.zhonglai.luhui.config.TokenConfig;
5 import io.swagger.annotations.ApiOperation; 5 import io.swagger.annotations.ApiOperation;
6 import org.springframework.beans.factory.annotation.Autowired; 6 import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.beans.factory.annotation.Value;
7 import org.springframework.context.annotation.Bean; 8 import org.springframework.context.annotation.Bean;
8 import org.springframework.context.annotation.Configuration; 9 import org.springframework.context.annotation.Configuration;
9 import springfox.documentation.builders.*; 10 import springfox.documentation.builders.*;
@@ -27,6 +28,9 @@ public class SwaggerConfig { @@ -27,6 +28,9 @@ public class SwaggerConfig {
27 @Autowired 28 @Autowired
28 protected TokenConfig tokenConfig ; 29 protected TokenConfig tokenConfig ;
29 30
  31 + @Value("${swagger.pathMapping}")
  32 + private String pathMapping;
  33 +
30 @Bean 34 @Bean
31 public Docket createRestApi() { 35 public Docket createRestApi() {
32 // 全局参数列表 36 // 全局参数列表
@@ -50,7 +54,7 @@ public class SwaggerConfig { @@ -50,7 +54,7 @@ public class SwaggerConfig {
50 .select() 54 .select()
51 .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) 55 .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
52 .paths(PathSelectors.any()) 56 .paths(PathSelectors.any())
53 - .build().pathMapping("/api"); 57 + .build().pathMapping(pathMapping);
54 } 58 }
55 59
56 /** 60 /**
@@ -41,16 +41,6 @@ public class AccessTokenVerifyInterceptor extends HandlerInterceptorAdapter { @@ -41,16 +41,6 @@ public class AccessTokenVerifyInterceptor extends HandlerInterceptorAdapter {
41 @Override 41 @Override
42 public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object handler) 42 public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object handler)
43 throws Exception { 43 throws Exception {
44 - log.info("---------------------开始进入"+httpServletRequest.getRequestURL().toString()+"登录拦截----------------------------");  
45 - Map<String,Object> map = new HashMap<>();  
46 - map.put("parameterValue",httpServletRequest.getParameterMap());  
47 - map.put(LOGIN_TOKEN_KEY,httpServletRequest.getHeader(LOGIN_TOKEN_KEY));  
48 - //获取请求body  
49 - byte[] bodyBytes = StreamUtils.copyToByteArray(httpServletRequest.getInputStream());  
50 - String body = new String(bodyBytes, httpServletRequest.getCharacterEncoding());  
51 - map.put("body",body);  
52 - log.info("---------------------参数:"+ GsonConstructor.get().toJson(map)+"----------------------------");  
53 -  
54 HttpSession session = httpServletRequest.getSession(); 44 HttpSession session = httpServletRequest.getSession();
55 if(null == session || null == session.getAttribute(LOGIN_TOKEN_KEY)) 45 if(null == session || null == session.getAttribute(LOGIN_TOKEN_KEY))
56 { 46 {
  1 +package com.zhonglai.laikun.fortune.telling.config.adapter;
  2 +
  3 +import com.ruoyi.common.utils.GsonConstructor;
  4 +import org.slf4j.Logger;
  5 +import org.slf4j.LoggerFactory;
  6 +import org.springframework.beans.factory.annotation.Value;
  7 +import org.springframework.util.StreamUtils;
  8 +import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
  9 +
  10 +import javax.servlet.http.HttpServletRequest;
  11 +import javax.servlet.http.HttpServletResponse;
  12 +import java.util.HashMap;
  13 +import java.util.Map;
  14 +
  15 +
  16 +public class LogInterceptor extends HandlerInterceptorAdapter {
  17 + private final Logger log = LoggerFactory.getLogger(LogInterceptor.class);
  18 +
  19 + // 令牌自定义标识
  20 + @Value("${token.header}")
  21 + private String LOGIN_TOKEN_KEY;
  22 + @Override
  23 + public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse response, Object handler) throws Exception {
  24 + log.info("---------------------开始进入"+httpServletRequest.getRequestURL().toString()+"请求拦截----------------------------");
  25 + Map<String,Object> map = new HashMap<>();
  26 + map.put("parameterValue",httpServletRequest.getParameterMap());
  27 + map.put(LOGIN_TOKEN_KEY,httpServletRequest.getHeader(LOGIN_TOKEN_KEY));
  28 + //获取请求body
  29 + byte[] bodyBytes = StreamUtils.copyToByteArray(httpServletRequest.getInputStream());
  30 + String body = new String(bodyBytes, httpServletRequest.getCharacterEncoding());
  31 + map.put("body",body);
  32 + log.info("---------------------参数:"+ GsonConstructor.get().toJson(map)+"----------------------------");
  33 + return super.preHandle(httpServletRequest, response, handler);
  34 + }
  35 +}
1 package com.zhonglai.laikun.fortune.telling.config.adapter; 1 package com.zhonglai.laikun.fortune.telling.config.adapter;
2 2
  3 +import com.ruoyi.common.config.RuoYiConfig;
3 import com.zhonglai.laikun.fortune.telling.config.FilterIgnorePropertiesConfig; 4 import com.zhonglai.laikun.fortune.telling.config.FilterIgnorePropertiesConfig;
4 import org.springframework.beans.factory.annotation.Autowired; 5 import org.springframework.beans.factory.annotation.Autowired;
5 import org.springframework.beans.factory.annotation.Value; 6 import org.springframework.beans.factory.annotation.Value;
6 import org.springframework.context.annotation.Bean; 7 import org.springframework.context.annotation.Bean;
7 import org.springframework.context.annotation.Configuration; 8 import org.springframework.context.annotation.Configuration;
  9 +import org.springframework.web.cors.CorsConfiguration;
  10 +import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
  11 +import org.springframework.web.filter.CorsFilter;
  12 +import org.springframework.web.servlet.config.annotation.CorsRegistry;
8 import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 13 import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
  14 +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
9 import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 15 import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
10 16
11 import java.util.List; 17 import java.util.List;
@@ -25,10 +31,15 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter { @@ -25,10 +31,15 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter {
25 return new AccessTokenVerifyInterceptor(); 31 return new AccessTokenVerifyInterceptor();
26 } 32 }
27 33
  34 + @Bean
  35 + public LogInterceptor logInterceptor() {
  36 + return new LogInterceptor();
  37 + }
  38 +
28 @Override 39 @Override
29 public void addInterceptors(InterceptorRegistry registry) { 40 public void addInterceptors(InterceptorRegistry registry) {
  41 + registry.addInterceptor(logInterceptor()).addPathPatterns("/**").excludePathPatterns();
30 registry.addInterceptor(tokenVerifyInterceptor()).addPathPatterns("/**").excludePathPatterns(ignorePropertiesConfig.getAntMatchers()); 42 registry.addInterceptor(tokenVerifyInterceptor()).addPathPatterns("/**").excludePathPatterns(ignorePropertiesConfig.getAntMatchers());
31 super.addInterceptors(registry); 43 super.addInterceptors(registry);
32 } 44 }
33 -  
34 } 45 }
@@ -14,6 +14,7 @@ import io.swagger.annotations.ApiOperation; @@ -14,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
14 import org.slf4j.Logger; 14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory; 15 import org.slf4j.LoggerFactory;
16 import org.springframework.beans.factory.annotation.Autowired; 16 import org.springframework.beans.factory.annotation.Autowired;
  17 +import org.springframework.beans.factory.annotation.Value;
17 import org.springframework.http.MediaType; 18 import org.springframework.http.MediaType;
18 import org.springframework.web.bind.annotation.GetMapping; 19 import org.springframework.web.bind.annotation.GetMapping;
19 import org.springframework.web.bind.annotation.PostMapping; 20 import org.springframework.web.bind.annotation.PostMapping;
@@ -41,6 +42,8 @@ public class CommonController @@ -41,6 +42,8 @@ public class CommonController
41 @Autowired 42 @Autowired
42 private ServerConfig serverConfig; 43 private ServerConfig serverConfig;
43 44
  45 + @Value("${swagger.pathMapping}")
  46 + private String pathMapping;
44 private static final String FILE_DELIMETER = ","; 47 private static final String FILE_DELIMETER = ",";
45 48
46 /** 49 /**
@@ -61,9 +61,9 @@ public class FortuneTellingController extends BaseController { @@ -61,9 +61,9 @@ public class FortuneTellingController extends BaseController {
61 "步骤三:判断用户提出的问题中,是否具有多个选择项。当问题里有多个选择项时:根据变爻爻辞的中文内容,严格按照匹配的中文关键词和内容判断规则,必须给每个选择项都占卜一个结果(凶、中、吉、大吉其中之一),例如:(例如:吃火锅,吉,吃烧烤,中);当问题里没有多个选择项时:根据变爻爻辞的中文内容,严格按照匹配的中文关键词和内容判断规则,将这个问题的占卜结果归类为凶、中、吉、大吉其中之一。\n" + 61 "步骤三:判断用户提出的问题中,是否具有多个选择项。当问题里有多个选择项时:根据变爻爻辞的中文内容,严格按照匹配的中文关键词和内容判断规则,必须给每个选择项都占卜一个结果(凶、中、吉、大吉其中之一),例如:(例如:吃火锅,吉,吃烧烤,中);当问题里没有多个选择项时:根据变爻爻辞的中文内容,严格按照匹配的中文关键词和内容判断规则,将这个问题的占卜结果归类为凶、中、吉、大吉其中之一。\n" +
62 "步骤四:按照以上规则,请严格执行以下输出步骤和内容格式,不要出现其他的内容!\n" + 62 "步骤四:按照以上规则,请严格执行以下输出步骤和内容格式,不要出现其他的内容!\n" +
63 "当问题中有多个选择项时,输出格式如下:\n" + 63 "当问题中有多个选择项时,输出格式如下:\n" +
64 - "1.标题为“爻辞: ”,输出爻辞,然后换行。\n" +  
65 - "2.标题为“结论: ”, 然后换行。\n" +  
66 - "3.选择项的名称,选择项的占卜结果(每个选择项都必须分包单独一行输出)\n" + 64 + "1.标题为“爻辞:”,输出爻辞,然后换行。\n" +
  65 + "2.标题为“结论:”, 然后换行。\n" +
  66 + "3.标题为“分析:”,选择项的名称,选择项的占卜结果(每个选择项都必须分包单独一行输出)\n" +
67 "示例:\n" + 67 "示例:\n" +
68 "吃火锅,吉\n" + 68 "吃火锅,吉\n" +
69 "吃烧烤,中\n" + 69 "吃烧烤,中\n" +
@@ -73,9 +73,9 @@ public class FortuneTellingController extends BaseController { @@ -73,9 +73,9 @@ public class FortuneTellingController extends BaseController {
73 "6.相关于用户问题的其他方面分析:针对财务、生活、爱情、健康、工作、事业、未来等相关领域(最多三个),根据变爻数字和用户问题提供详细分析和建议。 \n" + 73 "6.相关于用户问题的其他方面分析:针对财务、生活、爱情、健康、工作、事业、未来等相关领域(最多三个),根据变爻数字和用户问题提供详细分析和建议。 \n" +
74 "\n" + 74 "\n" +
75 "当问题里没有多个选择项时:,输出格式如下:\n" + 75 "当问题里没有多个选择项时:,输出格式如下:\n" +
76 - "1.标题为“爻辞: ”,输出爻辞,然后换行。\n" +  
77 - "2.标题为“结论: ”,输出结论, 然后换行。\n" +  
78 - "3.输出用户提问的占卜结果(例如:凶; 中; 吉; 大吉)\n" + 76 + "1.标题为“爻辞:”,输出爻辞,然后换行。\n" +
  77 + "2.标题为“结论:”,输出结论, 然后换行。\n" +
  78 + "3.标题为“分析:”,输出用户提问的占卜结果(例如:凶; 中; 吉; 大吉)\n" +
79 "4.根据变爻的文本和占卜结果,提炼出对用户问题的关键占卜结论,并进行详细解释。\n" + 79 "4.根据变爻的文本和占卜结果,提炼出对用户问题的关键占卜结论,并进行详细解释。\n" +
80 "5.提供变爻内容的深入、全面的专家级解释,分析并回答用户的问题。\n" + 80 "5.提供变爻内容的深入、全面的专家级解释,分析并回答用户的问题。\n" +
81 "6.相关于用户问题的其他方面分析:针对财务、生活、爱情、健康、工作、事业、未来等相关领域(最多三个),根据变爻数字和用户问题提供详细分析和建议。 \n" + 81 "6.相关于用户问题的其他方面分析:针对财务、生活、爱情、健康、工作、事业、未来等相关领域(最多三个),根据变爻数字和用户问题提供详细分析和建议。 \n" +
@@ -85,6 +85,7 @@ public class FortuneTellingController extends BaseController { @@ -85,6 +85,7 @@ public class FortuneTellingController extends BaseController {
85 { 85 {
86 clues = (String) list.get(0).get("remark"); 86 clues = (String) list.get(0).get("remark");
87 } 87 }
  88 + try {
88 String str = YiJiFortuneTellingService.calculation(question,yaochi,clues); 89 String str = YiJiFortuneTellingService.calculation(question,yaochi,clues);
89 90
90 FortuneTellingLog fortuneTellingLog = new FortuneTellingLog(); 91 FortuneTellingLog fortuneTellingLog = new FortuneTellingLog();
@@ -94,11 +95,27 @@ public class FortuneTellingController extends BaseController { @@ -94,11 +95,27 @@ public class FortuneTellingController extends BaseController {
94 fortuneTellingLog.setAnswer(str); 95 fortuneTellingLog.setAnswer(str);
95 fortuneTellingLog.setCreate_time(DateUtils.getTime()); 96 fortuneTellingLog.setCreate_time(DateUtils.getTime());
96 fortuneTellingLog.setUser_id(Integer.parseInt(getLoginToken().getId())); 97 fortuneTellingLog.setUser_id(Integer.parseInt(getLoginToken().getId()));
  98 + publicService.insert(fortuneTellingLog);
  99 + //加工返回值
  100 + return toReturn(str);
  101 + }catch (Exception e)
  102 + {
  103 + String str = YiJiFortuneTellingService.calculation(question,yaochi,clues);
97 104
  105 + FortuneTellingLog fortuneTellingLog = new FortuneTellingLog();
  106 + fortuneTellingLog.setQuestion(question);
  107 + fortuneTellingLog.setNums(GsonConstructor.get().toJson(nums));
  108 + fortuneTellingLog.setYaochi(yaochi);
  109 + fortuneTellingLog.setAnswer(str);
  110 + fortuneTellingLog.setCreate_time(DateUtils.getTime());
  111 + fortuneTellingLog.setUser_id(Integer.parseInt(getLoginToken().getId()));
  112 + publicService.insert(fortuneTellingLog);
98 //加工返回值 113 //加工返回值
99 return toReturn(str); 114 return toReturn(str);
100 } 115 }
101 116
  117 + }
  118 +
102 @ApiOperation("随机三个数") 119 @ApiOperation("随机三个数")
103 @Transactional 120 @Transactional
104 @RequestMapping(value = "/randomNums3",method = RequestMethod.GET) 121 @RequestMapping(value = "/randomNums3",method = RequestMethod.GET)
@@ -139,14 +156,32 @@ public class FortuneTellingController extends BaseController { @@ -139,14 +156,32 @@ public class FortuneTellingController extends BaseController {
139 156
140 private AjaxResult toReturn(String str) 157 private AjaxResult toReturn(String str)
141 { 158 {
142 - String[] ss = str.split("\\n\\n");  
143 Map<String,String> map = new HashMap<>(); 159 Map<String,String> map = new HashMap<>();
144 - map.put("divination",str.substring(str.indexOf("爻辞: ")+4,findNthOccurrence(str,"\n\n",1)));  
145 - map.put("conclusion",str.substring(str.indexOf("结论: ")+4,findNthOccurrence(str,"\n\n",2)));  
146 - map.put("analysis",str.substring(findNthOccurrence(str,"\n\n",2)+2)); 160 + map.put("divination",str.substring(str.indexOf("爻辞:")+3,str.indexOf("结论:")).replaceAll("\r","").replaceAll("\n",""));
  161 + map.put("conclusion",str.substring(str.indexOf("结论:")+3,str.indexOf("分析:")).replaceAll("\r","").replaceAll("\n"," "));
  162 + map.put("analysis",str.substring(str.indexOf("分析:")+3));
147 return AjaxResult.success("成功",map); 163 return AjaxResult.success("成功",map);
148 } 164 }
149 165
  166 + private int getfxindex(String str)
  167 + {
  168 + List<Map<String,Object>> list = publicService.getObjectListBySQL("SELECT remark FROM `lk-fortune-telling-sys`.`sys_config` WHERE config_key='sys.fortune.telling.retrun.indexstr'");
  169 + if(null != list && list.size()==1)
  170 + {
  171 + String remark = (String) list.get(0).get("remark");
  172 + String[] ss = remark.split("\\|");
  173 + for (String s:ss)
  174 + {
  175 + if(str.indexOf(s)>0)
  176 + {
  177 + return str.indexOf(s);
  178 + }
  179 + }
  180 + }
  181 +
  182 + return -1;
  183 + }
  184 +
150 185
151 private static int findNthOccurrence(String str, String patt, int number) { 186 private static int findNthOccurrence(String str, String patt, int number) {
152 if (str == null || patt == null || number < 1) { 187 if (str == null || patt == null || number < 1) {
@@ -170,10 +205,9 @@ public class FortuneTellingController extends BaseController { @@ -170,10 +205,9 @@ public class FortuneTellingController extends BaseController {
170 } 205 }
171 206
172 public static void main(String[] args) { 207 public static void main(String[] args) {
173 - String str = "爻辞: 见舆曳,其牛掣,其人天且劓,无初有终。\n\n结论: 中\n\n根据变爻的文本和占卜结果,对您今天的运势进行占卜可以划分为中等级别。这表示您在今天可能会遇到一些困难或挑战,但通过坚定的信念和努力,最终可以克服难关。\n\n深入解释: 这个爻辞描绘了一种困难对抗的场景,但也强调了坚持到底的重要性。牛掣车辐,虽然曳力增大,但只要坚持不懈,最终会有所收获。劓本义是割耳,表示可能会有一些牺牲或损失,但这也是通向成功的必经之路。\n\n其他方面分析:\n财务: 今天可能会有一些额外支出或投资,需要谨慎对待财务安排,以避免不必要的损失。\n生活: 坚持自己的原则和信念,相信自己的选择,即使面临逆境也要勇往直前,生活会逐渐好转。\n工作: 遇到挑战时不要放弃,坚持努力并寻求他人帮助,解决问题的方式会逐渐清晰。";  
174 -  
175 - System.out.println(">>>>>"+str.substring(str.indexOf("爻辞: ")+4,findNthOccurrence(str,"\n\n",1)));  
176 - System.out.println(">>>>>"+str.substring(str.indexOf("结论: ")+4,findNthOccurrence(str,"\n\n",2)));  
177 - System.out.println(">>>>>"+str.substring(findNthOccurrence(str,"\n\n",2)+2)); 208 + String str = "爻辞: 上六:乘马班如,泣血涟如。\n\n结论: 吃火锅,凶\n\n分析:\n吃火锅,凶\n吃烧烤,中\n\n对用户提出的问题,根据变爻爻辞的内容,吃火锅的结果为凶,吃烧烤的结果为中。建议选择吃烧烤会更加合适。\n\n关键占卜结论:此卦指出吃火锅可能会遇到不顺利或困难,建议考虑改变计划,选择其他餐饮方式会更加顺利。详细解释分析请参考专家级解释。\n\n财务方面分析:在财务投资上要注意风险,谨慎行事,避免财务损失。\n\n生活方面分析:在日常生活中要保持乐观态度,积极面对生活中的挑战,合理安排行程。\n\n健康方面分析:关注身体健康,避免过度食用油腻食物,保持适当运动,注意休息。";
  209 + System.out.println(">>>>>"+str.substring(str.indexOf("爻辞:")+3,str.indexOf("结论:")).replaceAll("\r","").replaceAll("\n",""));
  210 + System.out.println(">>>>>"+str.substring(str.indexOf("结论:")+3,str.indexOf("分析:")).replaceAll("\r","").replaceAll("\n"," "));
  211 + System.out.println(">>>>>"+str.substring(str.indexOf("分析:")+3));
178 } 212 }
179 } 213 }
1 -# 项目相关配置 jhlt: # 名称 name: zhonglai # 版本 version: 3.8.2 # 版权年份 copyrightYear: 2024 # 实例演示开关 demoEnabled: true # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) profile: D:/ruoyi/uploadPath # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 port: 8086 servlet: # 应用的访问路径 context-path: / tomcat: # tomcat的URI编码 uri-encoding: UTF-8 # 连接数满后的排队数,默认为100 accept-count: 1000 threads: # tomcat最大线程数,默认为200 max: 800 # Tomcat启动初始化的线程数,默认值10 min-spare: 100 # 日志配置 logging: level: com.ruoyi: debug org.springframework: warn # Spring配置 spring: # 资源信息 messages: # 国际化资源文件路径 basename: i18n/messages profiles: active: druid # 文件上传 servlet: multipart: # 单个文件大小 max-file-size: 10MB # 设置总上传的文件大小 max-request-size: 20MB # 服务模块 devtools: restart: # 热部署开关 enabled: true # web: # resources: # static-locations: classpath:/static/, classpath:/templates/ # token配置 token: # 令牌自定义标识 header: Authorization # 令牌有效期(默认30分钟) expireTime: 31536000 # MyBatis配置 mybatis: # 搜索指定包别名 typeAliasesPackage: com.ruoyi.**.domain # 配置mapper的扫描,找到所有的mapper.xml映射文件 mapperLocations: classpath*:mapper/**/*Mapper.xml # 加载全局的配置文件 configLocation: classpath:mybatis/mybatis-config.xml # PageHelper分页插件 pagehelper: helperDialect: mysql supportMethodsArguments: true params: count=countSql # Swagger配置 swagger: # 是否开启swagger enabled: true # 请求前缀 pathMapping: / sys: ## // 对于登录login 注册register 验证码captchaImage 允许匿名访问 antMatchers: - /doc.html - /webjars/** - /swagger-ui.html - /v2/api-docs/** - /swagger/api-docs - /token/code - /swagger-resources/** - /login/** chatgpt: token: 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 # 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 timeout: 5000 apiHost: https://api.openai.com/ proxy: isProxy: true host: 127.0.0.1 port: 7890  
  1 +# 项目相关配置 jhlt: # 名称 name: zhonglai # 版本 version: 3.8.2 # 版权年份 copyrightYear: 2024 # 实例演示开关 demoEnabled: true # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) profile: uploadPath # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 port: 8086 servlet: # 应用的访问路径 context-path: / tomcat: # tomcat的URI编码 uri-encoding: UTF-8 # 连接数满后的排队数,默认为100 accept-count: 1000 threads: # tomcat最大线程数,默认为200 max: 800 # Tomcat启动初始化的线程数,默认值10 min-spare: 100 # 日志配置 logging: level: com.ruoyi: debug org.springframework: warn # Spring配置 spring: # 资源信息 messages: # 国际化资源文件路径 basename: i18n/messages profiles: active: druid # 文件上传 servlet: multipart: # 单个文件大小 max-file-size: 10MB # 设置总上传的文件大小 max-request-size: 20MB # 服务模块 devtools: restart: # 热部署开关 enabled: true # web: # resources: # static-locations: classpath:/static/, classpath:/templates/ # token配置 token: # 令牌自定义标识 header: Authorization # 令牌有效期(默认30分钟) expireTime: 31536000 # MyBatis配置 mybatis: # 搜索指定包别名 typeAliasesPackage: com.ruoyi.**.domain # 配置mapper的扫描,找到所有的mapper.xml映射文件 mapperLocations: classpath*:mapper/**/*Mapper.xml # 加载全局的配置文件 configLocation: classpath:mybatis/mybatis-config.xml # PageHelper分页插件 pagehelper: helperDialect: mysql supportMethodsArguments: true params: count=countSql # Swagger配置 swagger: # 是否开启swagger enabled: true # 请求前缀 pathMapping: /api sys: ## // 对于登录login 注册register 验证码captchaImage 允许匿名访问 antMatchers: - /doc.html - /webjars/** - /swagger-ui.html - /v2/api-docs/** - /swagger/api-docs - /token/code - /swagger-resources/** - /login/** - /profile/** chatgpt: token: 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 # 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 timeout: 5000 apiHost: https://api.openai.com/ proxy: isProxy: true host: 127.0.0.1 port: 7890