mirror of
https://gitee.com/likeadmin/likeadmin_java.git
synced 2026-06-04 08:38:26 +08:00
fix 代码生成器不兼容的bug
This commit is contained in:
@@ -45,6 +45,16 @@ public class SystemAuthMenuController {
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
@NotPower
|
||||
@GetMapping("/systemMenuLists")
|
||||
@ApiOperation(value="获取菜单列表")
|
||||
public AjaxResult<Object> systemMenuLists() {
|
||||
JSONArray result = iSystemAuthMenuService.systemMenuLists();
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/all")
|
||||
@ApiOperation(value="获取菜单列表")
|
||||
public AjaxResult<JSONArray> all() {
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.mdd.admin.service.system.ISystemRoleMenuService;
|
||||
import com.mdd.admin.validate.system.SystemMenuCreateValidate;
|
||||
import com.mdd.admin.validate.system.SystemMenuUpdateValidate;
|
||||
import com.mdd.admin.vo.system.SystemAuthMenuVo;
|
||||
import com.mdd.admin.vo.system.SystemMenuListedVo;
|
||||
import com.mdd.common.entity.system.SystemMenu;
|
||||
import com.mdd.common.mapper.system.SystemMenuMapper;
|
||||
import com.mdd.common.util.ListUtils;
|
||||
@@ -86,6 +87,28 @@ public class SystemMenuServiceImpl implements ISystemMenuService {
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray systemMenuLists() {
|
||||
QueryWrapper<SystemMenu> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByDesc("sort");
|
||||
queryWrapper.orderByAsc("id");
|
||||
|
||||
List<SystemMenu> systemAuthMenus = systemAuthMenuMapper.selectList(queryWrapper);
|
||||
|
||||
List<SystemMenuListedVo> lists = new ArrayList<>();
|
||||
for (SystemMenu systemAuthMenu : systemAuthMenus) {
|
||||
SystemMenuListedVo vo = new SystemMenuListedVo();
|
||||
BeanUtils.copyProperties(systemAuthMenu, vo);
|
||||
|
||||
vo.setCreateTime(TimeUtils.timestampToDate(systemAuthMenu.getCreateTime()));
|
||||
vo.setUpdateTime(TimeUtils.timestampToDate(systemAuthMenu.getUpdateTime()));
|
||||
lists.add(vo);
|
||||
}
|
||||
|
||||
JSONArray jsonArray = JSONArray.parseArray(JSONArray.toJSONString(lists));
|
||||
return ListUtils.listToTree(jsonArray, "id", "pid", "children");
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray all() {
|
||||
QueryWrapper<SystemMenu> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
@@ -29,6 +29,14 @@ public interface ISystemMenuService {
|
||||
*/
|
||||
JSONObject list();
|
||||
|
||||
/**
|
||||
* 菜单列表
|
||||
*
|
||||
* @author fzr
|
||||
* @return JSONArray
|
||||
*/
|
||||
JSONArray systemMenuLists();
|
||||
|
||||
/**
|
||||
* 菜单列表
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user