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

import com.alibaba.cola.dto.DTO;
import com.xunhong.erp.turbo.api.rbac.dto.vo.PermissionVO;
import com.xunhong.erp.turbo.api.rbac.dto.vo.UserRoleVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * @author shenyifei
 */
@Data
@Schema(title = "账号密码注册响应")
@EqualsAndHashCode(callSuper = true)
public class UserAuthVO extends DTO {
	@Schema(title = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, type = "string")
	private Long userId;

	@Schema(title = "用户信息", requiredMode = Schema.RequiredMode.REQUIRED)
	private UserVO userVO;

	@Schema(title = "用户角色信息", requiredMode = Schema.RequiredMode.REQUIRED)
	private List<UserRoleVO> userRoleVOList;

	@Schema(title = "权限信息", requiredMode = Schema.RequiredMode.REQUIRED)
	private List<PermissionVO> permissionVOList;

//    @Schema(title = "商家应用", requiredMode = Schema.RequiredMode.REQUIRED)
//    private List<MerchantAppVO> merchantAppList;

	@Schema(title = "META扩展", requiredMode = Schema.RequiredMode.REQUIRED)
	private Meta meta;

	@Data
	@Schema(title = "META扩展")
	@EqualsAndHashCode(callSuper = true)
	public static class Meta extends DTO {
		@Schema(title = "TOKEN")
		private String accessToken;

		@Schema(title = "TOKEN类型")
		private String tokenType;

		@Schema(title = "过期时间")
		private Long expiresIn;
	}
}
