package com.yonge.cooleshow.tenant.vo;

import com.alibaba.fastjson.JSON;
import com.microsvc.toolkit.common.response.paging.QueryInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * 机构小组表
 * 2023-10-11 09:24:50
 */
@ApiModel(value = "TenantGroupVo对象", description = "机构小组表查询视图对象")
public class TenantGroupVo {

    @Data
    @ApiModel(" TenantGroupQuery-机构小组表")
    public static class TenantGroupQuery implements QueryInfo {

        @ApiModelProperty("当前页")
        private Integer page;

        @ApiModelProperty("分页行数")
        private Integer rows;

        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public static TenantGroupQuery from(String json) {
            return JSON.parseObject(json, TenantGroupQuery.class);
        }
    }

    @Data
    @ApiModel(" TenantGroup-机构小组表")
    public static class TenantGroup {

        @ApiModelProperty("主键ID")
        private Long id;

        @ApiModelProperty("机构ID")
        private Long tenantId;

        @ApiModelProperty("小组名称")
        @NotNull(message = "小组名称不能为空")
        private String name;

        @ApiModelProperty("小组负责人")
        @NotNull(message = "小组负责人不能为空")
        private Long adminId;

        @ApiModelProperty("群成员列表")
        private List<Long> userIds = new ArrayList<>();

        @ApiModelProperty("是否创建群聊")
        private Boolean imGroupCreate = false;

        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public static TenantGroup from(String json) {
            return JSON.parseObject(json, TenantGroup.class);
        }
    }

}