|
|
@ -10,17 +10,28 @@ import org.jetbrains.exposed.sql.`java-time`.CurrentTimestamp |
|
|
|
import org.jetbrains.exposed.sql.`java-time`.datetime |
|
|
|
import org.jetbrains.exposed.sql.`java-time`.datetime |
|
|
|
import java.time.LocalDateTime |
|
|
|
import java.time.LocalDateTime |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
open class Person:IntIdTable(){ |
|
|
|
@TableComment("用户") |
|
|
|
|
|
|
|
object Users: IntIdTable(){ |
|
|
|
|
|
|
|
@TableComment("学号") |
|
|
|
|
|
|
|
val studentId:Column<String> = varchar(name="student_id",length = 8).uniqueIndex() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@TableComment("姓名") |
|
|
|
@TableComment("姓名") |
|
|
|
val name:Column<String> = varchar(name="name",length = 10) |
|
|
|
val name:Column<String> = varchar(name="name",length = 10) |
|
|
|
|
|
|
|
|
|
|
|
@TableComment("密码") |
|
|
|
@TableComment("密码") |
|
|
|
val password:Column<String> = varchar(name="password",length = 32) |
|
|
|
val password:Column<String> = varchar(name="password",length = 32) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@TableComment("个人简介") |
|
|
|
|
|
|
|
val desc:Column<String> = varchar(name="desc",length = 20).default("") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@TableComment("头像") |
|
|
|
|
|
|
|
val imgId:Column<EntityID<Int>?> = reference("img_id", ImageFiles).nullable() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@TableComment("用户") |
|
|
|
|
|
|
|
object Users: Person(){ |
|
|
|
|
|
|
|
@TableComment("学号") |
|
|
|
|
|
|
|
val studentId:Column<String> = varchar(name="student_id",length = 8).uniqueIndex() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@TableComment("社团成员id") |
|
|
|
|
|
|
|
val associationMemberId:Column<EntityID<Int>?> = reference("association_member_id", AssociationMembers).nullable() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class User(id:EntityID<Int>):IntEntity(id){ |
|
|
|
class User(id:EntityID<Int>):IntEntity(id){ |
|
|
@ -28,8 +39,33 @@ class User(id:EntityID<Int>):IntEntity(id){ |
|
|
|
var studentId by Users.studentId |
|
|
|
var studentId by Users.studentId |
|
|
|
var name by Users.name |
|
|
|
var name by Users.name |
|
|
|
var password by Users.password |
|
|
|
var password by Users.password |
|
|
|
|
|
|
|
var desc by Users.desc |
|
|
|
|
|
|
|
val headImg by ImageFile optionalReferencedOn Users.imgId |
|
|
|
|
|
|
|
var associationMember by AssociationMember optionalReferencedOn Users.associationMemberId |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@TableComment("后台管理员") |
|
|
|
|
|
|
|
object Managers:Person(){ |
|
|
|
|
|
|
|
@TableComment("帐号") |
|
|
|
|
|
|
|
val account:Column<String> = varchar(name="account",length=10) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@TableComment("职务") |
|
|
|
|
|
|
|
val duty:Column<String> = varchar(name="duty",length = 32) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Manager(id:EntityID<Int>):IntEntity(id){ |
|
|
|
|
|
|
|
companion object:IntEntityClass<Manager>(Managers) |
|
|
|
|
|
|
|
var account by Managers.account |
|
|
|
|
|
|
|
var password by Managers.password |
|
|
|
|
|
|
|
var duty by Managers.duty |
|
|
|
|
|
|
|
var desc by Managers.desc |
|
|
|
|
|
|
|
var name by Managers.name |
|
|
|
|
|
|
|
val headImg by ImageFile optionalReferencedOn Managers.imgId |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
open class BaseTokens:IntIdTable(){ |
|
|
|
open class BaseTokens:IntIdTable(){ |
|
|
|
@TableComment("令牌") |
|
|
|
@TableComment("令牌") |
|
|
|
val token:Column<String> = varchar(name="token",length = 32) |
|
|
|
val token:Column<String> = varchar(name="token",length = 32) |
|
|
@ -118,22 +154,25 @@ class ImageFile(id:EntityID<Int>):IntEntity(id){ |
|
|
|
var createTime by ImageFiles.createTime |
|
|
|
var createTime by ImageFiles.createTime |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@TableComment("社团") |
|
|
|
@TableComment("社团信息") |
|
|
|
object Associations:IntIdTable(){ |
|
|
|
object Associations:IntIdTable(){ |
|
|
|
@TableComment("社团名称") |
|
|
|
@TableComment("社团名称") |
|
|
|
val name:Column<String> =varchar(name = "name",length = 10) |
|
|
|
val name:Column<String> = varchar(name = "name", length = 10) |
|
|
|
|
|
|
|
|
|
|
|
@TableComment("社团介绍") |
|
|
|
@TableComment("社团介绍") |
|
|
|
val desc:Column<String> =varchar(name = "desc",length = 30) |
|
|
|
val desc:Column<String> = varchar(name = "desc", length = 30) |
|
|
|
|
|
|
|
|
|
|
|
@TableComment("社团logo") |
|
|
|
@TableComment("社团logo") |
|
|
|
val logo:Column<EntityID<Int>> = reference("logo",ImageFiles) |
|
|
|
val logo:Column<EntityID<Int>> = reference("logo", ImageFiles) |
|
|
|
|
|
|
|
|
|
|
|
@TableComment("社团审核状态") |
|
|
|
@TableComment("审核信息") |
|
|
|
val status:Column<Boolean> = bool(name="status").default(false) |
|
|
|
val logId:Column<EntityID<Int>> = reference("log_id",AuditLeggings) |
|
|
|
|
|
|
|
|
|
|
|
@TableComment("创建人") |
|
|
|
@TableComment("社团级别") |
|
|
|
val user:Column<EntityID<Int>> = reference("user_id",Users) |
|
|
|
val level:Column<String?> = varchar(name="level",length = 1).nullable() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@TableComment("所属院系") |
|
|
|
|
|
|
|
val faculty:Column<String> = varchar(name="faculty",length = 20) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class Association(id:EntityID<Int>):IntEntity(id){ |
|
|
|
class Association(id:EntityID<Int>):IntEntity(id){ |
|
|
@ -141,57 +180,64 @@ class Association(id:EntityID<Int>):IntEntity(id){ |
|
|
|
var name by Associations.name |
|
|
|
var name by Associations.name |
|
|
|
var desc by Associations.desc |
|
|
|
var desc by Associations.desc |
|
|
|
var logo by ImageFile referencedOn Associations.logo |
|
|
|
var logo by ImageFile referencedOn Associations.logo |
|
|
|
var status by Associations.status |
|
|
|
var log by AuditLogging referencedOn Associations.logId |
|
|
|
var user by User referencedOn Associations.user |
|
|
|
val level by Associations.level |
|
|
|
|
|
|
|
var faculty by Associations.faculty |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@TableComment("后台管理员") |
|
|
|
@TableComment("社团成员信息") |
|
|
|
object Managers:IntIdTable(){ |
|
|
|
object AssociationMembers:IntIdTable(){ |
|
|
|
@TableComment("帐号") |
|
|
|
@TableComment("社团Id") |
|
|
|
val account:Column<String> = varchar(name="account",length=10) |
|
|
|
val associationId:Column<EntityID<Int>> = reference("association_id",Associations) |
|
|
|
|
|
|
|
|
|
|
|
@TableComment("密码") |
|
|
|
|
|
|
|
val password:Column<String> = varchar(name="password",length = 32) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@TableComment("职务") |
|
|
|
|
|
|
|
val duty:Column<String> = varchar(name="duty",length = 32) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@TableComment("等级") |
|
|
|
@TableComment("是否团长") |
|
|
|
val level:Column<Int> = integer("level") |
|
|
|
val isHead:Column<Boolean> = bool("is_head") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class Manager(id:EntityID<Int>):IntEntity(id){ |
|
|
|
class AssociationMember(id:EntityID<Int>):IntEntity(id) { |
|
|
|
companion object:IntEntityClass<Manager>(Managers) |
|
|
|
companion object : IntEntityClass<AssociationMember>(AssociationMembers) |
|
|
|
var account by Managers.account |
|
|
|
var association by Association referencedOn AssociationMembers.associationId |
|
|
|
var password by Managers.password |
|
|
|
var isHead by AssociationMembers.isHead |
|
|
|
var duty by Managers.duty |
|
|
|
|
|
|
|
var level by Managers.level |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@TableComment("审核记录") |
|
|
|
@TableComment("审核记录") |
|
|
|
object CheckForms:IntIdTable(){ |
|
|
|
object AuditLeggings:IntIdTable(){ |
|
|
|
@TableComment("审核类型") |
|
|
|
@TableComment("申请人") |
|
|
|
val type:Column<String> = varchar(name="type",length = 10) |
|
|
|
val userId: Column<EntityID<Int>> = reference("user_id",Users) |
|
|
|
|
|
|
|
|
|
|
|
@TableComment("审核人") |
|
|
|
@TableComment("申请时间") |
|
|
|
val managerId:Column<EntityID<Int>> = reference("manager_id",Managers) |
|
|
|
val applyTime:Column<LocalDateTime> = datetime("apply_time").defaultExpression(CurrentDateTime()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@TableComment("负责人") |
|
|
|
|
|
|
|
val managerId: Column<EntityID<Int>?> = reference("manager_id",Managers).nullable() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@TableComment("受理时间") |
|
|
|
|
|
|
|
val acceptTime:Column<LocalDateTime?> = datetime("accept_time").nullable() |
|
|
|
|
|
|
|
|
|
|
|
@TableComment("审核理由") |
|
|
|
@TableComment("审核理由") |
|
|
|
val cause:Column<String> = varchar("cause",length = 30) |
|
|
|
val cause:Column<String?> = varchar("cause",length = 30).nullable() |
|
|
|
|
|
|
|
|
|
|
|
@TableComment("审核对象") |
|
|
|
@TableComment("审核结果") |
|
|
|
val target:Column<Int> = integer("target") |
|
|
|
val result:Column<Boolean?> = bool("result").nullable() |
|
|
|
|
|
|
|
|
|
|
|
@TableComment("审核时间") |
|
|
|
@TableComment("审核时间") |
|
|
|
val createTime:Column<LocalDateTime> = datetime("create_time").defaultExpression(CurrentDateTime()) |
|
|
|
val auditTime:Column<LocalDateTime?> = datetime("audit_time").nullable() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@TableComment("复审记录") |
|
|
|
|
|
|
|
val nextAudit:Column<EntityID<Int>?> = reference("next_audit",AuditLeggings).nullable() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class CheckForm(id:EntityID<Int>):IntEntity(id){ |
|
|
|
class AuditLogging(id:EntityID<Int>):IntEntity(id){ |
|
|
|
companion object:IntEntityClass<CheckForm>(CheckForms) |
|
|
|
companion object:IntEntityClass<AuditLogging>(AuditLeggings) |
|
|
|
var type by CheckForms.type |
|
|
|
var user by User referencedOn AuditLeggings.userId |
|
|
|
val manager by Manager referrersOn CheckForms.managerId |
|
|
|
var applyTime by AuditLeggings.applyTime |
|
|
|
var cause by CheckForms.cause |
|
|
|
var manager by Manager optionalReferencedOn AuditLeggings.managerId |
|
|
|
var target by CheckForms.target |
|
|
|
var acceptTime by AuditLeggings.acceptTime |
|
|
|
|
|
|
|
var cause by AuditLeggings.cause |
|
|
|
|
|
|
|
var result by AuditLeggings.result |
|
|
|
|
|
|
|
var auditTime by AuditLeggings.auditTime |
|
|
|
|
|
|
|
var nextAudit by AuditLogging optionalReferencedOn AuditLeggings.nextAudit |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@TableComment("通知记录") |
|
|
|
@TableComment("通知记录") |
|
|
@ -200,7 +246,7 @@ object Notifications:IntIdTable(){ |
|
|
|
val title:Column<String> = varchar(name="title",length = 10) |
|
|
|
val title:Column<String> = varchar(name="title",length = 10) |
|
|
|
|
|
|
|
|
|
|
|
@TableComment("通知内容") |
|
|
|
@TableComment("通知内容") |
|
|
|
val content:Column<String> = varchar(name="content",length = 30) |
|
|
|
val content:Column<String> = varchar(name="content",length = 256) |
|
|
|
|
|
|
|
|
|
|
|
@TableComment("接收者") |
|
|
|
@TableComment("接收者") |
|
|
|
val receiverId:Column<Int> = integer(name="receiver_id") |
|
|
|
val receiverId:Column<Int> = integer(name="receiver_id") |
|
|
@ -228,3 +274,4 @@ class Notification(id:EntityID<Int>):IntEntity(id){ |
|
|
|
var pull by Notifications.pull |
|
|
|
var pull by Notifications.pull |
|
|
|
var createTime by Notifications.createTime |
|
|
|
var createTime by Notifications.createTime |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|