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