mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-05-31 18:03:52 +08:00
增加getAll
This commit is contained in:
@@ -13,6 +13,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhouhao
|
||||
@@ -41,4 +42,17 @@ public class BoostDictDefineRepository extends DefaultDictDefineRepository {
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictDefine> getAllDefine() {
|
||||
List<DictDefine> all = dictionaryService.select()
|
||||
.stream()
|
||||
.map(dict -> DefaultDictDefine.builder()
|
||||
.id(dict.getId())
|
||||
.comments(dict.getDescribe())
|
||||
.items((List) new ArrayList<>(dict.getItems()))
|
||||
.build()).collect(Collectors.toList());
|
||||
|
||||
all.addAll(super.getAllDefine());
|
||||
return all;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,13 @@ public class DictionaryController implements SimpleGenericEntityController<Dicti
|
||||
return dictionaryService;
|
||||
}
|
||||
|
||||
@GetMapping("/define/all")
|
||||
@Authorize(merge = false)
|
||||
@ApiOperation("获取数据全部字典定义信息")
|
||||
public ResponseMessage<List<DictDefine>> getAllDefineById() {
|
||||
return ok(repository.getAllDefine());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/define/{id:.+}")
|
||||
@Authorize(merge = false)
|
||||
|
||||
Reference in New Issue
Block a user