添加注释,并删掉无用的注释

This commit is contained in:
yitonglei 2022-08-31 15:48:15 +08:00
parent d452ddb4fb
commit aa9f756f2c
3 changed files with 10 additions and 7 deletions

View File

@ -1,7 +1,6 @@
package io.renren.modules.monitor.task;
import io.renren.modules.job.task.ITask;
import io.renren.modules.monitor.service.MonitorService;
import io.renren.modules.sys.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

View File

@ -178,10 +178,15 @@ public class SysUserController {
}
@GetMapping("backSysUser")
public void backSysUser(){
@ApiOperation("手动执行备份sys_user表并从金宏获取用户信息增量更新到用户表中")
public Result backSysUser(){
int i = sysUserService.backSysUser();
if(i ==0){
sysUserService.getUserInfoFromJH();
}
return new Result().ok("更新用户已经执行");
}else{
return new Result().error();
}
}
}

View File

@ -487,9 +487,8 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
String property = System.getProperty("os.name");
System.out.println(property);
StringBuilder strBuil = new StringBuilder();
//jdbc:mysql://15.72.183.91:3306/share_platform?useUnicode=true&characterEncoding=UTF-8&server
String host = url.substring(url.indexOf("mysql"), url.indexOf("3306")).replace(":", "").replace("//", "").replace("mysql", "");
String host = url.substring(url.indexOf("mysql"), url.indexOf("3306")).replace(":", "").replace("//", "").replace("mysql", "");
String dataName = url.substring(url.indexOf("3306"), url.indexOf("?")).replaceAll("/", "").replaceAll("3306", "");
strBuil.append("mysqldump -u").append(username).append(" -p").append(password)
.append(" -h").append(host).append(" -P3306 ").append(dataName).append(" sys_user > /data/services/sys_user.sql");
@ -505,8 +504,8 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
// 本地win
process = Runtime.getRuntime().exec(newCmdWin);
}
//0 表示线程正常终止
//if (process.waitFor() == 0) {}
//process.waitFor() == 0表示执行正常
result = process.waitFor();
}catch (Exception e){
e.printStackTrace();