Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Random;

public class Main {
    private static final String[] BEECLOUD_HOSTS = { "https://apibj.beecloud.cn", "https://apisz.beecloud.cn",
            "https://apiqd.beecloud.cn", "https://apihz.beecloud.cn" };
    private static final String HOST_API_VERSION = "/2/";
    private static final String REFUNDS_QUERY_URL = "rest/refunds?para=";

    public static String getRefundsQueryURL() {
        return getRandomHost() + REFUNDS_QUERY_URL;
    }

    private static String getRandomHost() {
        Random r = new Random();
        return BEECLOUD_HOSTS[r.nextInt(BEECLOUD_HOSTS.length)] + HOST_API_VERSION;
    }
}