package ink.wgink.gateway.pojo.route;

import ink.wgink.gateway.annoation.CheckEmptyAnnotation;
import ink.wgink.gateway.dao.route.IRouteDao;
import ink.wgink.gateway.pojo.BasePOJO;
import lombok.Data;
import lombok.ToString;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: RouteDTO
 * @Description: 路由
 * @Author: wanggeng
 * @Date: 2021/4/13 7:15 下午
 * @Version: 1.0
 */
@Document(collection = IRouteDao.COLLECTION_NAME)
public class Route extends BasePOJO implements Serializable {

    private static final long serialVersionUID = -4892456861969101733L;
    @CheckEmptyAnnotation(name = "名称")
    private String title;
    @CheckEmptyAnnotation(name = "说明")
    private String summary;
    @CheckEmptyAnnotation(name = "映射路径", verifyType = "path")
    private String path;
    @CheckEmptyAnnotation(name = "被映射服务", verifyType = "url")
    private String uri;
    @CheckEmptyAnnotation(name = "测试接口", verifyType = "path")
    private String testPath;
    private String routeType;
    private String setPath;

    public String getTitle() {
        return title == null ? "" : title.trim();
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSummary() {
        return summary == null ? "" : summary.trim();
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public String getPath() {
        return path == null ? "" : path.trim();
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getUri() {
        return uri == null ? "" : uri.trim();
    }

    public void setUri(String uri) {
        this.uri = uri;
    }

    public String getTestPath() {
        return testPath == null ? "" : testPath.trim();
    }

    public void setTestPath(String testPath) {
        this.testPath = testPath;
    }

    public String getRouteType() {
        return routeType == null ? "" : routeType;
    }

    public void setRouteType(String routeType) {
        this.routeType = routeType;
    }

    public String getSetPath() {
        return setPath == null ? "" : setPath;
    }

    public void setSetPath(String setPath) {
        this.setPath = setPath;
    }
}
