pull/1121/head
parent
af8cacf517
commit
764cc5aabc
|
|
@ -25,16 +25,14 @@ import io.swagger.annotations.ApiOperation;
|
|||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 角色信息
|
||||
|
|
@ -84,6 +82,17 @@ public class StoreRoleController extends XktBaseController {
|
|||
return R.ok(BeanUtil.copyToList(all, RoleListItemVO.class));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('store')")
|
||||
@ApiOperation(value = "角色详情 - 档口")
|
||||
@GetMapping(value = "/{id}")
|
||||
public R<RoleInfoVO> getInfo(@PathVariable("id") Long id) {
|
||||
RoleInfo infoDTO = roleService.getRoleById(id);
|
||||
RoleInfoVO vo = BeanUtil.toBean(infoDTO, RoleInfoVO.class);
|
||||
vo.setMenuIds(CollUtil.emptyIfNull(vo.getMenus()).stream().map(MenuInfoVO::getMenuId)
|
||||
.collect(Collectors.toList()));
|
||||
return R.ok(vo);
|
||||
}
|
||||
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('store')")
|
||||
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ public class SysRoleController extends XktBaseController {
|
|||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin,store')")
|
||||
@ApiOperation(value = "角色详情 - 管理员")
|
||||
@ApiOperation(value = "角色详情 - 管理员/档口")
|
||||
@GetMapping(value = "/{id}")
|
||||
public R<RoleInfoVO> getInfo(@PathVariable("id") Long id) {
|
||||
RoleInfo infoDTO = roleService.getRoleById(id);
|
||||
|
|
|
|||
|
|
@ -42,4 +42,7 @@ public class RoleInfoEditByStoreVO {
|
|||
*/
|
||||
@ApiModelProperty("菜单ID集")
|
||||
private List<Long> menuIds;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,4 +59,7 @@ public class RoleInfoEditVO {
|
|||
*/
|
||||
@ApiModelProperty("菜单ID集")
|
||||
private List<Long> menuIds;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue