fix 删除ng-alain和actuator的接口
This commit is contained in:
-92
@@ -25,96 +25,4 @@ import java.util.Map;
|
||||
@RequestMapping("/sys/actuator/redis")
|
||||
public class ActuatorRedisController {
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
/**
|
||||
* Redis详细信息
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@GetMapping("/info")
|
||||
public Result<List<RedisInfo>> getRedisInfo() throws RedisConnectException {
|
||||
List<RedisInfo> infoList = this.redisService.getRedisInfo();
|
||||
log.info(infoList.toString());
|
||||
return Result.OK(infoList);
|
||||
}
|
||||
|
||||
@GetMapping("/keysSize")
|
||||
public Map<String, Object> getKeysSize() throws RedisConnectException {
|
||||
return redisService.getKeysSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取redis key数量 for 报表
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@GetMapping("/keysSizeForReport")
|
||||
public Map<String, JSONArray> getKeysSizeReport() throws RedisConnectException {
|
||||
return redisService.getMapForReport("1");
|
||||
}
|
||||
/**
|
||||
* 获取redis 内存 for 报表
|
||||
*
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@GetMapping("/memoryForReport")
|
||||
public Map<String, JSONArray> memoryForReport() throws RedisConnectException {
|
||||
return redisService.getMapForReport("2");
|
||||
}
|
||||
/**
|
||||
* 获取redis 全部信息 for 报表
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@GetMapping("/infoForReport")
|
||||
public Map<String, JSONArray> infoForReport() throws RedisConnectException {
|
||||
return redisService.getMapForReport("3");
|
||||
}
|
||||
|
||||
@GetMapping("/memoryInfo")
|
||||
public Map<String, Object> getMemoryInfo() throws RedisConnectException {
|
||||
return redisService.getMemoryInfo();
|
||||
}
|
||||
|
||||
//update-begin--Author:zhangweijian Date:20190425 for:获取磁盘信息
|
||||
/**
|
||||
* @功能:获取磁盘信息
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryDiskInfo")
|
||||
public Result<List<Map<String,Object>>> queryDiskInfo(HttpServletRequest request, HttpServletResponse response){
|
||||
Result<List<Map<String,Object>>> res = new Result<>();
|
||||
try {
|
||||
// 当前文件系统类
|
||||
FileSystemView fsv = FileSystemView.getFileSystemView();
|
||||
// 列出所有windows 磁盘
|
||||
File[] fs = File.listRoots();
|
||||
log.info("查询磁盘信息:"+fs.length+"个");
|
||||
List<Map<String,Object>> list = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < fs.length; i++) {
|
||||
if(fs[i].getTotalSpace()==0) {
|
||||
continue;
|
||||
}
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("name", fsv.getSystemDisplayName(fs[i]));
|
||||
map.put("max", fs[i].getTotalSpace());
|
||||
map.put("rest", fs[i].getFreeSpace());
|
||||
map.put("restPPT", (fs[i].getTotalSpace()-fs[i].getFreeSpace())*100/fs[i].getTotalSpace());
|
||||
list.add(map);
|
||||
log.info(map.toString());
|
||||
}
|
||||
res.setResult(list);
|
||||
res.setMessage("查询成功");
|
||||
} catch (Exception e) {
|
||||
return Result.error("查询失败"+e.getMessage());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
//update-end--Author:zhangweijian Date:20190425 for:获取磁盘信息
|
||||
}
|
||||
|
||||
-56
@@ -22,61 +22,5 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@RestController
|
||||
@RequestMapping("/sys/ng-alain")
|
||||
public class NgAlainController {
|
||||
@Autowired
|
||||
private NgAlainService ngAlainService;
|
||||
@Autowired
|
||||
private ISysDictService sysDictService;
|
||||
|
||||
@RequestMapping(value = "/getAppData")
|
||||
@ResponseBody
|
||||
public JSONObject getAppData(HttpServletRequest request){
|
||||
String token=request.getHeader("X-Access-Token");
|
||||
JSONObject j = new JSONObject();
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
JSONObject userObjcet = new JSONObject();
|
||||
userObjcet.put("name", user.getUsername());
|
||||
userObjcet.put("avatar", user.getAvatar());
|
||||
userObjcet.put("email", user.getEmail());
|
||||
userObjcet.put("token", token);
|
||||
j.put("user", userObjcet);
|
||||
j.put("menu",ngAlainService.getMenu(user.getUsername()));
|
||||
JSONObject app = new JSONObject();
|
||||
app.put("name", "jero-boot-angular");
|
||||
app.put("description", "jero+ng-alain整合版本");
|
||||
j.put("app", app);
|
||||
return j;
|
||||
}
|
||||
|
||||
// @RequestMapping(value = "/getDictItems/{dictCode}", method = RequestMethod.GET)
|
||||
@GetMapping("/getDictItems/{dictCode}")
|
||||
public Object getDictItems(@PathVariable String dictCode) {
|
||||
log.info(" dictCode : "+ dictCode);
|
||||
Result<List<DictModel>> result = new Result<>();
|
||||
List<DictModel> ls = null;
|
||||
try {
|
||||
ls = sysDictService.queryDictItemsByCode(dictCode);
|
||||
result.setSuccess(true);
|
||||
result.setResult(ls);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
return Result.error("操作失败");
|
||||
}
|
||||
List<JSONObject> dictlist=new ArrayList<>();
|
||||
for (DictModel l : ls) {
|
||||
JSONObject dict=new JSONObject();
|
||||
try {
|
||||
dict.put("value",Integer.parseInt(l.getValue()));
|
||||
} catch (NumberFormatException e) {
|
||||
dict.put("value",l.getValue());
|
||||
}
|
||||
dict.put("label",l.getText());
|
||||
dictlist.add(dict);
|
||||
}
|
||||
return dictlist;
|
||||
}
|
||||
// @RequestMapping(value = "/getDictItemsByTable/{table}/{key}/{value}", method = RequestMethod.GET)
|
||||
@GetMapping("/getDictItemsByTable/{table}/{key}/{value}")
|
||||
public Object getDictItemsByTable(@PathVariable String table,@PathVariable String key,@PathVariable String value) {
|
||||
return this.ngAlainService.getDictByTable(table,key,value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user