mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-08 04:39:00 +08:00
refactor(app): 底部tabbar 支持优先级排序
This commit is contained in:
1 parent
7b1e95f5ff
commit
59c8d2a672
5 files changed
+12
-2
No files matched your search
@@ -2728,6 +2728,7 @@ CREATE TABLE `app_tabbar` (
|
||||
`selected` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '未选图标',
|
||||
`unselected` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '已选图标',
|
||||
`link` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '链接地址',
|
||||
`sort_order` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
|
||||
@@ -117,6 +117,7 @@ CREATE TABLE `app_tabbar` (
|
||||
`selected` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '未选图标',
|
||||
`unselected` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '已选图标',
|
||||
`link` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '链接地址',
|
||||
`sort_order` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
|
||||
+6
@@ -57,6 +57,12 @@ public class AppTabbarEntity extends Model<AppTabbarEntity> {
|
||||
@JsonDeserialize()
|
||||
private String link;
|
||||
|
||||
/**
|
||||
* 排序顺序
|
||||
*/
|
||||
@Schema(description = "排序值")
|
||||
private Integer sortOrder;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
package com.pig4cloud.pigx.app.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pig4cloud.pigx.app.api.entity.AppTabbarEntity;
|
||||
import com.pig4cloud.pigx.app.service.AppTabbarService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
@@ -37,7 +38,7 @@ public class AppTabbarController {
|
||||
@Operation(summary = "查询导航列表", description = "查询导航列表")
|
||||
@GetMapping("/list")
|
||||
public R list() {
|
||||
return R.ok(tabbarService.list());
|
||||
return R.ok(tabbarService.list(Wrappers.<AppTabbarEntity>lambdaQuery().orderByAsc(AppTabbarEntity::getSortOrder)));
|
||||
}
|
||||
|
||||
@Operation(summary = "更新导航", description = "更新导航")
|
||||
|
||||
+2
-1
@@ -59,7 +59,8 @@ public class AppIndexServiceImpl implements AppIndexService {
|
||||
@Override
|
||||
public Map<String, Object> config() {
|
||||
Map<String, Object> response = new LinkedHashMap<>();
|
||||
List<AppTabbarEntity> tabbarEntityList = appTabbarMapper.selectList(Wrappers.emptyWrapper());
|
||||
List<AppTabbarEntity> tabbarEntityList = appTabbarMapper
|
||||
.selectList(Wrappers.<AppTabbarEntity>lambdaQuery().orderByAsc(AppTabbarEntity::getSortOrder));
|
||||
response.put("tabbar", tabbarEntityList);
|
||||
return response;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user