This commit is contained in:
777
2025-01-09 15:37:48 +08:00
parent 040df36cd6
commit cb0835b3bb
3 changed files with 100 additions and 1 deletions

View File

@@ -0,0 +1,70 @@
package com.ruoyi.test;
import cn.hutool.core.io.FileUtil;
import kotlin.collections.ArrayDeque;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
public class Main {
public static void main(String[] args) {
List<String> tables = new ArrayList<>();
tables.add("cai_user");
tables.add("cai_account");
tables.add("cai_account_bankcard");
tables.add("cai_account_cash");
tables.add("cai_account_detail");
tables.add("cai_account_recharge");
tables.add("cai_adolescent");
tables.add("cai_anchor_apply");
tables.add("cai_dynamic");
tables.add("cai_dynamic_images");
tables.add("cai_low_height_risk");
tables.add("cai_rank");
tables.add("cai_report");
tables.add("cai_sys_push");
tables.add("cai_union");
tables.add("cai_union_user");
tables.add("cai_user_album");
tables.add("cai_user_blacklist");
tables.add("cai_user_camera_audit");
tables.add("cai_user_count");
tables.add("cai_user_follow");
tables.add("cai_user_follow_dynamic");
tables.add("cai_user_greet");
tables.add("cai_user_info");
tables.add("cai_user_invite");
tables.add("cai_user_member");
tables.add("cai_user_online");
tables.add("cai_user_visitor");
String file = "C:\\Users\\鲨鱼\\Desktop\\123\\table.txt";
List<String> strings = FileUtil.readUtf8Lines(file);
for (String user : strings) {
List<String> sqls = new ArrayList<>();
for (String table : tables) {
String[] s = user.split("\t");
if(table.equals("cai_user")){
String str = String.format("update %s set id = '%s' where id = '%s';", table,s[1],s[0]);
sqls.add(str);
continue;
}
String str = String.format("update %s set user_id = '%s' where user_id = '%s';", table,s[1],s[0]);
sqls.add(str);
if(table.equals("cai_user_invite")){
str = String.format("update %s set invite_id = '%s' where invite_id = '%s';", table,s[1],s[0]);
sqls.add(str);
}
if(table.equals("cai_user_follow")){
str = String.format("update %s set follow_user = '%s' where follow_user = '%s';", table,s[1],s[0]);
sqls.add(str);
}
}
sqls.add(" ");
FileUtil.appendLines(sqls,"C:\\Users\\鲨鱼\\Desktop\\123\\updateUser.sql", StandardCharsets.UTF_8);
}
}
}

View File

@@ -0,0 +1,29 @@
package com.ruoyi.test;
import com.ruoyi.cai.util.RestTemplateUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
@Slf4j
public class Run {
public static void main(String[] args) {
String url = "https://admin.pan19.cn/prod-api/cai/op/im/refreshImByUser?usercode=";
RestTemplate restTemplate = RestTemplateUtil.getNoSSLRest();
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiJzeXNfdXNlcjoxIiwicm5TdHIiOiJqMTF6SWhJbG5ib3VCaUdGV3F1bzdiSlZqSVY0bzNiQSIsInVzZXJJZCI6MX0.pSfg8bLzWZxcPOOd3pZk8nS-93p7qAbGwBlh0Kdid7w");
HttpEntity<String> entity = new HttpEntity<>(headers);
int i = 55564;
while (true){
ResponseEntity<String> response = restTemplate.exchange(url+i, HttpMethod.GET, entity, String.class);
log.info("i={}, resp={}", i,response.getBody());
i++;
if(i == 55650){
break;
}
}
}
}

View File

@@ -26,7 +26,7 @@ public class User implements Serializable {
/** /**
* *
*/ */
@TableId(value = "id") @TableId(value = "id",type = IdType.AUTO)
private Long id; private Long id;
/** /**
* 用户号/ID号 * 用户号/ID号