|
|
|
package com.dsideal.base.Tools;
|
|
|
|
|
|
|
|
import com.dsideal.base.DataEase.Model.DataEaseModel;
|
|
|
|
import com.dsideal.base.Tools.Util.LocalMysqlConnectUtil;
|
|
|
|
import com.jcraft.jsch.JSchException;
|
|
|
|
import com.jfinal.kit.StrKit;
|
|
|
|
import com.jfinal.plugin.activerecord.Db;
|
|
|
|
import com.jfinal.plugin.activerecord.Record;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
public class ChangUrlLink {
|
|
|
|
|
|
|
|
public static DataEaseModel dm = new DataEaseModel();
|
|
|
|
|
|
|
|
public static void main(String[] args) throws IOException, JSchException {
|
|
|
|
LocalMysqlConnectUtil.Init();
|
|
|
|
//原地址
|
|
|
|
String sourceHost = "http://10.10.21.20:9000/dsBase/";
|
|
|
|
//目标地址
|
|
|
|
String targetHost = "https://www.edusoa.com/dsBase/";
|
|
|
|
|
|
|
|
String sql = "select * from visualization_link_jump_info";
|
|
|
|
List<Record> list = Db.use(DataEaseModel.DB_NAME).find(sql);
|
|
|
|
String prefix = "http://";
|
|
|
|
for (Record record : list) {
|
|
|
|
String content = record.getStr("content");
|
|
|
|
long id = record.getLong("id");
|
|
|
|
if (!StrKit.isBlank(content)
|
|
|
|
//只有http的不要
|
|
|
|
&& content.startsWith(prefix) && content.length() > prefix.length()) {
|
|
|
|
System.out.println(content);
|
|
|
|
//sql="update visualization_link_jump_info set content=? where id=?";
|
|
|
|
//Db.use(DataEaseModel.DB_NAME).update(sql, content.replace(sourceHost, targetHost), id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|