package com.ruoyi.common.pay.ali.enums;

import com.ruoyi.common.utils.collection.CollectionUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author wjh
 * 2024/12/10
 */
@Getter
@AllArgsConstructor
public enum AliTradeStatusEnum {

    WAIT_BUYER_PAY("WAIT_BUYER_PAY", "交易创建，等待买家付款"),
    TRADE_CLOSED("TRADE_CLOSED", "未付款交易超时关闭，或支付完成后全额退款"),
    TRADE_SUCCESS("TRADE_SUCCESS", "交易支付成功"),
    TRADE_FINISHED("TRADE_FINISHED", "交易结束，不可退款");

    private String status;
    private String msg;

    /**
     * 通知成功的交易状态
     */
    public static List<String> notifySuccessList() {
        return CollectionUtils.map(AliTradeStatusEnum::getStatus, TRADE_SUCCESS, TRADE_FINISHED);
    }

}
