Commit 028f8f2c authored by fangxinjiang's avatar fangxinjiang

B端服务添加字典

parent d7d5b6e1
......@@ -2,9 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.admin.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysMenu;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUserRole;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.*;
import com.yifu.cloud.plus.v1.yifu.admin.api.util.TreeUtil;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.BusinessRoleMenuVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.BusinessUserVo;
......@@ -315,4 +313,15 @@ public class BusinessUserController {
}
return new R<>(userService.updateLockFlagById(user, lockFlag));
}
/**
* 通过字典类型查找字典值
* @param itemType 类型
* @return 同类型字典
*/
@Operation(description = "通过字典类型查找字典值")
@GetMapping("/itemType/{itemType}")
public R<List<SysDictItem>> getDictByType(@PathVariable String itemType) {
return new R<>(sysDictService.findDetailsByItemType(itemType));
}
}
......@@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.DictRedisVo;
import java.util.List;
......@@ -57,4 +58,7 @@ public interface SysDictService extends IService<SysDict> {
int selectChildDictItemCount(String parentItemType, String parentId);
List<DictRedisVo> getDictRedisVo();
List<SysDictItem> findDetailsByItemType(String itemType);
}
......@@ -145,4 +145,10 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
wrapper.orderByDesc(BaseEntity::getCreateTime);
return wrapper;
}
@Override
public List<SysDictItem> findDetailsByItemType(String itemType) {
return dictItemMapper.selectList(Wrappers.<SysDictItem>query().lambda()
.eq(SysDictItem::getType,itemType));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment