|
@@ -4,6 +4,7 @@ package com.tzld.longarticle.recommend.server.web;
|
|
|
import com.tzld.longarticle.recommend.server.common.enums.GhTypeEnum;
|
|
|
import com.tzld.longarticle.recommend.server.common.response.CommonResponse;
|
|
|
import com.tzld.longarticle.recommend.server.model.vo.GhDetailVo;
|
|
|
+import com.tzld.longarticle.recommend.server.model.vo.GhTypeVo;
|
|
|
import com.tzld.longarticle.recommend.server.repository.model.GhDetail;
|
|
|
import com.tzld.longarticle.recommend.server.service.exterior.GhDetailService;
|
|
|
import com.tzld.longarticle.recommend.server.util.page.Page;
|
|
@@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@Slf4j
|
|
|
@RestController
|
|
@@ -43,7 +45,9 @@ public class GhDetailController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/types")
|
|
|
- public CommonResponse<List<GhTypeEnum>> getAllGhTypes() {
|
|
|
- return CommonResponse.success(Arrays.asList(GhTypeEnum.values()));
|
|
|
+ public CommonResponse<List<GhTypeVo>> getAllGhTypes() {
|
|
|
+ return CommonResponse.success(Arrays.stream(GhTypeEnum.values())
|
|
|
+ .map(ghTypeEnum -> new GhTypeVo(ghTypeEnum.type, ghTypeEnum.name))
|
|
|
+ .collect(Collectors.toList()));
|
|
|
}
|
|
|
}
|