2025-09-15 15:48:54 +08:00
|
|
|
package com.cdzy.operations;
|
2025-09-15 10:36:01 +08:00
|
|
|
|
2025-11-24 16:02:55 +08:00
|
|
|
import com.cdzy.operations.utils.RedisUtil;
|
|
|
|
|
import com.mybatisflex.core.keygen.impl.SnowFlakeIDKeyGenerator;
|
|
|
|
|
import jakarta.annotation.Resource;
|
2025-09-15 10:36:01 +08:00
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
|
|
2025-11-24 16:02:55 +08:00
|
|
|
import java.util.concurrent.TimeUnit;
|
2025-11-17 16:00:56 +08:00
|
|
|
|
2025-09-15 10:36:01 +08:00
|
|
|
@SpringBootTest
|
|
|
|
|
class EbikeOperationsApplicationTests {
|
|
|
|
|
|
2025-11-24 16:02:55 +08:00
|
|
|
@Resource
|
|
|
|
|
RedisUtil redisUtil;
|
|
|
|
|
|
2025-10-15 10:47:08 +08:00
|
|
|
|
2025-09-15 10:36:01 +08:00
|
|
|
@Test
|
2025-11-27 15:22:19 +08:00
|
|
|
void contextLoads(){
|
2025-11-24 16:02:55 +08:00
|
|
|
SnowFlakeIDKeyGenerator generator = new SnowFlakeIDKeyGenerator();
|
|
|
|
|
long nextId = generator.nextId();
|
2025-11-27 15:22:19 +08:00
|
|
|
redisUtil.saveDispatchOrder(nextId, "2", 5L, TimeUnit.MINUTES);
|
2025-11-27 10:01:53 +08:00
|
|
|
System.out.println(nextId);
|
|
|
|
|
}
|
2025-11-24 16:02:55 +08:00
|
|
|
|
2025-11-27 10:01:53 +08:00
|
|
|
@Test
|
2025-11-27 15:22:19 +08:00
|
|
|
void deleteDispatchOrder(){
|
2025-11-27 10:01:53 +08:00
|
|
|
redisUtil.deleteDispatchOrder(351467314753310720L);
|
2025-09-15 10:36:01 +08:00
|
|
|
}
|
|
|
|
|
|
2025-11-24 16:02:55 +08:00
|
|
|
|
2025-09-15 10:36:01 +08:00
|
|
|
}
|