mirror of https://gitee.com/stylefeng/roses
【7.2.2】【expand】用户列表增加Wrapper包装展示动态列
parent
7061b059aa
commit
dcd867c64f
|
@ -200,6 +200,7 @@ public class SysExpandServiceImpl extends ServiceImpl<SysExpandMapper, SysExpand
|
|||
|
||||
SysExpandRequest sysExpandRequest = new SysExpandRequest();
|
||||
sysExpandRequest.setExpandCode(expandCode);
|
||||
sysExpandRequest.setPrimaryFieldValue(primaryFieldValue);
|
||||
SysExpandData sysExpandData = this.getByExpandCode(sysExpandRequest);
|
||||
|
||||
// 获取对应数据
|
||||
|
|
|
@ -41,6 +41,8 @@ import cn.stylefeng.roses.kernel.system.api.pojo.user.request.SysUserRequest;
|
|||
import cn.stylefeng.roses.kernel.system.modular.user.entity.SysUserRole;
|
||||
import cn.stylefeng.roses.kernel.system.modular.user.service.SysUserRoleService;
|
||||
import cn.stylefeng.roses.kernel.system.modular.user.service.SysUserService;
|
||||
import cn.stylefeng.roses.kernel.system.modular.user.wrapper.UserExpandWrapper;
|
||||
import cn.stylefeng.roses.kernel.wrapper.api.annotation.Wrapper;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
@ -202,6 +204,7 @@ public class SysUserController {
|
|||
* @date 2020/11/6 13:49
|
||||
*/
|
||||
@GetResource(name = "系统用户_查询", path = "/sysUser/page")
|
||||
@Wrapper(UserExpandWrapper.class)
|
||||
public ResponseData<PageResult<SysUserDTO>> page(SysUserRequest sysUserRequest) {
|
||||
return new SuccessResponseData<>(sysUserService.findPage(sysUserRequest));
|
||||
}
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright [2020-2030] [https://www.stylefeng.cn]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
|
||||
*
|
||||
* 1.请不要删除和修改根目录下的LICENSE文件。
|
||||
* 2.请不要删除和修改Guns源码头部的版权声明。
|
||||
* 3.请保留源码和相关描述文件的项目出处,作者声明等。
|
||||
* 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||
*/
|
||||
package cn.stylefeng.roses.kernel.system.modular.user.wrapper;
|
||||
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.api.ExpandApi;
|
||||
import cn.stylefeng.roses.kernel.system.api.pojo.user.SysUserDTO;
|
||||
import cn.stylefeng.roses.kernel.wrapper.api.BaseWrapper;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 系统用户的拓展
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/4/1 11:30
|
||||
*/
|
||||
public class UserExpandWrapper implements BaseWrapper<SysUserDTO> {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> doWrap(SysUserDTO beWrappedModel) {
|
||||
ExpandApi expandApi = SpringUtil.getBean(ExpandApi.class);
|
||||
return expandApi.getExpandDataInfo("user_expand", beWrappedModel.getUserId());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue