|
@@ -25,6 +25,7 @@ import org.hswebframework.web.controller.SimpleGenericEntityController;
|
|
|
import org.hswebframework.web.controller.message.ResponseMessage;
|
|
|
import org.hswebframework.web.dict.DictDefine;
|
|
|
import org.hswebframework.web.dict.DictDefineRepository;
|
|
|
+import org.hswebframework.web.dict.ItemDefine;
|
|
|
import org.hswebframework.web.dictionary.api.DictionaryService;
|
|
|
import org.hswebframework.web.dictionary.api.entity.DictionaryEntity;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -33,6 +34,10 @@ import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Optional;
|
|
|
+
|
|
|
import static org.hswebframework.web.controller.message.ResponseMessage.*;
|
|
|
|
|
|
/**
|
|
@@ -65,4 +70,13 @@ public class DictionaryController implements SimpleGenericEntityController<Dicti
|
|
|
return ok(repository.getDefine(id));
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/define/{id:.+}/items")
|
|
|
+ @Authorize(merge = false)
|
|
|
+ @ApiOperation("获取数据字典选项信息")
|
|
|
+ public ResponseMessage<List<ItemDefine>> getItemDefineById(@PathVariable String id) {
|
|
|
+ return ok(Optional.ofNullable(repository.getDefine(id))
|
|
|
+ .map(DictDefine::getItems)
|
|
|
+ .orElse(Collections.emptyList()));
|
|
|
+ }
|
|
|
+
|
|
|
}
|