package com.ruoyi.web.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.Lists;
import com.ruoyi.common.utils.StringUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Arrays;
import java.util.List;

public class CategoryDto {
    @Data
    @ApiModel("用户选择专业类")
    public static class UserCategory {
        @ApiModelProperty("专业代码")
        String majorCategoryCode;
        @ApiModelProperty("测试id")
        Long examineeId;
        @ApiModelProperty("1价值2职业3知识")
        Integer testType;

        @JsonIgnore
        public List<String> getCodes() {
            return StringUtils.isNotBlank(majorCategoryCode) ? Arrays.asList(majorCategoryCode.split(",")) : Lists.newArrayList();
        }
    }

    @Data
    @ApiModel("用户选择专业")
    public static class UserMajor {
        @ApiModelProperty("专业代码")
        String majorCode;
        @ApiModelProperty("1价值2职业3知识")
        Integer testType;

        @JsonIgnore
        public List<String> getCodes() {
            return StringUtils.isNotBlank(majorCode) ? Arrays.asList(majorCode.split(",")) : Lists.newArrayList();
        }
    }
}
