响应类型包装

This commit is contained in:
shikong 2023-08-18 17:17:19 +08:00
parent b083222690
commit 9284a33c85
2 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package cn.skcks.docking.gb28181.media.dto.response;
import cn.skcks.docking.gb28181.common.json.JsonResponse;
import cn.skcks.docking.gb28181.common.json.JsonUtils;
import cn.skcks.docking.gb28181.media.dto.status.ResponseStatus;
import io.swagger.v3.oas.annotations.media.Schema;
@ -24,4 +25,8 @@ public class ZlmResponse<T> {
public String toString(){
return JsonUtils.toJson(this);
}
public JsonResponse<T> getJsonResponse(){
return ZlmResponseConvertor.INSTANCE.toJsonResponse(this);
}
}

View File

@ -43,7 +43,7 @@ public class MediaServiceTest {
log.info("{}", entity.getBody());
ZlmResponse<List<ServerConfig>> test = zlMediaHttpService.getServerConfig(secret);
JsonResponse<List<ServerConfig>> jsonResponse = ZlmResponseConvertor.INSTANCE.toJsonResponse(test);
JsonResponse<List<ServerConfig>> jsonResponse = test.getJsonResponse();
log.info("{}", jsonResponse);
ZlmResponse<List<ServerConfig>> zlmResponse = ZlmResponseConvertor.INSTANCE.toZlmResponse(jsonResponse);