mirror of
https://github.com/luoye663/e5.git
synced 2026-03-13 01:21:42 +00:00
增加角色权限
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
package io.qyi.e5;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class E5ApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package io.qyi.e5.string;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @program: e5
|
||||
* @description:
|
||||
* @author: 落叶随风
|
||||
* @create: 2020-04-20 00:38
|
||||
**/
|
||||
public class MyThread implements Runnable {
|
||||
private Random random = null;
|
||||
|
||||
public MyThread() {
|
||||
random = new Random();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
System.out.println("任务执行开始:" + new Date());
|
||||
/**使用随机延时[0-3]秒来模拟执行任务*/
|
||||
int sleepNumber = random.nextInt(3);
|
||||
TimeUnit.SECONDS.sleep(2);
|
||||
System.out.println("任务执行完毕:" + new Date());
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
ScheduledThreadPoolExecutor service = new ScheduledThreadPoolExecutor(2);
|
||||
System.out.println("开始任务");
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
//延时3秒执行
|
||||
service.schedule(new MyThread(), 3, TimeUnit.SECONDS);
|
||||
}
|
||||
System.out.println("结束任务");
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package io.qyi.e5.string;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import lombok.SneakyThrows;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @program: e5
|
||||
* @description:
|
||||
* @author: 落叶随风
|
||||
* @create: 2020-03-05 17:09
|
||||
**/
|
||||
public class dome01 {
|
||||
|
||||
@Test
|
||||
public void test01() {
|
||||
String[] s = new String[]{"CompactToken validation", "Access token has expired.", "Access token validation failure"};
|
||||
String msg = "Access token has expired.";
|
||||
|
||||
System.out.println(s[1]);
|
||||
System.out.println(msg.indexOf(s[1]));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
JsonObject jsonObject = new Gson().fromJson("", JsonObject.class);
|
||||
JsonArray data = jsonObject.getAsJsonArray("data");
|
||||
for (JsonElement j : data) {
|
||||
int pid = j.getAsJsonObject().get("pid").getAsInt();
|
||||
}
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
JsonObject JsonObject = data.get(i).getAsJsonObject();
|
||||
JsonObject.get("pid").getAsInt();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void r(){
|
||||
for (int i = 0; i < 30; i++) {
|
||||
System.out.println(getRandom(3600,7200));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void ScheduledExecutor(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getRandom(int start, int end){
|
||||
Random r = new Random();
|
||||
String Expiration = String.valueOf((r.nextInt(end-start +1) + start) );
|
||||
return Expiration;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user