勋章保存

This commit is contained in:
2025-06-06 12:32:39 +08:00
parent fd61a178c0
commit 45f426e3b6
4 changed files with 42 additions and 2 deletions

View File

@@ -14,8 +14,13 @@ public class MedalAdminVo {
@I18n(className = "Medal")
@ApiModelProperty("名称")
private String name;
@I18n(className = "Medal")
@ApiModelProperty("描述")
private String medalDesc;
@ApiModelProperty("图片url")
private String picUrl;
@ApiModelProperty("mp4url")
private String mp4Url;
@ApiModelProperty("排序")
private Integer seq;
@ApiModelProperty("等级")

View File

@@ -75,7 +75,7 @@ public class MedalAdminService {
if (id == null) {
medal.setCreateTime(now);
}
I18NMessageSourceUtil.deserialization(medal, Collections.singletonList("name"));
I18NMessageSourceUtil.deserialization(medal, Arrays.asList("name", "medalDesc"));
//默认值
medal.setLevel((byte) 0);
medalService.saveOrUpdate(medal);

View File

@@ -0,0 +1,26 @@
package com.accompany.business.constant;
public interface MedalConstant {
enum MedalType {
TASK(1, "任务勋章"),
ACTIVITY(2, "活动勋章"),
HONOR(3, "荣耀勋章")
;
private Integer type;
private String desc;
MedalType(Integer type, String desc) {
this.type = type;
this.desc = desc;
}
public Integer getType() {
return type;
}
public String getDesc() {
return desc;
}
}
}

View File

@@ -1,5 +1,7 @@
package com.accompany.business.model;
import com.accompany.common.annotation.ReplaceAppDomain;
import com.accompany.core.annotation.I18n;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
@@ -7,19 +9,26 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
@ApiModel
@TableName("medal")
public class Medal {
public class Medal implements Serializable {
@TableId(type = IdType.AUTO)
private Integer id;
@I18n(className = "Medal", fieldName = "name")
private String name;
@I18n(className = "Medal", fieldName = "medalDesc")
private String medalDesc;
@ReplaceAppDomain
private String picUrl;
@ReplaceAppDomain
private String mp4Url;
private Integer seq;