v0.0.7
All checks were successful
CI/CD / build-deploy (pull_request) Successful in 1m40s

This commit is contained in:
Timi
2026-03-27 23:10:20 +08:00
parent 3a343724a8
commit d77cf10b1b
2 changed files with 3 additions and 7 deletions

View File

@@ -0,0 +1,47 @@
package com.imyeyu.spring.entity;
import com.imyeyu.java.bean.Language;
import com.imyeyu.java.ref.Ref;
import com.imyeyu.spring.annotation.table.AutoUUID;
import com.imyeyu.spring.annotation.table.Id;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 多语言实体基类
*
* @author 夜雨
* @since 2025-10-17 15:21
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class Multilingual extends Language implements IDEntity<String>, Creatable, Updatable, Deletable, Destroyable {
/** 唯一标识 */
@Id
@AutoUUID
protected String id;
/** 创建时间 */
protected Long createdAt;
/** 更新时间 */
protected Long updatedAt;
/** 删除时间 */
protected Long deletedAt;
/**
* 获取指定语言值
*
* @param language 指定语言
* @return 值
*/
public String getValue(Language.Enum language) {
try {
return Ref.getFieldValue(this, language.toString().replace("_", ""), String.class);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
}