返利代码添加

master
lvxinran 2021-08-05 14:40:42 +08:00
parent 030f77d817
commit 1897e92afb
1 changed files with 23 additions and 23 deletions

View File

@ -46,7 +46,7 @@ public class GmController {
String cmd = request.getParameter("content");
if(cmd.equals("recharge")){
// recharge();
recharge();
return 0;
}
String serverId = request.getParameter("serverId");
@ -226,28 +226,28 @@ public class GmController {
}
// public void recharge() throws IOException {
// String osName = System.getProperty("os.name");
// String filePath = "";
// Gson gson = new Gson();
// if (osName.matches("^(?i)Windows.*$")) {// Window 系统
// filePath = "conf/";
// } else {// Linux 系统
// filePath = "../config/";
// }
// BufferedReader in = new BufferedReader(new FileReader(filePath+"rechargeImport.txt"));
// BufferedWriter out = new BufferedWriter(new FileWriter(filePath+"recharge.json"));
// String str;
// while ((str = in.readLine()) != null) {
// String[] s = str.split("\t");
// RechargeInfo rechargeInfo = new RechargeInfo(s[0], Double.valueOf(s[1]), 0);
// String json = gson.toJson(rechargeInfo);
// System.out.println(s[0]+"||"+s[1]);
// out.write(json+"\n");
// }
// in.close();
// out.close();
// }
public void recharge() throws IOException {
String osName = System.getProperty("os.name");
String filePath = "";
Gson gson = new Gson();
if (osName.matches("^(?i)Windows.*$")) {// Window 系统
filePath = "conf/";
} else {// Linux 系统
filePath = "../config/";
}
BufferedReader in = new BufferedReader(new FileReader(filePath+"rechargeImport.txt"));
BufferedWriter out = new BufferedWriter(new FileWriter(filePath+"recharge.json"));
String str;
while ((str = in.readLine()) != null) {
String[] s = str.split("\t");
RechargeInfo rechargeInfo = new RechargeInfo(s[0], Double.valueOf(s[1]), 0);
String json = gson.toJson(rechargeInfo);
System.out.println(s[0]+"||"+s[1]);
out.write(json+"\n");
}
in.close();
out.close();
}
public static void main(String[] args) throws IOException {
String osName = System.getProperty("os.name");
String filePath = "";