|
|
@@ -7,6 +7,7 @@ import com.finikes.oc.management.HouseRelationViewDto;
|
|
|
import com.finikes.oc.management.dao.HouseRelationDAO;
|
|
|
import com.github.pagehelper.Page;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
@@ -17,6 +18,9 @@ public class HouseRelationController {
|
|
|
|
|
|
private final HouseRelationDAO houseRelationDAO;
|
|
|
|
|
|
+ @Value("${host}")
|
|
|
+ private String host;
|
|
|
+
|
|
|
public HouseRelationController(HouseRelationDAO houseRelationDAO) {
|
|
|
this.houseRelationDAO = houseRelationDAO;
|
|
|
}
|
|
|
@@ -35,6 +39,9 @@ public class HouseRelationController {
|
|
|
@RequestParam(name = "state") Integer state) {
|
|
|
try (Page<HouseRelationViewDto> page = PageHelper.startPage(pageNum, pageCapacity)) {
|
|
|
List<HouseRelationViewDto> viewDtos = houseRelationDAO.selectByState(state);
|
|
|
+ for (HouseRelationViewDto dto : viewDtos) {
|
|
|
+ dto.setCertificateUrl(host + "/upload/" + dto.getCertificateUrl());
|
|
|
+ }
|
|
|
PageResponse<HouseRelationViewDto> pageResponse = new PageResponse<>();
|
|
|
pageResponse.setPageQuantity(page.getPageNum());
|
|
|
pageResponse.setList(viewDtos);
|