헤더 또는 쿼리 Param에 = 사용 가능하도록 변경
This commit is contained in:
@@ -32,6 +32,6 @@ public class ApiRequestKeyValueDTO {
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return (enabled?"":"//")+ key + "=" + value;
|
||||
return (enabled?"":"//")+ key + "::" + value;
|
||||
}
|
||||
}
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.eactive.httpmockserver.client.service;
|
||||
|
||||
import com.eactive.httpmockserver.client.repository.ApiRequestRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
public class ApiRequestMigrationService {
|
||||
|
||||
@Autowired
|
||||
ApiRequestRepository apiRequestRepository;
|
||||
|
||||
@EventListener(ApplicationReadyEvent.class)
|
||||
public void migrate() {
|
||||
apiRequestRepository.findAll().forEach(apiRequest -> {
|
||||
|
||||
apiRequest.setHeaders(apiRequest.getHeaders().replaceAll("=", "::"));
|
||||
apiRequest.setQueryParams(apiRequest.getQueryParams().replaceAll("=", "::"));
|
||||
|
||||
apiRequestRepository.save(apiRequest);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public class CommonMapper {
|
||||
} else {
|
||||
dto.setEnabled(true);
|
||||
}
|
||||
String[] keyValueArray = pair.split("=");
|
||||
String[] keyValueArray = pair.split("::");
|
||||
if (keyValueArray.length == 2) {
|
||||
dto.setKey(keyValueArray[0]);
|
||||
dto.setValue(keyValueArray[1]);
|
||||
|
||||
Reference in New Issue
Block a user