package com.xunhong.erp.turbo.api.rbac.dto.vo;


import com.alibaba.cola.dto.DTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xunhong.erp.turbo.api.infra.dto.vo.PlatformVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;
import java.util.List;

@Data
@Schema(title = "角色")
@EqualsAndHashCode(callSuper = true)
public class RoleVO extends DTO {

	/**
	 * 角色id
	 */
	@Schema(title = "角色id", requiredMode = Schema.RequiredMode.REQUIRED, type = "string")
	private Long roleId;

	/**
	 * 标识
	 */
	@Schema(title = "标识", requiredMode = Schema.RequiredMode.REQUIRED)
	private String slug;

	/**
	 * 名称
	 */
	@Schema(title = "名称", requiredMode = Schema.RequiredMode.REQUIRED)
	private String name;


	/**
	 * 类型
	 */
	@Schema(title = "类型", requiredMode = Schema.RequiredMode.REQUIRED)
	private String type;

	/**
	 * 描述
	 */
	@Schema(title = "描述")
	private String description;

	/**
	 * 平台id
	 */
	@Schema(title = "平台id", requiredMode = Schema.RequiredMode.REQUIRED, type = "string")
	private Long platformId;

	@Schema(title = "平台")
	private PlatformVO platformVO;

	/**
	 * 权限列表
	 */
	@Schema(title = "权限列表", requiredMode = Schema.RequiredMode.REQUIRED)
//    @JsonSerialize(using = LongListToStringListSerializer.class)
	private List<Long> permissionId;

	/**
	 * 菜单列表
	 */
	@Schema(title = "菜单列表", requiredMode = Schema.RequiredMode.REQUIRED)
//    @JsonSerialize(using = LongListToStringListSerializer.class)
	private List<Long> menuId;

	@Schema(title = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
	private LocalDateTime createdAt;
}
