新增角色下拉
This commit is contained in:
parent
43688be204
commit
6423785eb1
|
|
@ -1,10 +1,12 @@
|
||||||
package com.bonus.web.controller.system;
|
package com.bonus.web.controller.system;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import com.bonus.common.annotation.RequiresPermissions;
|
import com.bonus.common.annotation.RequiresPermissions;
|
||||||
import com.bonus.common.annotation.SysLog;
|
import com.bonus.common.annotation.SysLog;
|
||||||
|
import com.bonus.common.core.domain.SysRoleDto;
|
||||||
import com.bonus.common.enums.OperaType;
|
import com.bonus.common.enums.OperaType;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
|
@ -66,6 +68,19 @@ public class SysRoleController extends BaseController {
|
||||||
List<SysRole> list = roleService.selectRoleList(role);
|
List<SysRole> list = roleService.selectRoleList(role);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
@GetMapping("/select")
|
||||||
|
@SysLog(title = "角色管理", businessType = OperaType.QUERY, logType = 1, module = "系统管理->角色管理", details = "查询列表")
|
||||||
|
public AjaxResult select(SysRole role) {
|
||||||
|
List<SysRole> list = roleService.selectRoleList(role);
|
||||||
|
List<SysRoleDto> objects = new ArrayList<>();
|
||||||
|
for (SysRole sysRole : list) {
|
||||||
|
SysRoleDto sysRoleDto = new SysRoleDto();
|
||||||
|
sysRoleDto.setId(sysRole.getRoleId());
|
||||||
|
sysRoleDto.setName(sysRole.getRoleName());
|
||||||
|
objects.add(sysRoleDto);
|
||||||
|
}
|
||||||
|
return AjaxResult.success(objects);
|
||||||
|
}
|
||||||
|
|
||||||
@SysLog(title = "角色管理", businessType = OperaType.EXPORT, logType = 1, module = "系统管理->角色管理", details = "导出")
|
@SysLog(title = "角色管理", businessType = OperaType.EXPORT, logType = 1, module = "系统管理->角色管理", details = "导出")
|
||||||
@RequiresPermissions("system:role:export")
|
@RequiresPermissions("system:role:export")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.bonus.common.core.domain;
|
||||||
|
|
||||||
|
import com.bonus.common.annotation.Excel;
|
||||||
|
import com.bonus.common.annotation.Excel.ColumnType;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色表 sys_role
|
||||||
|
*
|
||||||
|
* @author bonus
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SysRoleDto {
|
||||||
|
private Long id;
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -170,4 +170,5 @@ public interface ISysRoleService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertAuthUsers(Long roleId, Long[] userIds);
|
public int insertAuthUsers(Long roleId, Long[] userIds);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue