use of com.paascloud.provider.model.vo.MdcDictVo in project paascloud-master by paascloud.
the class MdcDictServiceImpl method getMdcDictVoById.
@Override
@Transactional(readOnly = true, rollbackFor = Exception.class)
public MdcDictVo getMdcDictVoById(Long dictId) {
MdcDict dict = mdcDictMapper.selectByPrimaryKey(dictId);
if (dict == null) {
logger.error("找不到数据字典信息id={}", dictId);
throw new MdcBizException(ErrorCodeEnum.MDC10021018, dictId);
}
// 获取父级菜单信息
MdcDict parentDict = mdcDictMapper.selectByPrimaryKey(dict.getPid());
ModelMapper modelMapper = new ModelMapper();
MdcDictVo dictVo = modelMapper.map(dict, MdcDictVo.class);
if (parentDict != null) {
dictVo.setParentDictName(parentDict.getDictName());
}
return dictVo;
}
use of com.paascloud.provider.model.vo.MdcDictVo in project paascloud-master by paascloud.
the class MdcDictMainController method queryDictVoById.
/**
* 根据ID获取字典信息.
*
* @param id the id
*
* @return the wrapper
*/
@PostMapping(value = "/queryById/{id}")
@ApiOperation(httpMethod = "POST", value = "根据ID获取字典信息")
public Wrapper<MdcDictVo> queryDictVoById(@ApiParam(name = "id", value = "字典id") @PathVariable Long id) {
logger.info("根据Id查询字典信息, dictId={}", id);
MdcDictVo mdcDictVo = mdcDictService.getMdcDictVoById(id);
return WrapMapper.ok(mdcDictVo);
}
Aggregations