积分全量/批量操作
parent
efdaa52eb8
commit
9009f8b72b
@ -0,0 +1,69 @@
|
||||
package com.flossom.common.core.domain.req;
|
||||
|
||||
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 微信用户积分操作对象
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-14
|
||||
*/
|
||||
public class WxUserIntegralVm {
|
||||
|
||||
/**
|
||||
* 1-增加 2-减少
|
||||
*/
|
||||
@NotBlank(message = "请选择积分操作类型")
|
||||
private String source;
|
||||
|
||||
/**
|
||||
* 浮动分数
|
||||
*/
|
||||
@NotNull(message = "积分变动值不能为空")
|
||||
@Range(min = 0, max = 10000, message = "请正确输入积分变动值")
|
||||
private Long floatScore;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
@NotBlank(message = "请输入积分操作说明")
|
||||
private String remarkContent;
|
||||
|
||||
public WxUserIntegralVm() {
|
||||
}
|
||||
|
||||
public WxUserIntegralVm(String source, Long floatScore, String remarkContent) {
|
||||
this.source = source;
|
||||
this.floatScore = floatScore;
|
||||
this.remarkContent = remarkContent;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public Long getFloatScore() {
|
||||
return floatScore;
|
||||
}
|
||||
|
||||
public void setFloatScore(Long floatScore) {
|
||||
this.floatScore = floatScore;
|
||||
}
|
||||
|
||||
public String getRemarkContent() {
|
||||
return remarkContent;
|
||||
}
|
||||
|
||||
public void setRemarkContent(String remarkContent) {
|
||||
this.remarkContent = remarkContent;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.flossom.common.core.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 积分操作类型
|
||||
*
|
||||
* @author flossom
|
||||
*/
|
||||
public enum IntegralChangeTypeEnum {
|
||||
INCREASE("1", "增加"), REDUCE("2", "减少");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
IntegralChangeTypeEnum(String code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
public static Boolean isIntegralChangType(String code) {
|
||||
for (IntegralChangeTypeEnum typeEnum : IntegralChangeTypeEnum.values()) {
|
||||
if (typeEnum.getCode().equals(code)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue