package com.microservices.zone.member.domain.vo;

import com.microservices.common.core.utils.StringUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author otto
 */

@Data
@ApiModel("GitLink用户搜索对象")
public class GitLinkUserSearchVo {
    @ApiModelProperty(value = "搜索关键字")
    private String search;
    @ApiModelProperty(value = "页码")
    private Long page;
    @ApiModelProperty(value = "每页数量")
    private Long limit;

    public String genQueryString() {
        StringBuilder stringBuilder = new StringBuilder("?");
        if (page != null) {
            stringBuilder.append("page=" + page);
        }
        if (limit != null) {
            stringBuilder.append("&limit=" + limit);
        }

        if (StringUtils.isNotEmpty(search)) {
            stringBuilder.append("&search=" + search);
        }
        return stringBuilder.toString();
    }
}
