package com.microservices.pms.project.domain.vo;

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

@Data
@ApiModel("项目工作项搜索对象")
public class PmsProjectIssuesSearchVo {

    @ApiModelProperty(value = "项目id", required = true)
    private String pmProjectId;

    @ApiModelProperty(value = "项目迭代id")
    private String pmSprintId;

    @ApiModelProperty(value = "需求1 任务2 缺陷3")
    private String pmIssueType;

    @ApiModelProperty(value = "工作项类型：需求1 任务2 缺陷3，多个用逗号隔开")
    private String pmIssueTypes;

    @ApiModelProperty(value = "疑修类型，all 全部 opened 开启中 closed 已关闭", required = true)
    private String category;

    @ApiModelProperty(value = "参与类型，all 全部 aboutme 关于我的 authoredme 我创建的 assignedme 我负责的 atme @我的", required = true)
    private String participantCategory;

    @ApiModelProperty(value = "工作项名称搜索关键词")
    private String keyword;

    @ApiModelProperty(value = "发布人用户ID")
    private String authorId;

    @ApiModelProperty(value = "状态值，可多个状态逗号隔开")
    private String statusIds;

    @ApiModelProperty(value = "状态值")
    private String statusId;

    @ApiModelProperty(value = "优先级")
    private String priorityId;

    @ApiModelProperty(value = "标记ID，支持多个用,隔开")
    private String issueTagIds;

    @ApiModelProperty(value = "负责人id")
    private String assignerId;

    @ApiModelProperty(value = "排序方式: issues.updated_on 更新时间 issues.created_on 创建时间 issue_priorities.position 优先级")
    private String sortBy;

    @ApiModelProperty(value = "排序方向:asc 正序 desc 倒序")
    private String sortDirection;

    @ApiModelProperty(value = "页码", required = true)
    private String page;

    @ApiModelProperty(value = "分页数", required = true)
    private String limit;

    @ApiModelProperty(value = "仓库id")
    private String projectId;

    @ApiModelProperty(value = "工作项父id")
    private String rootId;

    @ApiModelProperty(value = "按id集合查询,逗号隔开")
    private String ids;

    @ApiModelProperty(value = "排除id集合查询,逗号隔开")
    private String excludeIds;

    @ApiModelProperty(value = "按pmProjectId集合查询,逗号隔开", hidden = true)
    private String pmProjectIds;

    @ApiModelProperty(value = "开始时间-创建")
    private String beginDate;

    @ApiModelProperty(value = "结束时间-创建")
    private String endDate;

    @ApiModelProperty(value = "开始时间-更新")
    private String updateBeginDate;

    @ApiModelProperty(value = "结束时间-更新")
    private String updateEndDate;

    @ApiModelProperty(value = "与用户ID相关(gitlinkUserId)")
    private String participatorId;

    public void setKeyword(String keyword) {
        this.keyword = ServletUtils.urlDecode(keyword);
    }
}
