Commit c64f37d0 authored by matianhao's avatar matianhao

[资产资源接口] <update> 修改接口返回值类型

parent 3d77f7a7
...@@ -3,6 +3,7 @@ package com.mth.requestsecret.controller; ...@@ -3,6 +3,7 @@ package com.mth.requestsecret.controller;
import com.mth.requestsecret.service.RestTemplateService; import com.mth.requestsecret.service.RestTemplateService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -31,7 +32,7 @@ public class ZczyController { ...@@ -31,7 +32,7 @@ public class ZczyController {
* @return 解密后字符串 * @return 解密后字符串
*/ */
@PostMapping("/getProjectBaseInformation") @PostMapping("/getProjectBaseInformation")
public String getProjectBaseInformation(String startTime, String endTime) throws Exception { public ResponseEntity getProjectBaseInformation(String startTime, String endTime) throws Exception {
// api方法签名 // api方法签名
String apiMethod = "fGetProjectBaseInformation"; String apiMethod = "fGetProjectBaseInformation";
// api参数 // api参数
......
...@@ -250,7 +250,7 @@ public class RestTemplateService { ...@@ -250,7 +250,7 @@ public class RestTemplateService {
/** /**
* 资产资源接口 发送请求 * 资产资源接口 发送请求
*/ */
public String zczySendRequest(Map<String, String> paramMap, String apiMethod) throws Exception { public ResponseEntity<String> zczySendRequest(Map<String, String> paramMap, String apiMethod) throws Exception {
String url = zczyAddress + apiMethod; String url = zczyAddress + apiMethod;
log.info("资产资源api:{}", apiMethod); log.info("资产资源api:{}", apiMethod);
...@@ -273,6 +273,9 @@ public class RestTemplateService { ...@@ -273,6 +273,9 @@ public class RestTemplateService {
String decryptStr = decryptResponse.trim(); String decryptStr = decryptResponse.trim();
log.info("api response:{}", decryptStr); log.info("api response:{}", decryptStr);
return decryptStr; return ResponseEntity
.status(HttpStatus.OK)
.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
.body(decryptStr);
} }
} }
\ No newline at end of file
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