package com.cyksj.model.views;

import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.DbIgnore;
import com.ejlchina.searcher.bean.SearchBean;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.Set;

/*
 *项目名: yicang-admin
 *文件名: CmsUserVO
 *创建者: JavaZou
 *创建时间:2022/9/30 13:34
 */
@Getter
@Setter
@SearchBean(tables = " cms_user cu left join `cms_user_role` cur on cur.user_id = cu.id" +
		" left join `cms_role` cr on cr.id = cur.role_id"
		, groupBy = "cu.id, cu.nickname,cu.phone, cu.add_name, cu.modified_by, cu.status, cu.created_time,cu.update_time")
public class CmsUserVO {
	@DbField("cu.id")
	private Long id;

	/**
	 * 用户名称
	 */
	@DbField("cu.nickname")
	private String nickname;

	@DbField("cu.phone")
	private String phone;

	/**
	 * 角色名称
	 */
	@DbField("group_concat(cr.role_name)")
	private String roleNames;

	@DbField("group_concat(cr.id)")
	private String roleIds;

	@DbIgnore
	private String token;

	@DbField("cu.status")
	private Boolean status;

	/**
	 * 添加人
	 */
	@DbField("cu.add_name")
	private String addName;

	/**
	 * 修改人
	 */
	@DbField("cu.modified_by")
	private String modifiedBy;

	@DbField("cu.auth_id")
	private String authId;

	/**
	 * 权限列表
	 */
	@DbIgnore
	private Set<String> permissions;

	/**
	 * 角色列表
	 */
	@DbIgnore
	private Set<String> roles;

	@DbField("cu.created_time")
	private Date createdTime;

	@DbField("cu.update_time")
	private Date updateTime;
}
