package cn.reghao.tnb.content.app.vod.model.dto;

import cn.reghao.tnb.content.api.constant.PostScope;
import cn.reghao.tnb.content.api.constant.VideoStatus;
import lombok.Getter;

import java.util.List;

/**
 * @author reghao
 * @date 2023-11-19 20:44:31
 */
@Getter
public class SearchCriteria {
    private final List<Integer> status;
    private final List<Integer> scope;
    private final String title;
    private final Integer nextId;

    private SearchCriteria(Builder builder) {
        this.status = builder.status;
        this.scope = builder.scope;
        this.title = builder.title;
        this.nextId = builder.nextId;
    }

    public static final class Builder {
        private List<Integer> status;
        private List<Integer> scope;
        private String title;
        private Integer nextId;

        public Builder() {
            this.status = List.of(VideoStatus.publish.getCode(), VideoStatus.noVideoFile.getCode());
            this.scope = List.of(PostScope.PUBLIC.getCode());
        }

        public Builder status(List<Integer> status) {
            this.status = status;
            return this;
        }

        public Builder scope(List<Integer> scope) {
            this.scope = scope;
            return this;
        }

        public Builder title(String title) {
            this.title = title;
            return this;
        }

        public Builder nextId(int nextId) {
            this.nextId = nextId;
            return this;
        }

        public SearchCriteria build() {
            return new SearchCriteria(this);
        }
    }
}
