ProductCategory获取不到fix
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.aida.seller.module.listing.enums;
|
package com.aida.seller.module.listing.enums;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
import com.fasterxml.jackson.annotation.JsonValue;
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@@ -22,12 +23,13 @@ public enum ProductCategoryEnum {
|
|||||||
private final String code;
|
private final String code;
|
||||||
private final String desc;
|
private final String desc;
|
||||||
|
|
||||||
|
@JsonCreator
|
||||||
public static ProductCategoryEnum of(String code) {
|
public static ProductCategoryEnum of(String code) {
|
||||||
if (code == null) {
|
if (code == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
for (ProductCategoryEnum value : values()) {
|
for (ProductCategoryEnum value : values()) {
|
||||||
if (value.code.equals(code)) {
|
if (value.code.equalsIgnoreCase(code)) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user