提交 44136035 编写于 作者: sq3536's avatar sq3536

appnav

上级 666eab97
......@@ -42,7 +42,7 @@ public class SysAppService extends SysAppServiceImpl
private UAACoreService uaaCoreService;
@Cacheable( value="ibzuaa_switcher",key = "'id:'+#p0+'||'+#p1")
//@Cacheable( value="ibzuaa_switcher",key = "'id:'+#p0+'||'+#p1")
public JSONObject getAppSwitcher(String id,String userId)
{
JSONObject jo=ibzConfigService.getConfig("AppSwitcher",id, userId);
......@@ -68,7 +68,7 @@ public class SysAppService extends SysAppServiceImpl
});
final boolean flag=nullSwitcher;
defApps.values().forEach(sysApp -> {
if(1!=sysApp.getVisabled())return;
if(sysApp.getVisabled()==null||sysApp.getVisabled()==0)return;
if(flag&&id.equalsIgnoreCase("default"))
sysApp.setVisabled(1);
else
......@@ -80,6 +80,12 @@ public class SysAppService extends SysAppServiceImpl
return jo;
}
@CacheEvict( value="ibzuaa_switcher",key = "'id:'+#p0+'||'+#p1")
public boolean saveAppSwitcher(String id,String userId,JSONObject config)
{
return ibzConfigService.saveConfig("AppSwitcher",id, userId,config);
}
@CacheEvict( value="ibzuaa_switcher",allEntries=true)
public void resetAppNavigationBars()
{
......
......@@ -82,13 +82,5 @@ public class ClientAuthenticationResource
return ResponseEntity.ok().body(user);
}
@Autowired
private SysAppService sysAppService;
@GetMapping(value = "uaa/access-center/app-switcher/{id}")
public ResponseEntity<JSONObject> appswitcher(@PathVariable("id") String id)
{
return ResponseEntity.ok(sysAppService.getAppSwitcher(id,AuthenticationUser.getAuthenticationUser().getUserid()));
}
}
......@@ -8,9 +8,12 @@ import cn.ibizlab.core.uaa.domain.SysPSSystem;
import cn.ibizlab.core.uaa.domain.SysRolePermission;
import cn.ibizlab.core.uaa.extensions.domain.PermissionNode;
import cn.ibizlab.core.uaa.extensions.domain.SysStructure;
import cn.ibizlab.core.uaa.extensions.service.SysAppService;
import cn.ibizlab.core.uaa.extensions.service.UAACoreService;
import cn.ibizlab.core.uaa.service.ISysPSSystemService;
import cn.ibizlab.core.uaa.service.ISysRolePermissionService;
import cn.ibizlab.util.security.AuthenticationUser;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
......@@ -74,4 +77,20 @@ public class UAACoreResource {
uaaCoreService.saveByRoleid(sysrole_id,domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@Autowired
private SysAppService sysAppService;
@GetMapping(value = "uaa/access-center/app-switcher/{id}")
public ResponseEntity<JSONObject> appswitcher(@PathVariable("id") String id)
{
return ResponseEntity.ok(sysAppService.getAppSwitcher(id, AuthenticationUser.getAuthenticationUser().getUserid()));
}
@PutMapping(value = "uaa/access-center/app-switcher/{id}")
public ResponseEntity<Boolean> appswitcher(@PathVariable("id") String id, @RequestBody JSONObject config)
{
return ResponseEntity.ok(sysAppService.saveAppSwitcher(id,AuthenticationUser.getAuthenticationUser().getUserid(),config));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册