|
|
|
|
|
|
|
|
package com.tuoheng.admin.service.third.oidc; |
|
|
package com.tuoheng.admin.service.third.oidc; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.IService; |
|
|
import com.tuoheng.admin.entity.Tenant; |
|
|
import com.tuoheng.admin.entity.Tenant; |
|
|
import com.tuoheng.admin.entity.User; |
|
|
import com.tuoheng.admin.entity.User; |
|
|
|
|
|
import com.tuoheng.admin.query.RoleClientQuery; |
|
|
import com.tuoheng.admin.request.third.oidc.CreateOidcTenantRequest; |
|
|
import com.tuoheng.admin.request.third.oidc.CreateOidcTenantRequest; |
|
|
import com.tuoheng.admin.request.third.oidc.DeletedOidcTenantRequest; |
|
|
import com.tuoheng.admin.request.third.oidc.DeletedOidcTenantRequest; |
|
|
import com.tuoheng.admin.request.third.oidc.EditOidcTenantRequest; |
|
|
import com.tuoheng.admin.request.third.oidc.EditOidcTenantRequest; |
|
|
|
|
|
import com.tuoheng.admin.service.role.IRoleService; |
|
|
import com.tuoheng.common.core.utils.JsonResult; |
|
|
import com.tuoheng.common.core.utils.JsonResult; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private DeletedOidcTenantService deletedOidcTenantService; |
|
|
private DeletedOidcTenantService deletedOidcTenantService; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private IRoleService roleService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public JsonResult addUser(User user, String password, Tenant tenant) { |
|
|
public JsonResult addUser(User user, String password, Tenant tenant) { |
|
|
return addOidcUserService.add(user, password, tenant); |
|
|
return addOidcUserService.add(user, password, tenant); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public JsonResult deletedTenant(DeletedOidcTenantRequest request) { |
|
|
public JsonResult deletedTenant(DeletedOidcTenantRequest request) { |
|
|
return deletedOidcTenantService.deletedTenant(request); |
|
|
return deletedOidcTenantService.deletedTenant(request); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 租户获取可用的角色 |
|
|
|
|
|
* |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public JsonResult getRoleList() { |
|
|
|
|
|
|
|
|
|
|
|
JsonResult jsonResult = roleService.getRoles(); |
|
|
|
|
|
return jsonResult; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 获取角色对应的菜单 |
|
|
|
|
|
* |
|
|
|
|
|
* @param roleId |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public JsonResult getMenuList(Integer roleId) { |
|
|
|
|
|
|
|
|
|
|
|
RoleClientQuery query = new RoleClientQuery(); |
|
|
|
|
|
query.setRoleId(roleId); |
|
|
|
|
|
return roleService.getMenuList(query); |
|
|
|
|
|
} |
|
|
} |
|
|
} |