Search in sources :

Example 1 with ValidList

use of com.diboot.core.entity.ValidList in project diboot by dibo-software.

the class BaseController method attachMoreRelatedData.

/**
 * 通用的attachMore获取数据
 *
 * @param attachMoreDTOList
 * @return
 */
protected Map<String, List<LabelValue>> attachMoreRelatedData(ValidList<AttachMoreDTO> attachMoreDTOList) {
    if (V.isEmpty(attachMoreDTOList)) {
        return Collections.emptyMap();
    }
    Map<String, List<LabelValue>> result = new HashMap<>(attachMoreDTOList.size());
    for (AttachMoreDTO attachMoreDTO : attachMoreDTOList) {
        // 请求参数安全检查
        V.securityCheck(attachMoreDTO.getTarget(), attachMoreDTO.getValue(), attachMoreDTO.getLabel(), attachMoreDTO.getExt());
        result.computeIfAbsent(S.toLowerCaseCamel(attachMoreDTO.getTarget()) + "Options", key -> V.isEmpty(attachMoreDTO.getLabel()) ? attachMoreRelatedData(attachMoreDTO.getTarget()) : attachMoreRelatedData(attachMoreDTO));
    }
    return result;
}
Also used : ValidList(com.diboot.core.entity.ValidList) AttachMoreDTO(com.diboot.core.dto.AttachMoreDTO)

Aggregations

AttachMoreDTO (com.diboot.core.dto.AttachMoreDTO)1 ValidList (com.diboot.core.entity.ValidList)1