package com.cm.common.config.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName: AccessControl
 * @Description: 访问控制
 * @Author: WangGeng
 * @Date: 2019-06-12 22:01
 * @Version: 1.0
 **/
@Component
@ConfigurationProperties(prefix = "access-control")
public class AccessControl {

    private List<String> passPaths = new ArrayList<>(0);
    private List<String> savePaths = new ArrayList<>(0);
    private List<String> deletePaths = new ArrayList<>(0);
    private List<String> updatePaths = new ArrayList<>(0);
    private List<String> queryPaths = new ArrayList<>(0);

    public List<String> getPassPaths() {
        return passPaths;
    }

    public void setPassPaths(List<String> passPaths) {
        this.passPaths = passPaths;
    }

    public List<String> getSavePaths() {
        return savePaths;
    }

    public void setSavePaths(List<String> savePaths) {
        this.savePaths = savePaths;
    }

    public List<String> getDeletePaths() {
        return deletePaths;
    }

    public void setDeletePaths(List<String> deletePaths) {
        this.deletePaths = deletePaths;
    }

    public List<String> getUpdatePaths() {
        return updatePaths;
    }

    public void setUpdatePaths(List<String> updatePaths) {
        this.updatePaths = updatePaths;
    }

    public List<String> getQueryPaths() {
        return queryPaths;
    }

    public void setQueryPaths(List<String> queryPaths) {
        this.queryPaths = queryPaths;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"passPaths\":")
                .append(passPaths);
        sb.append(",\"savePaths\":")
                .append(savePaths);
        sb.append(",\"deletePaths\":")
                .append(deletePaths);
        sb.append(",\"updatePaths\":")
                .append(updatePaths);
        sb.append(",\"queryPaths\":")
                .append(queryPaths);
        sb.append('}');
        return sb.toString();
    }
}
