use of com.ruoyi.common.core.domain.AjaxResult in project wumei-smart by kerwincui.
the class CacheController method getInfo.
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping()
public AjaxResult getInfo() throws Exception {
Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info());
Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats"));
Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize());
Map<String, Object> result = new HashMap<>(3);
result.put("info", info);
result.put("dbSize", dbSize);
List<Map<String, String>> pieList = new ArrayList<>();
commandStats.stringPropertyNames().forEach(key -> {
Map<String, String> data = new HashMap<>(2);
String property = commandStats.getProperty(key);
data.put("name", StringUtils.removeStart(key, "cmdstat_"));
data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
pieList.add(data);
});
result.put("commandStats", pieList);
return AjaxResult.success(result);
}
use of com.ruoyi.common.core.domain.AjaxResult in project wumei-smart by kerwincui.
the class SysDeptController method roleDeptTreeselect.
/**
* 加载对应角色部门列表树
*/
@GetMapping(value = "/roleDeptTreeselect/{roleId}")
public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId) {
List<SysDept> depts = deptService.selectDeptList(new SysDept());
AjaxResult ajax = AjaxResult.success();
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
ajax.put("depts", deptService.buildDeptTreeSelect(depts));
return ajax;
}
use of com.ruoyi.common.core.domain.AjaxResult in project wumei-smart by kerwincui.
the class SocialLoginServiceImpl method socialLogin.
@Override
public AjaxResult socialLogin(String loginId) {
AjaxResult ajax = AjaxResult.success();
String loginKey = LOGIN_SOCIAL_REDIS_KEY + loginId;
LoginIdValue loginIdValue = redisCache.getCacheObject(loginKey);
if (loginIdValue != null) {
// login
String token = sysLoginService.redirectLogin(loginIdValue.getUsername(), loginIdValue.getPassword());
ajax.put(Constants.TOKEN, token);
} else {
log.info("loginId:{} ", loginId);
return error(NO_MESSAGE_ALERT, "数据错误");
}
return ajax;
}
use of com.ruoyi.common.core.domain.AjaxResult in project RuoYi-Vue by yangzongzhuan.
the class SysMenuController method roleMenuTreeselect.
/**
* 加载对应角色菜单列表树
*/
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) {
List<SysMenu> menus = menuService.selectMenuList(getUserId());
AjaxResult ajax = AjaxResult.success();
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
ajax.put("menus", menuService.buildMenuTreeSelect(menus));
return ajax;
}
use of com.ruoyi.common.core.domain.AjaxResult in project RuoYi-Vue by yangzongzhuan.
the class SysProfileController method profile.
/**
* 个人信息
*/
@GetMapping
public AjaxResult profile() {
LoginUser loginUser = getLoginUser();
SysUser user = loginUser.getUser();
AjaxResult ajax = AjaxResult.success(user);
ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
return ajax;
}
Aggregations