package com.yonge.cooleshow.config;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.Optional;

/**
 * 应用配置项
 * Created by Eric.Shang on 2023/9/13.
 */
@ConfigurationProperties(prefix = "app-config.url")
@Configuration
@Data
public class AppConfigProperties {

    @ApiModelProperty("后台")
    private String admin;

    @ApiModelProperty("老师端")
    private String teacher;

    @ApiModelProperty("学生端")
    private String student;

    @ApiModelProperty("官网")
    private String website;

    @ApiModelProperty("网络教室")
    private String classroom;

    @ApiModelProperty("机构端")
    private String tenant;

    public String getAdmin() {
        return Optional.ofNullable(admin).orElse("");
    }

    public String getTeacher() {
        return Optional.ofNullable(teacher).orElse("");
    }

    public String getStudent() {
        return Optional.ofNullable(student).orElse("");
    }

    public String getWebsite() {
        return Optional.ofNullable(website).orElse("");
    }

    public String getClassroom() {
        return Optional.ofNullable(classroom).orElse("");
    }

    public String getTenant() {
        return Optional.ofNullable(tenant).orElse("");
    }
}
