Merge branch 'dev'
This commit is contained in:
commit
ff844bc432
|
@ -6,9 +6,11 @@ import io.renren.common.utils.Result;
|
||||||
import io.renren.common.utils.UpdateUtil;
|
import io.renren.common.utils.UpdateUtil;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
@ -21,6 +23,8 @@ public class AdminController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UpdateUtil updateUtil;
|
private UpdateUtil updateUtil;
|
||||||
|
@Value("${spring.profiles.active}")
|
||||||
|
private String active; // 现有生效
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param updateFile 更新包下载地址
|
* @param updateFile 更新包下载地址
|
||||||
|
@ -31,7 +35,11 @@ public class AdminController {
|
||||||
@ApiOperation("进行后台程序更新")
|
@ApiOperation("进行后台程序更新")
|
||||||
@LogOperation("进行后台程序更新")
|
@LogOperation("进行后台程序更新")
|
||||||
public Result<String> update(String updateFile, String active) {
|
public Result<String> update(String updateFile, String active) {
|
||||||
return new Result<String>().ok("");
|
if (StringUtils.isEmpty(active)) {
|
||||||
|
active = this.active;
|
||||||
|
}
|
||||||
|
boolean success = updateUtil.update(updateFile, active);
|
||||||
|
return new Result<String>().ok(String.valueOf(success));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue