package com.izouma.nineth;


import com.alibaba.fastjson.JSON;
import com.aliyun.cdn20180510.Client;
import com.aliyun.cdn20180510.models.RefreshObjectCachesRequest;
import com.aliyun.cdn20180510.models.RefreshObjectCachesResponse;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

@Slf4j
public class CDNTest extends ApplicationTests {
    @Autowired
    private Client cdnClient;

    @Test
    public void testCdnRefresh() throws Exception {
        RefreshObjectCachesRequest refreshObjectCachesRequest = new RefreshObjectCachesRequest();
        refreshObjectCachesRequest.setObjectPath("cdn.raex.vip/user/avatar/2022-04-27-16-37-09dvFjvMgW.jpg");
        RefreshObjectCachesResponse resp = cdnClient.refreshObjectCaches(refreshObjectCachesRequest);
        log.info(JSON.toJSONString(resp, true));
    }
}
