build: 移除配置文件并清理MCP服务设置
This commit is contained in:
@@ -1,6 +0,0 @@
|
|||||||
1、执行任务的时候,首先分析任务,然后将该任务分成多个可执行的小任务,一步一步执行。
|
|
||||||
2、不要启动我项目的服务
|
|
||||||
3、若是新建项目或者开发新的功能,首先使用context7 MCP服务来寻找对应的文档
|
|
||||||
4、若是修改业务逻辑等,就不要使用context7 MCP服务来寻找对应的文档,先查看查看前端该功能对应的后端接口,查看后端接口的逻辑,若是已经实现就返回前端处理逻辑,若是后端还们没有实现,则先处理后端在处理前端。
|
|
||||||
5、若是apply_diff失败或者文件修改编辑失败,就要先保存该文件然后重新读取在做修改再来apply_diff
|
|
||||||
6、使用filesystem MCP服务
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"mcpServers": {
|
|
||||||
"sequentialthinking": {
|
|
||||||
"command": "npx",
|
|
||||||
"args": [
|
|
||||||
"-y",
|
|
||||||
"@modelcontextprotocol/server-sequential-thinking"
|
|
||||||
],
|
|
||||||
"alwaysAllow": [
|
|
||||||
"sequentialthinking"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,267 @@
|
|||||||
|
package com.test.bijihoudaun.util;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间工具类
|
||||||
|
* 提供常用的时间操作方法
|
||||||
|
*
|
||||||
|
* @author CodeGeeX
|
||||||
|
* @since 2024
|
||||||
|
*/
|
||||||
|
public class DateTimeUtil {
|
||||||
|
|
||||||
|
// 常用的时间格式
|
||||||
|
public static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||||
|
public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
|
||||||
|
public static final String DEFAULT_TIME_FORMAT = "HH:mm:ss";
|
||||||
|
public static final String COMPACT_DATETIME_FORMAT = "yyyyMMddHHmmss";
|
||||||
|
public static final String COMPACT_DATE_FORMAT = "yyyyMMdd";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前时间(LocalDateTime)
|
||||||
|
*
|
||||||
|
* @return 当前时间
|
||||||
|
*/
|
||||||
|
public static LocalDateTime getCurrentDateTime() {
|
||||||
|
return LocalDateTime.now();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前日期(LocalDate)
|
||||||
|
*
|
||||||
|
* @return 当前日期
|
||||||
|
*/
|
||||||
|
public static LocalDate getCurrentDate() {
|
||||||
|
return LocalDate.now();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前时间戳(毫秒)
|
||||||
|
*
|
||||||
|
* @return 当前时间戳
|
||||||
|
*/
|
||||||
|
public static long getCurrentTimestamp() {
|
||||||
|
return System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前时间戳(秒)
|
||||||
|
*
|
||||||
|
* @return 当前时间戳(秒)
|
||||||
|
*/
|
||||||
|
public static long getCurrentTimestampSeconds() {
|
||||||
|
return System.currentTimeMillis() / 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字符串转LocalDateTime
|
||||||
|
* 使用默认格式:yyyy-MM-dd HH:mm:ss
|
||||||
|
*
|
||||||
|
* @param dateTimeStr 时间字符串
|
||||||
|
* @return LocalDateTime对象
|
||||||
|
*/
|
||||||
|
public static LocalDateTime stringToDateTime(String dateTimeStr) {
|
||||||
|
return stringToDateTime(dateTimeStr, DEFAULT_DATETIME_FORMAT);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字符串转LocalDateTime
|
||||||
|
*
|
||||||
|
* @param dateTimeStr 时间字符串
|
||||||
|
* @param pattern 时间格式
|
||||||
|
* @return LocalDateTime对象
|
||||||
|
*/
|
||||||
|
public static LocalDateTime stringToDateTime(String dateTimeStr, String pattern) {
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
|
||||||
|
return LocalDateTime.parse(dateTimeStr, formatter);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字符串转LocalDate
|
||||||
|
* 使用默认格式:yyyy-MM-dd
|
||||||
|
*
|
||||||
|
* @param dateStr 日期字符串
|
||||||
|
* @return LocalDate对象
|
||||||
|
*/
|
||||||
|
public static LocalDate stringToDate(String dateStr) {
|
||||||
|
return stringToDate(dateStr, DEFAULT_DATE_FORMAT);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字符串转LocalDate
|
||||||
|
*
|
||||||
|
* @param dateStr 日期字符串
|
||||||
|
* @param pattern 日期格式
|
||||||
|
* @return LocalDate对象
|
||||||
|
*/
|
||||||
|
public static LocalDate stringToDate(String dateStr, String pattern) {
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
|
||||||
|
return LocalDate.parse(dateStr, formatter);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LocalDateTime转字符串
|
||||||
|
* 使用默认格式:yyyy-MM-dd HH:mm:ss
|
||||||
|
*
|
||||||
|
* @param dateTime LocalDateTime对象
|
||||||
|
* @return 时间字符串
|
||||||
|
*/
|
||||||
|
public static String dateTimeToString(LocalDateTime dateTime) {
|
||||||
|
return dateTimeToString(dateTime, DEFAULT_DATETIME_FORMAT);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LocalDateTime转字符串
|
||||||
|
*
|
||||||
|
* @param dateTime LocalDateTime对象
|
||||||
|
* @param pattern 时间格式
|
||||||
|
* @return 时间字符串
|
||||||
|
*/
|
||||||
|
public static String dateTimeToString(LocalDateTime dateTime, String pattern) {
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
|
||||||
|
return dateTime.format(formatter);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LocalDate转字符串
|
||||||
|
* 使用默认格式:yyyy-MM-dd
|
||||||
|
*
|
||||||
|
* @param date LocalDate对象
|
||||||
|
* @return 日期字符串
|
||||||
|
*/
|
||||||
|
public static String dateToString(LocalDate date) {
|
||||||
|
return dateToString(date, DEFAULT_DATE_FORMAT);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LocalDate转字符串
|
||||||
|
*
|
||||||
|
* @param date LocalDate对象
|
||||||
|
* @param pattern 日期格式
|
||||||
|
* @return 日期字符串
|
||||||
|
*/
|
||||||
|
public static String dateToString(LocalDate date, String pattern) {
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
|
||||||
|
return date.format(formatter);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间戳转LocalDateTime
|
||||||
|
*
|
||||||
|
* @param timestamp 时间戳(毫秒)
|
||||||
|
* @return LocalDateTime对象
|
||||||
|
*/
|
||||||
|
public static LocalDateTime timestampToDateTime(long timestamp) {
|
||||||
|
return LocalDateTime.ofInstant(Instant.ofEpochMilli(timestamp), ZoneId.systemDefault());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LocalDateTime转时间戳
|
||||||
|
*
|
||||||
|
* @param dateTime LocalDateTime对象
|
||||||
|
* @return 时间戳(毫秒)
|
||||||
|
*/
|
||||||
|
public static long dateTimeToTimestamp(LocalDateTime dateTime) {
|
||||||
|
return dateTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Date转LocalDateTime
|
||||||
|
*
|
||||||
|
* @param date Date对象
|
||||||
|
* @return LocalDateTime对象
|
||||||
|
*/
|
||||||
|
public static LocalDateTime dateToDateTime(Date date) {
|
||||||
|
return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LocalDateTime转Date
|
||||||
|
*
|
||||||
|
* @param dateTime LocalDateTime对象
|
||||||
|
* @return Date对象
|
||||||
|
*/
|
||||||
|
public static Date dateTimeToDate(LocalDateTime dateTime) {
|
||||||
|
return Date.from(dateTime.atZone(ZoneId.systemDefault()).toInstant());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前时间的字符串表示
|
||||||
|
* 使用默认格式:yyyy-MM-dd HH:mm:ss
|
||||||
|
*
|
||||||
|
* @return 当前时间字符串
|
||||||
|
*/
|
||||||
|
public static String getCurrentDateTimeString() {
|
||||||
|
return dateTimeToString(getCurrentDateTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前时间的字符串表示
|
||||||
|
*
|
||||||
|
* @param pattern 时间格式
|
||||||
|
* @return 当前时间字符串
|
||||||
|
*/
|
||||||
|
public static String getCurrentDateTimeString(String pattern) {
|
||||||
|
return dateTimeToString(getCurrentDateTime(), pattern);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前日期的字符串表示
|
||||||
|
* 使用默认格式:yyyy-MM-dd
|
||||||
|
*
|
||||||
|
* @return 当前日期字符串
|
||||||
|
*/
|
||||||
|
public static String getCurrentDateString() {
|
||||||
|
return dateToString(getCurrentDate());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前日期的字符串表示
|
||||||
|
*
|
||||||
|
* @param pattern 日期格式
|
||||||
|
* @return 当前日期字符串
|
||||||
|
*/
|
||||||
|
public static String getCurrentDateString(String pattern) {
|
||||||
|
return dateToString(getCurrentDate(), pattern);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查字符串是否为有效的日期时间格式
|
||||||
|
*
|
||||||
|
* @param dateTimeStr 日期时间字符串
|
||||||
|
* @param pattern 格式模式
|
||||||
|
* @return 是否有效
|
||||||
|
*/
|
||||||
|
public static boolean isValidDateTime(String dateTimeStr, String pattern) {
|
||||||
|
try {
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
|
||||||
|
LocalDateTime.parse(dateTimeStr, formatter);
|
||||||
|
return true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查字符串是否为有效的日期格式
|
||||||
|
*
|
||||||
|
* @param dateStr 日期字符串
|
||||||
|
* @param pattern 格式模式
|
||||||
|
* @return 是否有效
|
||||||
|
*/
|
||||||
|
public static boolean isValidDate(String dateStr, String pattern) {
|
||||||
|
try {
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
|
||||||
|
LocalDate.parse(dateStr, formatter);
|
||||||
|
return true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user