feat(新增): 菜单图标搜索
This commit is contained in:
parent
eb1399cea8
commit
6e58502586
|
@ -49,6 +49,13 @@ public class MenuIconController {
|
||||||
return Mono.just(Result.success(pageResult));
|
return Mono.just(Result.success(pageResult));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "获取查询图标名称列表", description = "获取查询图标名称列表")
|
||||||
|
@GetMapping("getIconNameList")
|
||||||
|
public Mono<Result<List<MenuIconVo>>> getIconNameList(String iconName) {
|
||||||
|
List<MenuIconVo> voList = menuIconService.getIconNameList(iconName);
|
||||||
|
return Mono.just(Result.success(voList));
|
||||||
|
}
|
||||||
|
|
||||||
@Operation(summary = "添加系统菜单图标", description = "添加系统菜单图标")
|
@Operation(summary = "添加系统菜单图标", description = "添加系统菜单图标")
|
||||||
@PostMapping("addMenuIcon")
|
@PostMapping("addMenuIcon")
|
||||||
public Mono<Result<String>> addMenuIcon(@Valid @RequestBody MenuIconAddDto dto) {
|
public Mono<Result<String>> addMenuIcon(@Valid @RequestBody MenuIconAddDto dto) {
|
||||||
|
|
|
@ -49,4 +49,12 @@ public interface MenuIconService extends IService<MenuIcon> {
|
||||||
* @param ids 删除id列表
|
* @param ids 删除id列表
|
||||||
*/
|
*/
|
||||||
void deleteMenuIcon(List<Long> ids);
|
void deleteMenuIcon(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 获取查询图标名称列表
|
||||||
|
*
|
||||||
|
* @param iconName 查询图标名称
|
||||||
|
* @return 图标返回列表
|
||||||
|
*/
|
||||||
|
List<MenuIconVo> getIconNameList(String iconName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,13 +9,16 @@ import cn.bunny.dao.vo.system.menuIcon.MenuIconVo;
|
||||||
import cn.bunny.services.mapper.MenuIconMapper;
|
import cn.bunny.services.mapper.MenuIconMapper;
|
||||||
import cn.bunny.services.service.MenuIconService;
|
import cn.bunny.services.service.MenuIconService;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -89,4 +92,27 @@ public class MenuIconServiceImpl extends ServiceImpl<MenuIconMapper, MenuIcon> i
|
||||||
public void deleteMenuIcon(List<Long> ids) {
|
public void deleteMenuIcon(List<Long> ids) {
|
||||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 获取查询图标名称列表
|
||||||
|
*
|
||||||
|
* @param iconName 查询图标名称
|
||||||
|
* @return 图标返回列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<MenuIconVo> getIconNameList(String iconName) {
|
||||||
|
return list(Wrappers.<MenuIcon>lambdaQuery().like(MenuIcon::getIconName, iconName))
|
||||||
|
.stream().map(menuIcon -> {
|
||||||
|
MenuIconVo menuIconVo = new MenuIconVo();
|
||||||
|
BeanUtils.copyProperties(menuIcon, menuIconVo);
|
||||||
|
return menuIconVo;
|
||||||
|
}).collect(Collectors.collectingAndThen(
|
||||||
|
Collectors.toMap(
|
||||||
|
MenuIconVo::getIconName,
|
||||||
|
i -> i,
|
||||||
|
(existing, replacement) -> existing
|
||||||
|
),
|
||||||
|
map -> new ArrayList<>(map.values())
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
icon_name like CONCAT('%',#{dto.iconName},'%')
|
icon_name like CONCAT('%',#{dto.iconName},'%')
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by update_time
|
order by update_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 物理删除系统菜单图标 -->
|
<!-- 物理删除系统菜单图标 -->
|
||||||
|
|
Loading…
Reference in New Issue