opt: 代码写法
This commit is contained in:
@@ -15,8 +15,10 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Service
|
||||
@@ -48,11 +50,7 @@ public class LuceneServiceImpl implements LuceneService {
|
||||
|
||||
@Override
|
||||
public List<String> getTagName() {
|
||||
List<String> res = new ArrayList<>();
|
||||
for (TagNameEnum nameEnum : TagNameEnum.values()) {
|
||||
res.add(nameEnum.getTag());
|
||||
}
|
||||
return res;
|
||||
return Arrays.stream(TagNameEnum.values()).map(TagNameEnum::getTag).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
|
||||
Reference in New Issue
Block a user