feat(tenant): 实现多租户功能支持
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
package com.youlai.boot.system.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.youlai.boot.common.base.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 租户实体
|
||||
*
|
||||
* @author Ray.Hao
|
||||
* @since 3.0.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_tenant")
|
||||
public class Tenant extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 租户名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 租户编码(唯一)
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 联系人姓名
|
||||
*/
|
||||
private String contactName;
|
||||
|
||||
/**
|
||||
* 联系人电话
|
||||
*/
|
||||
private String contactPhone;
|
||||
|
||||
/**
|
||||
* 联系人邮箱
|
||||
*/
|
||||
private String contactEmail;
|
||||
|
||||
/**
|
||||
* 租户域名(用于域名识别)
|
||||
*/
|
||||
private String domain;
|
||||
|
||||
/**
|
||||
* 租户Logo
|
||||
*/
|
||||
private String logo;
|
||||
|
||||
/**
|
||||
* 状态(1-正常 0-禁用)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 过期时间(NULL表示永不过期)
|
||||
*/
|
||||
private LocalDateTime expireTime;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.youlai.boot.system.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.youlai.boot.common.base.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 用户租户关联实体
|
||||
*
|
||||
* @author Ray.Hao
|
||||
* @since 3.0.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_user_tenant")
|
||||
public class UserTenant extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 是否默认租户(1-是 0-否)
|
||||
*/
|
||||
private Integer isDefault;
|
||||
}
|
||||
|
||||
48
src/main/java/com/youlai/boot/system/model/vo/TenantVO.java
Normal file
48
src/main/java/com/youlai/boot/system/model/vo/TenantVO.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.youlai.boot.system.model.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 租户VO
|
||||
*
|
||||
* @author Ray.Hao
|
||||
* @since 3.0.0
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "租户信息")
|
||||
public class TenantVO implements Serializable {
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "租户名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "租户编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "租户状态(1-正常 0-禁用)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "联系人姓名")
|
||||
private String contactName;
|
||||
|
||||
@Schema(description = "联系人电话")
|
||||
private String contactPhone;
|
||||
|
||||
@Schema(description = "联系人邮箱")
|
||||
private String contactEmail;
|
||||
|
||||
@Schema(description = "租户域名")
|
||||
private String domain;
|
||||
|
||||
@Schema(description = "租户Logo")
|
||||
private String logo;
|
||||
|
||||
@Schema(description = "是否默认租户")
|
||||
private Boolean isDefault;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user