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

import cn.reghao.tnb.common.auth.UserContext;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * @author reghao
 * @date 2023-09-18 11:36:52
 */
@Setter
@Getter
public class AlbumQuery {
    private Integer postType;
    private List<Integer> scope;
    private Long createBy;
    private Long albumId;
    private Integer pn;

    public AlbumQuery() {
        this.createBy = UserContext.getUserId();
        this.pn = 1;
    }

    private AlbumQuery(Builder builder) {
        this.postType = builder.postType;
        this.scope = builder.scope;
        this.createBy = builder.createBy;
        this.albumId = builder.albumId;
    }

    public static final class Builder {
        private Integer postType;
        List<Integer> scope;
        private Long createBy;
        private Long albumId;

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

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

        public Builder createBy(long createBy) {
            this.createBy = createBy;
            return this;
        }

        public Builder albumId(long albumId) {
            this.albumId = albumId;
            return this;
        }

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