TASK:模块化;

This commit is contained in:
shahaibo
2025-04-01 15:20:59 +08:00
parent 03f3162dc1
commit 913c4c1ece
5 changed files with 41 additions and 5 deletions

View File

@@ -40,4 +40,6 @@ public class LibraryUploadDTO {
private String modelSex;
private String ageGroup;
}

View File

@@ -0,0 +1,31 @@
package com.ai.da.model.enums;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Data;
public enum AgeGroup implements IEnumDisplay {
ADULT("Adult"),
CHILD("Child")
;
private String value;
AgeGroup(String value) {
this.value = value;
}
@Override
@JsonValue
public String getValue() {
return this.value;
}
public static AgeGroup getAgeGroup(String value) {
for (AgeGroup group : values()) {
if (group.value.equalsIgnoreCase(value)) {
return group;
}
}
throw new IllegalArgumentException("No matching constant for [" + value + "]");
}
}