Commit a77a7c1d by huluobin

后台访问请求头

parent be56b461
...@@ -42,4 +42,6 @@ public class GetTechnicianPageRequest { ...@@ -42,4 +42,6 @@ public class GetTechnicianPageRequest {
private List<LocalDateTime> date_utc; private List<LocalDateTime> date_utc;
private Integer technician_id; private Integer technician_id;
} }
...@@ -48,7 +48,9 @@ import lombok.AllArgsConstructor; ...@@ -48,7 +48,9 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.core.ParameterizedTypeReference; import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity; import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -362,8 +364,9 @@ public class Schedule { ...@@ -362,8 +364,9 @@ public class Schedule {
.status(1) .status(1)
.technician_id(storeTechnician.getId()) .technician_id(storeTechnician.getId())
.build(); .build();
HttpHeaders headers = new HttpHeaders();
HttpEntity<GetTechnicianPageRequest> allHttpEntity = new HttpEntity<>(allRequest); headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<GetTechnicianPageRequest> allHttpEntity = new HttpEntity<>(allRequest, headers);
AdminTechnicianScore monthAdminResult = restTemplate.exchange(gogirlProperties.getAdminBackendUrl(), HttpMethod.POST, allHttpEntity, responseBodyType) AdminTechnicianScore monthAdminResult = restTemplate.exchange(gogirlProperties.getAdminBackendUrl(), HttpMethod.POST, allHttpEntity, responseBodyType)
.getBody() .getBody()
...@@ -384,7 +387,7 @@ public class Schedule { ...@@ -384,7 +387,7 @@ public class Schedule {
.technician_id(storeTechnician.getId()) .technician_id(storeTechnician.getId())
.build(); .build();
HttpEntity<GetTechnicianPageRequest> monthHttpEntity = new HttpEntity<>(monthRequest); HttpEntity<GetTechnicianPageRequest> monthHttpEntity = new HttpEntity<>(monthRequest, headers);
AdminTechnicianScore allAdminResult = restTemplate.exchange(gogirlProperties.getAdminBackendUrl(), HttpMethod.POST, monthHttpEntity, responseBodyType) AdminTechnicianScore allAdminResult = restTemplate.exchange(gogirlProperties.getAdminBackendUrl(), HttpMethod.POST, monthHttpEntity, responseBodyType)
.getBody() .getBody()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment