zhaowenyu
2025-12-02 a737ae8e1253ce4883a3c5c91f10f83ad3ac8a52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.ard.ossdock.service.impl;
 
import com.ard.ossdock.config.OssDockConfiguration;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
/**
 * @author sean
 * @version 1.1
 * @date 2022/6/20
 */
@Component
@Aspect
public class OssDockAspectHandler {
 
    @Autowired
    private OssDockServiceContext ossDockServiceContext;
 
    @Before("execution(public * com.ard.ossdock.service.impl.OssDockServiceContext.*(..))")
    public void before() {
        if (!OssDockConfiguration.enable) {
            throw new IllegalArgumentException("Please enable OssConfiguration.");
        }
        if (this.ossDockServiceContext.getOssService() == null) {
            throw new IllegalArgumentException("Please check the OssConfiguration configuration.");
        }
        this.ossDockServiceContext.createClient();
    }
}