功能调试接口

master_dev
grimm 2024-05-14 10:51:24 +08:00
parent 4da48e9d63
commit 9b68a313c1
3 changed files with 55 additions and 10 deletions

View File

@ -127,6 +127,20 @@ public class RedisUtil {
}
}
/**
*
*
* @param key
* @param time ()
*/
public void expireMillsDel(String key, long time) {
try {
redisTemplate.expire(key, time, TimeUnit.MILLISECONDS);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* key

View File

@ -0,0 +1,41 @@
package com.ljsd.jieling.util;
import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.logic.arena.LuofuLogic;
import java.io.IOException;
public class SystemTimeUpdateTest {
public static void main(String[] args) throws InterruptedException, IOException {
// 修改系统时间
updateTime("2019-05-13 13:45:00");
// redis 过期修改
String key = LuofuLogic.getLuofuRobotKey(1);
RedisUtil.getInstence().expireMills(key, LuofuLogic.calNextInitRankTime());
}
/**
*
* @param time 2024-05-13 13:45:00
*/
private static void updateTime(String time) throws IOException, InterruptedException {
String[] strings = time.split(" ");
// 设定要修改的时间
String newDate = strings[0];
String newTime = strings[1];
// 构建修改时间的命令
String setDateCommand = "cmd /c date " + newDate;
String setTimeCommand = "cmd /c time " + newTime;
// 执行命令
Process setTimeProcess = Runtime.getRuntime().exec(setTimeCommand);
Process setDateProcess = Runtime.getRuntime().exec(setDateCommand);
// 等待命令执行完成
setTimeProcess.waitFor();
setDateProcess.waitFor();
System.out.println("时间修改成功");
}
}

View File

@ -1,10 +0,0 @@
package com.ljsd.jieling.util;
import java.text.MessageFormat;
public class Test {
public static void main(String[] args) {
String format = MessageFormat.format("目标层数不存在,类型:{0},当前层数:{1},要挑战层数:{2}uid{3}", 1111, 123123, 23123, 32523523);
System.out.println(format);
}
}