mall + product:简化收藏逻辑,去掉 type 字段
parent
25bea4920c
commit
84b365a707
@ -1,36 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.product.enums.favorite;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品收藏的类型枚举
|
|
||||||
*
|
|
||||||
* @author jason
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@AllArgsConstructor
|
|
||||||
public enum ProductFavoriteTypeEnum implements IntArrayValuable {
|
|
||||||
|
|
||||||
COLLECT(1,"收藏"),
|
|
||||||
THUMBS_UP(2, "点赞");
|
|
||||||
|
|
||||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductFavoriteTypeEnum::getType).toArray();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类型
|
|
||||||
*/
|
|
||||||
private final Integer type;
|
|
||||||
/**
|
|
||||||
* 描述
|
|
||||||
*/
|
|
||||||
private final String desc;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] array() {
|
|
||||||
return ARRAYS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,22 +1,10 @@
|
|||||||
package cn.iocoder.yudao.module.product.controller.app.favorite.vo;
|
package cn.iocoder.yudao.module.product.controller.app.favorite.vo;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
|
||||||
import cn.iocoder.yudao.module.product.enums.favorite.ProductFavoriteTypeEnum;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
|
|
||||||
|
|
||||||
@Schema(description = "用户APP - 商品收藏分页查询 Request VO")
|
@Schema(description = "用户APP - 商品收藏分页查询 Request VO")
|
||||||
@Data
|
@Data
|
||||||
public class AppFavoritePageReqVO extends PageParam {
|
public class AppFavoritePageReqVO extends PageParam {
|
||||||
|
|
||||||
@Schema(description = "类型", requiredMode = REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "类型不能为空")
|
|
||||||
@InEnum(ProductFavoriteTypeEnum.class)
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue