reverseList;
15 | public String answer;
16 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/diviner/util/BaiduMapsUtil.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.diviner.util;
2 |
3 | import java.io.BufferedReader;
4 | import java.io.InputStreamReader;
5 | import java.net.URL;
6 | import java.net.URLConnection;
7 | import java.nio.charset.StandardCharsets;
8 | import java.util.HashMap;
9 | import java.util.Map;
10 |
11 | import com.alibaba.fastjson.JSONObject;
12 | import org.apache.commons.lang3.StringUtils;
13 |
14 | /**
15 | * 百度地图定位工具
16 | *
17 | * API地址:https://lbsyun.baidu.com/faq/api?title=webapi
18 | */
19 | public class BaiduMapsUtil {
20 |
21 | /**
22 | * 开发者密钥
23 | */
24 | private static final String ak = ""; // 密钥申请地址:https://lbsyun.baidu.com/apiconsole/key#/home
25 |
26 | //****************************************************************************************************************************************************
27 |
28 | /**
29 | * 通过地区获取经纬度
30 | *
31 | * @param address 地区
32 | * @return 经纬度
33 | */
34 | public static Map getLngAndLat(String address) {
35 |
36 | /* 接口文档地址:https://lbsyun.baidu.com/faq/api?title=webapi/guide/webservice-geocoding-base */
37 |
38 | // 1、参数校验
39 | if (StringUtils.isBlank(ak)) throw new NullPointerException("⚠ 请填写开发者密钥");
40 | if (StringUtils.isBlank(address)) throw new NullPointerException("⚠ 请填写地区");
41 |
42 | // 2、发送URL请求
43 | String url = "https://api.map.baidu.com/geocoding/v3/?address=" + address + "&output=json&ak=" + ak;
44 | JSONObject data = sendUrl(url);
45 |
46 | // 3、获取数据
47 | Map map = new HashMap<>();
48 | if (data.get("status").toString().equals("0")) {
49 | map.put("lng", data.getJSONObject("result").getJSONObject("location").getDouble("lng")); // 经度
50 | map.put("lat", data.getJSONObject("result").getJSONObject("location").getDouble("lat")); // 纬度
51 | } else {
52 | throw new NullPointerException("⚠ 定位异常");
53 | }
54 |
55 | return map;
56 |
57 | }
58 |
59 | /**
60 | * 通过经纬度获取地区
61 | *
62 | * @param lng 经度
63 | * @param lat 纬度
64 | * @return 地区
65 | */
66 | public static String getAddress(String lng, String lat) {
67 |
68 | /* 接口文档地址:https://lbsyun.baidu.com/faq/api?title=webapi/guide/webservice-geocoding-abroad-base */
69 |
70 | // 1、参数校验
71 | if (StringUtils.isBlank(ak)) throw new NullPointerException("⚠ 请填写开发者密钥");
72 | if (StringUtils.isBlank(lng) || StringUtils.isBlank(lat)) throw new NullPointerException("⚠ 请填完善经纬度");
73 |
74 | // 2、发送URL请求
75 | String url = "https://api.map.baidu.com/reverse_geocoding/v3/?location=" + lat + "," + lng + "&output=json&coordtype=wgs84ll&extensions_poi=1&extensions_town=true&ak=" + ak;
76 | JSONObject data = sendUrl(url);
77 |
78 | // 3、获取数据
79 | String address;
80 | if (data.get("status").toString().equals("0")) {
81 | address = data.getJSONObject("result").getString("formatted_address"); // 标准的结构化地址
82 | } else {
83 | throw new NullPointerException("⚠ 定位异常");
84 | }
85 |
86 | return address;
87 |
88 | }
89 |
90 | /**
91 | * 通过机器ip定位获取地区(若机器ip为空,则根据发送请求的机器ip定位)
92 | *
93 | * @param ip 机器ip(如:127.0.0.1)
94 | * @return 地区
95 | */
96 | public static String getIpToAddress(String ip) {
97 |
98 | /* 接口文档地址:https://lbsyun.baidu.com/faq/api?title=webapi/ip-api-base */
99 |
100 | // 1、参数校验
101 | if (StringUtils.isBlank(ak)) throw new NullPointerException("⚠ 请填写开发者密钥");
102 | if (StringUtils.isNotBlank(ip) && CommonUtil.checkIp(ip)) {
103 | if ("localhost".equals(ip) || "127.0.0.1".equals(ip) || "::1".equals(ip)) {
104 | ip = "";
105 | }
106 | } else {
107 | ip = "";
108 | }
109 |
110 | // 2、发送URL请求
111 | String url = "https://api.map.baidu.com/location/ip?ip=" + ip + "&coor=bd09ll&&ak=" + ak;
112 | JSONObject data = sendUrl(url);
113 |
114 | // 3、获取数据
115 | String address;
116 | if (data.get("status").toString().equals("0")) {
117 | address = data.getJSONObject("content").getString("address"); // 简要地址信息
118 | } else {
119 | throw new NullPointerException("⚠ 定位异常");
120 | }
121 |
122 | return address;
123 |
124 | }
125 |
126 | //----------------------------------------------------------------------------------------------------------------------------------------------------
127 |
128 | /**
129 | * 发送URL请求
130 | *
131 | * @param url URL路径
132 | * @return 数据
133 | */
134 | private static JSONObject sendUrl(String url) {
135 |
136 | StringBuilder json = new StringBuilder();
137 |
138 | try {
139 | URL oracle = new URL(url);
140 | URLConnection uc = oracle.openConnection();
141 | InputStreamReader isr = new InputStreamReader(uc.getInputStream(), StandardCharsets.UTF_8);
142 | BufferedReader br = new BufferedReader(isr);
143 | String inputLine;
144 | while (null != (inputLine = br.readLine())) {
145 | json.append(inputLine);
146 | }
147 | br.close();
148 | } catch (Exception e) {
149 | throw new NullPointerException("⚠ 系统异常");
150 | }
151 |
152 | return JSONObject.parseObject(json.toString());
153 |
154 | }
155 |
156 |
157 | }
158 |
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/diviner/util/CommonUtil.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.diviner.util;
2 |
3 | import java.math.BigDecimal;
4 | import java.util.*;
5 |
6 | import com.nlf.calendar.Lunar;
7 | import com.nlf.calendar.Solar;
8 | import org.apache.commons.validator.routines.InetAddressValidator;
9 |
10 | /**
11 | * 通用工具
12 | */
13 | public class CommonUtil {
14 |
15 | /**
16 | * 二十四小时对应十二地支
17 | */
18 | public static final String[] HOUR_ZHI = {
19 | "子", "丑", "丑", "寅", "寅", "卯", "卯", "辰", "辰", "巳", "巳", "午", "午", "未", "未", "申", "申", "酉", "酉", "戌", "戌", "亥", "亥", "子"
20 | };
21 |
22 | //****************************************************************************************************************************************************
23 |
24 | /**
25 | * 格式化公历日期
26 | *
27 | * @param solar 公历日期
28 | * @return 公历日期
29 | */
30 | public static String solarStr(Solar solar) {
31 |
32 | return solar.getYear() + "年" + solar.getMonth() + "月" + solar.getDay() + "日" + solar.getHour() + "时";
33 |
34 | }
35 |
36 | /**
37 | * 格式化农历日期
38 | *
39 | * @param lunar 农历日期
40 | * @return 农历日期
41 | */
42 | public static String lunarStr(Lunar lunar) {
43 |
44 | String lunarStr;
45 |
46 | // 判断时辰
47 | int hour = lunar.getHour();
48 | if (hour >= 23 || hour < 1) {
49 | // 判断早晚子时
50 | if (hour >= 23) {
51 | lunarStr = lunar + "(晚)子时";
52 | } else {
53 | lunarStr = lunar + "(早)子时";
54 | }
55 | } else {
56 | lunarStr = lunar + HOUR_ZHI[hour] + "时";
57 | }
58 |
59 | return lunarStr;
60 |
61 | }
62 |
63 | /**
64 | * 机器ip校验
65 | *
66 | * @param ip 机器ip(ipv4或ipv6)
67 | * @return true:格式正确。false:格式错误
68 | */
69 | public static boolean checkIp(String ip) {
70 |
71 | boolean isFlag = true;
72 | InetAddressValidator validator = InetAddressValidator.getInstance();
73 | if (!validator.isValidInet4Address(ip) && !validator.isValidInet6Address(ip)) {
74 | isFlag = false;
75 | }
76 | return isFlag;
77 |
78 | }
79 |
80 | /**
81 | * 保留Double型数据的N位小数
82 | *
83 | * @param number double类型数据
84 | * @param count 保留小数的位数
85 | * @return double型数据
86 | */
87 | public static Double getDouble(double number, int count) {
88 |
89 | BigDecimal bigDec = new BigDecimal(number);
90 | return bigDec.setScale(count, BigDecimal.ROUND_FLOOR).doubleValue();
91 |
92 | }
93 |
94 | /**
95 | * 向List集合中添加指定个数的字符串
96 | *
97 | * @param count 元素数量
98 | * @return 空list集合
99 | */
100 | public static List addCharToList(int count) {
101 |
102 | List list = new ArrayList<>();
103 | for (int i = 0; i <= (count - 1); i++) {
104 | list.add("");
105 | }
106 | return list;
107 |
108 | }
109 |
110 | /**
111 | * 获取两个List数组中的不同元素
112 | *
113 | * @param list1 数组1
114 | * @param list2 数组2
115 | * @return 不同元素的数组
116 | */
117 | public static List getListUnlike(List list1, List list2) {
118 |
119 | List maxList = list1;
120 | List minList = list2;
121 | if (list2.size() > list1.size()) {
122 | maxList = list2;
123 | minList = list1;
124 | }
125 |
126 | Map map = new HashMap<>(list1.size() + list2.size());
127 | for (String string : maxList) {
128 | map.put(string, 1);
129 | }
130 | for (String string : minList) {
131 | Integer count = map.get(string);
132 | if (null != count) {
133 | map.put(string, ++count);
134 | continue;
135 | }
136 | map.put(string, 1);
137 | }
138 |
139 | List unlike = new ArrayList<>();
140 | for (Map.Entry entry : map.entrySet()) {
141 | if (entry.getValue() == 1) {
142 | unlike.add(entry.getKey());
143 | }
144 | }
145 |
146 | return unlike;
147 |
148 | }
149 |
150 | /**
151 | * 获取list集合里出现的重复元素及出现次数
152 | *
153 | * @param list List数据
154 | * @return key:元素 value:元素重复的次数
155 | */
156 | public static Map getListIdentical(List list) {
157 |
158 | Map map = new HashMap<>();
159 | for (String item : list) {
160 | // 记录当前元素出现的次数
161 | int count = 1;
162 | // 若当前元素在map容器中已存在,计数器+1
163 | if (null != map.get(item)) {
164 | count = map.get(item) + 1;
165 | }
166 | // 向map容器里存数据
167 | map.put(item, count);
168 | }
169 |
170 | return map;
171 |
172 | }
173 |
174 | /**
175 | * 删除list集合中的指定的元素
176 | *
177 | * @param list List集合
178 | * @param element 需要删除的元素
179 | */
180 | public static void removeElementList(List list, String element) {
181 |
182 | for (int i = 0; i < list.size(); i++) {
183 | if (element.equals(list.get(i))) {
184 | list.remove(i);
185 | i--;
186 | }
187 | }
188 |
189 | }
190 |
191 | /**
192 | * 删除list数组中重复的元素
193 | *
194 | * @param list list数组
195 | * @return list数组
196 | */
197 | public static List removeDuplicates(List list) {
198 |
199 | // 删除所有null
200 | list.removeAll(Collections.singleton(null));
201 |
202 | // 删除所有重复数据
203 | Set set = new LinkedHashSet<>(list);
204 | return new ArrayList<>(set);
205 |
206 | }
207 |
208 | /**
209 | * 获取指定个数的随机数
210 | *
211 | * @param count 数量
212 | * @param range 范围(如→ 0:产生0,1:产生0~1中的随机一位数字,2:产生0~2中的随机一位数字,... )
213 | * @return List随机数集合
214 | */
215 | public static List randomList(long count, int range) {
216 |
217 | List list = new ArrayList<>();
218 |
219 | for (int i = 0; i < count; i++) {
220 | list.add(new Random().nextInt(range + 1));
221 | }
222 |
223 | return list;
224 |
225 | }
226 |
227 | /**
228 | * 将N个数据封装为List集合,若数据<0时默认为0,若数据>3时默认为3
229 | *
230 | * @param parameter 数据
231 | * @return List集合
232 | */
233 | public static List packageList(int... parameter) {
234 |
235 | List list = new ArrayList<>();
236 | for (int i : parameter) {
237 | if (i < 0) i = 0;
238 | if (i > 3) i = 3;
239 | list.add(i);
240 | }
241 | return list;
242 |
243 | }
244 |
245 | /**
246 | * 数字转换汉字
247 | *
248 | * @param number 数字
249 | * @return 汉字(例如:一)
250 | */
251 | public static String shuToHan(long number) {
252 |
253 | final String[] unit = {"", "十", "百", "千", "万", "十", "百", "千", "亿", "十", "百", "千"};
254 | final String[] lowercaseNumber = {"零", "一", "二", "三", "四", "五", "六", "七", "八", "九"};
255 |
256 | int count = 0;
257 | StringBuilder sb = new StringBuilder();
258 | while (number > 0) {
259 | sb.insert(0, (lowercaseNumber[Math.toIntExact(number % 10)] + unit[count]));
260 | number = (number / 10);
261 | count++;
262 | }
263 |
264 | return sb.toString().replaceAll("零[千百十]", "零").replaceAll("零+万", "万")
265 | .replaceAll("零+亿", "亿").replaceAll("亿万", "亿零")
266 | .replaceAll("零+", "零").replaceAll("零$", "");
267 |
268 | }
269 |
270 |
271 | }
272 |
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/diviner/util/DateUtil.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.diviner.util;
2 |
3 | import java.text.SimpleDateFormat;
4 | import java.time.LocalDateTime;
5 | import java.time.format.DateTimeFormatter;
6 | import java.time.temporal.ChronoUnit;
7 | import java.util.*;
8 |
9 | /**
10 | * 时间工具
11 | */
12 | public class DateUtil {
13 |
14 | /**
15 | * 在日期上增加或减少小时数、分钟数、秒数
16 | *
17 | * @param date 日期
18 | * @param iHour 要增加或减少的小时数
19 | * @param iMinute 要增加或减少的分钟数
20 | * @param iSecond 要增加或减少的秒数
21 | */
22 | public static Date updateDate(Date date, int iHour, int iMinute, int iSecond) {
23 |
24 | Calendar c = Calendar.getInstance();
25 |
26 | c.setTime(date);
27 | c.add(Calendar.HOUR_OF_DAY, iHour); // 小时
28 | c.add(Calendar.MINUTE, iMinute); // 分钟
29 | c.add(Calendar.SECOND, iSecond); // 秒
30 |
31 | return c.getTime();
32 |
33 | }
34 |
35 | /**
36 | * 获取日期的[年月日时分秒]
37 | *
38 | * @param date 日期
39 | * @return 年月日时分秒
40 | */
41 | public static Map getDateMap(Date date) {
42 |
43 | Calendar c = Calendar.getInstance();
44 | c.setTime(date);
45 |
46 | Map map = new HashMap<>();
47 | map.put("year", c.get(Calendar.YEAR)); // 年
48 | map.put("month", c.get(Calendar.MONTH) + 1); // 月
49 | map.put("day", c.get(Calendar.DATE)); // 日
50 | map.put("hour", c.get(Calendar.HOUR_OF_DAY)); // 时
51 | map.put("minute", c.get(Calendar.MINUTE)); // 分
52 | map.put("second", c.get(Calendar.SECOND)); // 秒
53 |
54 | return map;
55 |
56 | }
57 |
58 | /**
59 | * 获取指定日期字符串
60 | *
61 | * @param date Date型日期
62 | * @param dateFormat 日期格式
63 | * @return String型日期
64 | */
65 | public static String getDateStr(Date date, String dateFormat) {
66 |
67 | String dateStr;
68 | SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
69 | sdf.setTimeZone(TimeZone.getTimeZone("GMT+8"));
70 | dateStr = sdf.format(date);
71 | return dateStr;
72 |
73 | }
74 |
75 | /**
76 | * 计算两个日期的时间间隔
77 | *
78 | * @param startDate 开始日期
79 | * @param endDate 结束日期
80 | * @return 时间间隔
81 | */
82 | public static Map dateInterval(String startDate, String endDate) {
83 |
84 | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
85 | LocalDateTime sDate = LocalDateTime.parse(startDate, formatter); // 开始日期
86 | LocalDateTime eDate = LocalDateTime.parse(endDate, formatter); // 结束日期
87 |
88 | Long days = ChronoUnit.DAYS.between(sDate, eDate);
89 | Long hours = ChronoUnit.HOURS.between(sDate, eDate) % 24;
90 | Long minutes = ChronoUnit.MINUTES.between(sDate, eDate) % 60;
91 | Long seconds = ChronoUnit.SECONDS.between(sDate, eDate) % 60;
92 |
93 | Map map = new HashMap<>();
94 | map.put("days", days); // 相差天数
95 | map.put("hours", hours); // 相差小时数
96 | map.put("minutes", minutes); // 相差分钟数
97 | map.put("seconds", seconds); // 相差秒数
98 |
99 | return map;
100 |
101 | }
102 |
103 |
104 | }
105 |
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/dto/common/GetRecordIdParameter.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.dto.common;
2 |
3 | import jakarta.validation.constraints.Min;
4 | import lombok.Data;
5 |
6 | @Data
7 | public class GetRecordIdParameter {
8 | @Min(value=1, message="每页数量仅能大于1")
9 | private int pageSize = 1000;
10 |
11 | @Min(value=1, message="页码仅能大于1")
12 | private int pageNumber = 1;
13 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/dto/common/GetRecordParameter.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.dto.common;
2 |
3 | import jakarta.validation.constraints.NotEmpty;
4 | import lombok.Data;
5 |
6 | @Data
7 | public class GetRecordParameter {
8 | @NotEmpty(message="ID不能为空")
9 | private String id;
10 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/dto/tool/bazi/BaZiArrangeParameter.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.dto.tool.bazi;
2 |
3 | import jakarta.validation.constraints.NotNull;
4 | import jakarta.validation.constraints.NotEmpty;
5 |
6 | import lombok.Data;
7 |
8 | @Data
9 | public class BaZiArrangeParameter {
10 | @NotNull(message="年不能为空")
11 | private Integer year;
12 |
13 | @NotNull(message="月不能为空")
14 | private Integer month;
15 |
16 | @NotNull(message="日不能为空")
17 | private Integer day;
18 |
19 | @NotNull(message="时不能为空")
20 | private Integer hour;
21 |
22 | @NotNull(message="分不能为空")
23 | private Integer minute;
24 |
25 | @NotEmpty(message="性别不能为空")
26 | private String gender;
27 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/dto/tool/bazi/BaZiSolveParameter.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.dto.tool.bazi;
2 |
3 | import jakarta.validation.constraints.NotEmpty;
4 | import jakarta.validation.constraints.NotNull;
5 |
6 | import lombok.Data;
7 |
8 | @Data
9 | public class BaZiSolveParameter {
10 | @NotEmpty(message="性别不能为空")
11 | private String gender;
12 |
13 | @NotEmpty(message="八字不能为空")
14 | private String bazi;
15 |
16 | @NotNull(message="大运不能为空")
17 | private String dayun;
18 |
19 | @NotNull(message="流年不能为空")
20 | private String liunian;
21 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/dto/tool/liuyao/LiuYaoArrangeParameter.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.dto.tool.liuyao;
2 |
3 | import jakarta.validation.constraints.NotEmpty;
4 | import java.util.List;
5 |
6 | import lombok.Data;
7 |
8 | /**
9 | * @author Coaixy
10 | * @createTime 2024-11-27
11 | * @packageName fun.diviner.dto.tool.liuyao
12 | **/
13 |
14 | @Data
15 | public class LiuYaoArrangeParameter {
16 | @NotEmpty(message="数据不能为空")
17 | private List data;
18 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/dto/tool/meihua/MeiHuaArrangeParameter.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.dto.tool.meihua;
2 |
3 | import jakarta.validation.constraints.NotEmpty;
4 | import jakarta.validation.constraints.Max;
5 | import jakarta.validation.constraints.Min;
6 |
7 | import lombok.Data;
8 |
9 | /**
10 | * @author Coaixy
11 | * @createTime 2024-11-20
12 | * @packageName fun.diviner.dto.tool.meihua
13 | **/
14 |
15 | @Data
16 | public class MeiHuaArrangeParameter {
17 | @NotEmpty(message="类型不能为空")
18 | private String type;
19 |
20 | @Min(value=10, message="数字仅能为10~2147483647的整数")
21 | @Max(value=2147483647, message="数字仅能为10~2147483647的整数")
22 | private int number;
23 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/dto/tool/meihua/MeiHuaSolveParameter.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.dto.tool.meihua;
2 |
3 | import jakarta.validation.constraints.NotNull;
4 | import jakarta.validation.constraints.NotEmpty;
5 |
6 | import lombok.Data;
7 |
8 | import fun.diviner.aidiviner.diviner.type.MeiHuaArrangeResponse;
9 |
10 | /**
11 | * @author Coaixy
12 | * @createTime 2024-11-22
13 | * @packageName fun.diviner.dto.tool.meihua
14 | **/
15 |
16 | @Data
17 | public class MeiHuaSolveParameter {
18 | @NotNull(message="卦局不能为空")
19 | MeiHuaArrangeResponse arrangeResponse;
20 |
21 | @NotEmpty(message="问题不能为空")
22 | String question;
23 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/dto/tool/tarot/TarotCommonParameter.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.dto.tool.tarot;
2 |
3 | import jakarta.validation.constraints.NotEmpty;
4 |
5 | import lombok.Data;
6 |
7 | @Data
8 | public class TarotCommonParameter {
9 | @NotEmpty(message="问题不能为空")
10 | private String question;
11 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/dto/tool/tarot/TarotSelectParameter.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.dto.tool.tarot;
2 |
3 | import jakarta.validation.constraints.NotEmpty;
4 | import java.util.List;
5 |
6 | import lombok.Data;
7 |
8 | @Data
9 | public class TarotSelectParameter {
10 | @NotEmpty(message="牌阵不能为空")
11 | private String spreadName;
12 |
13 | @NotEmpty(message="牌不能为空")
14 | private List cardIndexList;
15 |
16 | @NotEmpty(message="问题不能为空")
17 | private String question;
18 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/dto/tool/xiaoliuren/XiaoLiuRenSolveParameter.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.dto.tool.xiaoliuren;
2 |
3 | import jakarta.validation.constraints.NotEmpty;
4 | import jakarta.validation.constraints.Size;
5 | import java.util.List;
6 |
7 | import lombok.Data;
8 |
9 | /**
10 | * @author Coaixy
11 | * @createTime 2024-12-02
12 | * @packageName fun.diviner.dto.tool.xiaoliu
13 | **/
14 |
15 | @Data
16 | public class XiaoLiuRenSolveParameter {
17 | @NotEmpty(message = "问题不能为空")
18 | private String question;
19 |
20 | @NotEmpty(message = "神不能为空")
21 | @Size(min=3, max=3, message="神的长度仅能为3")
22 | private List liushen;
23 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/dto/user/GetRechargeParameter.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.dto.user;
2 |
3 | import jakarta.validation.constraints.Min;
4 |
5 | import lombok.Data;
6 |
7 | @Data
8 | public class GetRechargeParameter {
9 | @Min(value=1, message="每页数量仅能大于1")
10 | private int pageSize = 30;
11 |
12 | @Min(value=1, message="页码仅能大于1")
13 | private int pageNumber = 1;
14 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/dto/user/GetRecordParameter.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.dto.user;
2 |
3 | import jakarta.validation.constraints.NotNull;
4 | import jakarta.validation.constraints.Min;
5 |
6 | import lombok.Data;
7 |
8 | @Data
9 | public class GetRecordParameter {
10 | @NotNull(message="工具ID不能为空")
11 | private Integer toolId;
12 |
13 | @Min(value=1, message="每页数量仅能大于1")
14 | private int pageSize = 30;
15 |
16 | @Min(value=1, message="页码仅能大于1")
17 | private int pageNumber = 1;
18 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/dto/user/ModifyAccountParameter.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.dto.user;
2 |
3 | import jakarta.validation.constraints.Pattern;
4 |
5 | import lombok.Data;
6 |
7 | @Data
8 | public class ModifyAccountParameter {
9 | @Pattern(regexp="[A-Za-z0-9]{5,15}$", message="密码仅能为5~15长度的数字和字母")
10 | private String password;
11 |
12 | public void setPassword(String password) {
13 | this.password = password.isEmpty() ? null : password;
14 | }
15 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/dto/user/OpenVIPParameter.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.dto.user;
2 |
3 | import jakarta.validation.constraints.NotNull;
4 |
5 | import lombok.Data;
6 |
7 | @Data
8 | public class OpenVIPParameter {
9 | @NotNull(message="ID不能为空")
10 | private Integer id;
11 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/dto/user/RechargeParameter.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.dto.user;
2 |
3 | import jakarta.validation.constraints.NotNull;
4 | import jakarta.validation.constraints.Min;
5 | import jakarta.validation.constraints.Max;
6 | import jakarta.validation.constraints.NotEmpty;
7 | import jakarta.validation.constraints.Pattern;
8 |
9 | import lombok.Data;
10 |
11 | import fun.diviner.aidiviner.entity.Special;
12 |
13 | @Data
14 | public class RechargeParameter {
15 | @NotNull(message="积分不能为空")
16 | @Min(value=Special.moneyPointProportion, message="积分仅能为" + Special.moneyPointProportion + "~" + 1000 * Special.moneyPointProportion + "的整数")
17 | @Max(value=1000 * Special.moneyPointProportion, message="积分仅能为" + Special.moneyPointProportion + "~" + 1000 * Special.moneyPointProportion + "的整数")
18 | private Integer point;
19 |
20 | @NotEmpty(message="类型不能为空")
21 | @Pattern(regexp="ali|wechat", message="类型仅能为ali,wechat,ali代表支付宝,wechat代表微信")
22 | private String type;
23 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/dto/user/RegisterLoginParameter.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.dto.user;
2 |
3 | import jakarta.validation.constraints.NotEmpty;
4 | import jakarta.validation.constraints.Pattern;
5 |
6 | import lombok.Data;
7 |
8 | @Data
9 | public class RegisterLoginParameter {
10 | @NotEmpty(message="手机号不能为空")
11 | @Pattern(regexp="^1[3-9]\\d{9}$", message="手机号仅能为中国大陆的手机号")
12 | private String phoneNumber;
13 |
14 | @NotEmpty(message="密码不能为空")
15 | @Pattern(regexp="[A-Za-z0-9]{5,15}$", message="密码仅能为5~15长度的数字和字母")
16 | private String password;
17 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/dto/user/UseCardParameter.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.dto.user;
2 |
3 | import jakarta.validation.constraints.NotEmpty;
4 |
5 | import lombok.Data;
6 |
7 | @Data
8 | public class UseCardParameter {
9 | @NotEmpty(message="码不能为空")
10 | private String code;
11 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/entity/Auth.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.entity;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class Auth {
7 | private int id;
8 | private String token;
9 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/entity/Pay.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.entity;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class Pay {
7 | private PayType type;
8 | private int reward;
9 | private int recharge;
10 | private boolean state;
11 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/entity/PayType.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.entity;
2 |
3 | public enum PayType {
4 | FREE,
5 | RECHARGE_BALANCE,
6 | BALANCE
7 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/entity/Special.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.entity;
2 |
3 | public class Special {
4 | public static String authSecret = "AI-Diviner-Backend-Backend-Backend-1739116315";
5 | public static class AttributeName {
6 | public static String user = "user";
7 | public static String trade = "trade";
8 | }
9 | public static class RedisSurvivalTime {
10 | public static int captcha = 30;
11 | public static int accessToken = 7;
12 | }
13 | public static int commonGroupId = 1;
14 | public static class CoreName {
15 | public static String openTool = "openTool";
16 | public static String yiPayId = "yiPayId";
17 | public static String yiPayMerchantPrivateKey = "yiPayMerchantPrivateKey";
18 | public static String yiPayNoticeUrlPrefix = "yiPayNoticeUrlPrefix";
19 | public static String yiPayReturnUrl = "yiPayReturnUrl";
20 | public static String yiPayPlatformPublicKey = "yiPayPlatformPublicKey";
21 | }
22 | public static final int moneyPointProportion = 10;
23 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/entity/Trade.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.entity;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class Trade {
7 | private int id;
8 | private Pay pay;
9 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/entity/database/Card.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.entity.database;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class Card {
7 | private int id;
8 | private String code;
9 | private int point;
10 | private int number;
11 | private int count;
12 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/entity/database/CardRecord.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.entity.database;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class CardRecord {
7 | private int cardId;
8 | private int userId;
9 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/entity/database/Core.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.entity.database;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class Core {
7 | private String name;
8 | private String content;
9 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/entity/database/Group.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.entity.database;
2 |
3 | import com.baomidou.mybatisplus.annotation.TableName;
4 | import lombok.Data;
5 |
6 | @TableName("user_group")
7 | @Data
8 | public class Group {
9 | private int id;
10 | private String name;
11 | private int checkInPoint;
12 | private int price;
13 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/entity/database/Recharge.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.entity.database;
2 |
3 | import java.math.BigDecimal;
4 | import java.time.LocalDateTime;
5 |
6 | import lombok.Data;
7 | import com.baomidou.mybatisplus.annotation.TableField;
8 | import com.baomidou.mybatisplus.annotation.FieldStrategy;
9 |
10 | @Data
11 | public class Recharge {
12 | private String id;
13 | private int point;
14 | private BigDecimal money;
15 | private String url;
16 |
17 | @TableField(insertStrategy=FieldStrategy.NEVER)
18 | private boolean state;
19 |
20 | @TableField(insertStrategy=FieldStrategy.NEVER)
21 | private LocalDateTime creationTime;
22 |
23 | @TableField(insertStrategy=FieldStrategy.NEVER)
24 | private LocalDateTime paymentTime;
25 |
26 | private int userId;
27 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/entity/database/Record.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.entity.database;
2 |
3 | import java.time.LocalDateTime;
4 |
5 | import lombok.Data;
6 | import com.baomidou.mybatisplus.annotation.TableField;
7 | import com.baomidou.mybatisplus.annotation.FieldStrategy;
8 |
9 | @Data
10 | public class Record {
11 | private String id;
12 | private int toolId;
13 | private String request;
14 | private String response;
15 |
16 | @TableField(value="time_", insertStrategy=FieldStrategy.NEVER)
17 | private LocalDateTime time;
18 |
19 | private int userId;
20 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/entity/database/Tool.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.entity.database;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class Tool {
7 | private int id;
8 | private String name;
9 | private String alias;
10 | private int price;
11 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/entity/database/ToolTarotCard.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.entity.database;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class ToolTarotCard {
7 | private int id;
8 | private String name;
9 | private String description;
10 | private String normal;
11 | private String reversed;
12 | private String detail;
13 | private String link;
14 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/entity/database/ToolTarotSpread.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.entity.database;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class ToolTarotSpread {
7 | private int id;
8 | private String name;
9 | private String description;
10 | private String card;
11 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/entity/database/User.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.entity.database;
2 |
3 | import java.time.LocalDateTime;
4 |
5 | import com.baomidou.mybatisplus.annotation.*;
6 | import lombok.Data;
7 |
8 | @Data
9 | public class User {
10 | @TableId(type=IdType.AUTO)
11 | private int id;
12 |
13 | private String phoneNumber;
14 | private String password;
15 |
16 | @TableField(insertStrategy=FieldStrategy.NEVER)
17 | private int rewardBalance;
18 |
19 | @TableField(insertStrategy=FieldStrategy.NEVER)
20 | private int rechargeBalance;
21 |
22 | @TableField(insertStrategy=FieldStrategy.NEVER)
23 | private boolean checkIn;
24 |
25 | @TableField(insertStrategy=FieldStrategy.NEVER)
26 | private int groupId;
27 |
28 | @TableField(insertStrategy=FieldStrategy.NEVER)
29 | private LocalDateTime groupExpirationTime;
30 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/mapper/CardMapper.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.mapper;
2 |
3 | import org.springframework.stereotype.Repository;
4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 |
6 | import fun.diviner.aidiviner.entity.database.Card;
7 |
8 | @Repository
9 | public interface CardMapper extends BaseMapper {
10 |
11 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/mapper/CardRecordMapper.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.mapper;
2 |
3 | import org.springframework.stereotype.Repository;
4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 |
6 | import fun.diviner.aidiviner.entity.database.CardRecord;
7 |
8 | @Repository
9 | public interface CardRecordMapper extends BaseMapper {
10 |
11 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/mapper/CoreMapper.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.mapper;
2 |
3 | import org.springframework.stereotype.Repository;
4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 |
6 | import fun.diviner.aidiviner.entity.database.Core;
7 |
8 | @Repository
9 | public interface CoreMapper extends BaseMapper {
10 |
11 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/mapper/GroupMapper.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.mapper;
2 |
3 | import org.springframework.stereotype.Repository;
4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 |
6 | import fun.diviner.aidiviner.entity.database.Group;
7 |
8 | @Repository
9 | public interface GroupMapper extends BaseMapper {
10 |
11 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/mapper/RechargeMapper.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.mapper;
2 |
3 | import org.springframework.stereotype.Repository;
4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 |
6 | import fun.diviner.aidiviner.entity.database.Recharge;
7 |
8 | @Repository
9 | public interface RechargeMapper extends BaseMapper {
10 |
11 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/mapper/RecordMapper.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.mapper;
2 |
3 | import org.springframework.stereotype.Repository;
4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 |
6 | import fun.diviner.aidiviner.entity.database.Record;
7 |
8 | @Repository
9 | public interface RecordMapper extends BaseMapper {
10 |
11 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/mapper/ToolMapper.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.mapper;
2 |
3 | import org.springframework.stereotype.Repository;
4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 |
6 | import fun.diviner.aidiviner.entity.database.Tool;
7 |
8 | @Repository
9 | public interface ToolMapper extends BaseMapper {
10 |
11 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/mapper/ToolTarotCardMapper.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.mapper;
2 |
3 | import org.springframework.stereotype.Repository;
4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 |
6 | import fun.diviner.aidiviner.entity.database.ToolTarotCard;
7 |
8 | @Repository
9 | public interface ToolTarotCardMapper extends BaseMapper {
10 |
11 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/mapper/ToolTarotSpreadMapper.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.mapper;
2 |
3 | import org.springframework.stereotype.Repository;
4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 |
6 | import fun.diviner.aidiviner.entity.database.ToolTarotSpread;
7 |
8 | @Repository
9 | public interface ToolTarotSpreadMapper extends BaseMapper {
10 |
11 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/mapper/UserMapper.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.mapper;
2 |
3 | import org.springframework.stereotype.Repository;
4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 |
6 | import fun.diviner.aidiviner.entity.database.User;
7 |
8 | @Repository
9 | public interface UserMapper extends BaseMapper {
10 |
11 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/redis/AccessTokenRedis.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.redis;
2 |
3 | import java.util.concurrent.TimeUnit;
4 | import java.util.Set;
5 |
6 | import org.springframework.stereotype.Component;
7 | import org.springframework.beans.factory.annotation.Autowired;
8 | import org.springframework.beans.factory.annotation.Qualifier;
9 | import org.springframework.data.redis.core.RedisTemplate;
10 |
11 | import fun.diviner.aidiviner.entity.Special;
12 |
13 | @Component
14 | public class AccessTokenRedis {
15 | @Autowired
16 | @Qualifier("accessTokenRedisBean")
17 | private RedisTemplate template;
18 |
19 | public void set(int id, String token) {
20 | this.template.opsForValue().set(id + ":" + token, id, Special.RedisSurvivalTime.accessToken, TimeUnit.DAYS);
21 | }
22 |
23 | private String getKey(String token) {
24 | Set keys = this.template.keys("*:" + token);
25 | if (keys.isEmpty()) {
26 | return null;
27 | }
28 | return keys.iterator().next();
29 | }
30 |
31 | public Integer get(String token) {
32 | String key = this.getKey(token);
33 | if (key == null) {
34 | return null;
35 | }
36 | return this.template.opsForValue().get(key);
37 | }
38 |
39 | public boolean delete(String token) {
40 | String key = this.getKey(token);
41 | if (key == null) {
42 | return false;
43 | }
44 | return this.template.delete(key);
45 | }
46 |
47 | public void delete(int id) {
48 | Set keys = this.template.keys(id + ":*");
49 | if (keys.isEmpty()) {
50 | return;
51 | }
52 | this.template.delete(keys);
53 | }
54 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/redis/CaptchaRedis.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.redis;
2 |
3 | import java.util.concurrent.TimeUnit;
4 |
5 | import org.springframework.stereotype.Component;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.beans.factory.annotation.Qualifier;
8 | import org.springframework.data.redis.core.RedisTemplate;
9 |
10 | import fun.diviner.aidiviner.entity.Special;
11 |
12 | @Component
13 | public class CaptchaRedis {
14 | @Autowired
15 | @Qualifier("captchaRedisBean")
16 | private RedisTemplate template;
17 |
18 | public void set(String key, String code) {
19 | this.template.opsForValue().set(key, code, Special.RedisSurvivalTime.captcha, TimeUnit.MINUTES);
20 | }
21 |
22 | public String get(String key) {
23 | return this.template.opsForValue().get(key);
24 | }
25 |
26 | public boolean delete(String key) {
27 | return this.template.delete(key);
28 | }
29 | }
--------------------------------------------------------------------------------
/src/main/java/fun/diviner/aidiviner/service/CommonService.java:
--------------------------------------------------------------------------------
1 | package fun.diviner.aidiviner.service;
2 |
3 | import java.util.UUID;
4 | import java.util.Map;
5 | import java.util.List;
6 | import java.time.LocalDateTime;
7 |
8 | import org.springframework.stereotype.Service;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import cn.hutool.captcha.ShearCaptcha;
11 | import cn.hutool.captcha.CaptchaUtil;
12 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
13 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
14 |
15 | import fun.diviner.aidiviner.redis.CaptchaRedis;
16 | import fun.diviner.aidiviner.mapper.ToolMapper;
17 | import fun.diviner.aidiviner.mapper.GroupMapper;
18 | import fun.diviner.aidiviner.mapper.RechargeMapper;
19 | import fun.diviner.aidiviner.mapper.UserMapper;
20 | import fun.diviner.aidiviner.mapper.RecordMapper;
21 | import fun.diviner.aidiviner.util.response.GenerateResponse;
22 | import fun.diviner.aidiviner.util.response.ExceptionResponse;
23 | import fun.diviner.aidiviner.util.response.ExceptionResponseCode;
24 | import fun.diviner.aidiviner.util.Auxiliary;
25 | import fun.diviner.aidiviner.util.yi_pay.YiPay;
26 | import fun.diviner.aidiviner.entity.database.Tool;
27 | import fun.diviner.aidiviner.entity.database.Group;
28 | import fun.diviner.aidiviner.entity.database.Recharge;
29 | import fun.diviner.aidiviner.entity.database.User;
30 | import fun.diviner.aidiviner.entity.database.Record;
31 | import fun.diviner.aidiviner.entity.Special;
32 | import fun.diviner.aidiviner.dto.common.GetRecordIdParameter;
33 | import fun.diviner.aidiviner.dto.common.GetRecordParameter;
34 |
35 | @Service
36 | public class CommonService {
37 | @Autowired
38 | private CaptchaRedis captcha;
39 | @Autowired
40 | private ToolMapper tool;
41 | @Autowired
42 | private GroupMapper group;
43 | @Autowired
44 | private UtilService util;
45 | @Autowired
46 | private RechargeMapper recharge;
47 | @Autowired
48 | private UserMapper user;
49 | @Autowired
50 | private RecordMapper record;
51 |
52 | public GenerateResponse