外部化java包装器
我开发了一个应用程序spring boot。为了发出REST请求,我创建了许多类似于此片段的映射器外部化java包装器,java,spring,rest,spring-boot,wrapper,Java,Spring,Rest,Spring Boot,Wrapper,我开发了一个应用程序spring boot。为了发出REST请求,我创建了许多类似于此片段的映射器 .... @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) public class IssueFieldsWrapper { @JsonProperty("description") private String description; @Js
....
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class IssueFieldsWrapper {
@JsonProperty("description")
private String description;
@JsonProperty("customfield_10406")
private String mobileNumber;
....
}
问题是生产环境没有相同的JsonProperties(customfield_10406)。例如,Prod中的mobileNumber具有属性“customfield_10500”,我应该这样声明它
@JsonProperty("customfield_10500")
private String mobileNumber;
你有什么建议吗
致以最诚挚的问候您可以将文字存储到特定于环境的属性文件中,并从中获取它们(通过自动连接的环境对象)。谢谢@Sorin我不知道如何处理。你能举个例子吗?如果你在生产中运行任意两个单独的时间,这个“customfield_10406”会保持不变吗?如果你在生产中运行任意两个单独的时间,这个“customfield_10406”会保持不变吗?是的,它是相同的属性,但当我在Prod中发出请求时,我会得到一个属性为“customfield_10500”的JSON但在开发环境中,我得到了id为“customfield_10406”的文本。您可以将文本存储到特定于环境的属性文件中,并从中获取它们(通过自动连接的环境对象),谢谢@Sorin我不知道如何处理。你能举个例子吗?如果你在生产中运行任意两个单独的时间,这个“customfield_10406”会保持不变吗?如果你在生产中运行任意两个单独的时间,这个“customfield_10406”会保持不变吗?是的,它是相同的属性,但当我在Prod中发出请求时,我会得到一个属性为“customfield_10500”的JSON但在开发环境中,我得到的id是“customfield_10406”。