master
pan 4 years ago
parent 10a11c7e1d
commit ece571beb6
  1. 208
      test1/src/main/kotlin/com/gyf/csams/module/Vo.kt

@ -1,11 +1,10 @@
package com.gyf.csams
package com.gyf.csams.module
data class ApiResponse<T>(val code:Int=200,val message:String,val body:T?=null)
class Simple {
companion object {
fun success(message: String):ApiResponse<Any>{
fun success(message: String): ApiResponse<Any> {
return ApiResponse(code = 200, message = message, body = null)
}
@ -16,6 +15,16 @@ class Simple {
}
/**
* 客户端类型
*
*/
enum class ClientType{
//前台
Foreground,
//后台
Background
}
/**
* 一般信息
*
@ -41,17 +50,18 @@ enum class Duty(val desc:String, val level:Int){
* 个人信息
*
*/
abstract class OwnInfoVo :PersonInfoVo(){
abstract val token:Token
abstract class OwnInfoVo : PersonInfoVo(){
abstract val token: Token
}
data class ManagerInfoVo(val duty: Duty,
override val name: String,
override val headImg: String?,
override val desc: String
):PersonInfoVo()
): PersonInfoVo()
data class UserInfoVo(override val name: String, override val headImg: String?, override val desc: String):PersonInfoVo()
data class UserInfoVo(override val name: String, override val headImg: String?, override val desc: String):
PersonInfoVo()
/**
@ -84,7 +94,7 @@ data class UserRegVo(val studentId: String, val name: String)
*/
data class UserVo(
val studentId: String,
val manager:ManagerVo?=null,
val manager: ManagerVo?=null,
override val token: Token,
override val name: String,
override val headImg: String?,
@ -97,77 +107,65 @@ data class UserVo(
sealed class BaseLoginVo{
abstract val password: String
abstract val device: String
abstract val clientType:ClientType
abstract val clientType: ClientType
}
sealed class ClientBaseVo {
abstract val token:Token
abstract val clientType:ClientType
abstract val token: Token
abstract val clientType: ClientType
}
data class UserLoginVo(val studentId: String,
override val password: String, override val device: String,
override val clientType: ClientType=ClientType.Foreground
):BaseLoginVo()
override val clientType: ClientType = ClientType.Foreground
): BaseLoginVo()
data class UserResDto(val password:String)
data class ManagerLoginVo(val account:String,
override val password:String, override val device:String):BaseLoginVo() {
override val clientType: ClientType=ClientType.Background
override val password:String, override val device:String): BaseLoginVo() {
override val clientType: ClientType = ClientType.Background
}
data class Token(val token:String, val createTime:Long, val id:Int)
data class LeaveMessageVo(val message: String, override val token:Token,
override val clientType: ClientType=ClientType.Foreground):ClientBaseVo()
data class LeaveMessageVo(val message: String, override val token: Token,
override val clientType: ClientType = ClientType.Foreground
): ClientBaseVo()
data class OnlyToken(override val token: Token, override val clientType: ClientType):ClientBaseVo()
data class OnlyToken(override val token: Token, override val clientType: ClientType): ClientBaseVo()
data class LeaveMessageDto(val message: String,val user: UserInfoVo)
/**
* 社团注册资料表单
*
* @property name
* @property desc
* @property fileId
*/
data class AssociationRegVo(val id:Int?, val name: String, val desc: String, val fileId: Int,
override val clientType: ClientType=ClientType.Foreground,
override val token: Token
):ClientBaseVo()
data class ImageFileDto(val filepath:String,val md5:String,val createTime: Long,val url:String)
data class RegAssociationDto(val name:String,val desc:String,val logo:ImageFileDto)
data class InitManagerDto(val account: String, val originPassword: String, val duty: Duty)
data class PageDto(val currentPage:Long,val pageSize:Int=10)
data class NotificationDto(val receiverId:Int, val receiverClient:ClientType, override val token: Token,
val page:PageDto?, override val clientType: ClientType=receiverClient
):ClientBaseVo()
data class NotificationDto(val receiverId:Int, val receiverClient: ClientType, override val token: Token,
val page: PageDto?, override val clientType: ClientType =receiverClient
): ClientBaseVo()
data class NotificationVo(val title:String,val content:String,val id:Int,val createTime: Long)
data class SearchAssociationVo(val name:String, val desc:String,
override val clientType: ClientType=ClientType.Foreground, override val token: Token
):ClientBaseVo()
override val clientType: ClientType = ClientType.Foreground, override val token: Token
): ClientBaseVo()
data class ShowAssociationVo(val id: Int,
override val token: Token,
override val clientType: ClientType=ClientType.Foreground):ClientBaseVo()
override val clientType: ClientType = ClientType.Foreground
): ClientBaseVo()
data class QueryAssociationMembers(val id:Int,
val name:String?=null,
override val token: Token,
override val clientType: ClientType=ClientType.Foreground
):ClientBaseVo()
override val clientType: ClientType = ClientType.Foreground
): ClientBaseVo()
/**
* 社团级别
@ -199,7 +197,7 @@ enum class AssociationFaculty(val desc: String, val range: IntRange) {
}
abstract class BaseAssociationVo{
abstract val id: Int
abstract val associationId: Int
abstract val name: String
abstract val desc: String
abstract val logo:String
@ -212,13 +210,13 @@ abstract class BaseAssociationVo{
*
*/
class AssociationVo(
override val id: Int,
override val associationId: Int,
override val name: String,
override val desc: String,
override val logo: String,
override val faculty: AssociationFaculty,
override val level: AssociationLevel?
) :BaseAssociationVo()
) : BaseAssociationVo()
//审核状态
enum class CheckStatus(val desc: String){
@ -229,10 +227,6 @@ enum class CheckStatus(val desc: String){
Finish("审核完成")
}
data class AssociationMemberVo(
val association:AssociationVo,
val isHead:Boolean
)
/**
* 活动照片
@ -241,35 +235,51 @@ data class AssociationMemberVo(
*/
data class AssociationActPhotoVo(val path:String)
data class AssociationMainVo(val associationVo: AssociationVo,val head: UserInfoVo,
data class AssociationMainVo(val associationVo: AssociationVo, val head: UserInfoVo,
val photos:List<AssociationActPhotoVo>?=null)
data class AuditCheckVo(val checkStatus: CheckStatus, val applyTime: Long,
val firstCause:String, val lastCause:String?)
//前台社团注册资料
data class AssociationCheckVo(
override val id: Int,
override val associationId: Int,
override val name: String,
override val desc: String,
override val logo: String,
override val faculty: AssociationFaculty,
override val level: AssociationLevel?,
val checkStatus:CheckStatus,
val applyTime: Long,
val firstCause:String,
val lastCause:String?,
val fileId:Int
):BaseAssociationVo()
val facultyRange=IntRange(4,5)
fun User.faculty():AssociationFaculty{
val num=studentId.substring(facultyRange).toInt()
AssociationFaculty.values().forEach {
if(num in it.range){
return it
}
}
throw IllegalArgumentException("无法根据${facultyRange}对应的num[${num}]找到所属院系")
val fileId:Int,
val auditCheckVo: AuditCheckVo
): BaseAssociationVo()
/**
* 社团注册资料表单
*
* @property name
* @property desc
* @property fileId
*/
data class AssociationRegVo(val associationId:Int?,
val name: String,
val desc: String, val fileId: Int,
override val clientType: ClientType = ClientType.Foreground,
override val token: Token
): ClientBaseVo()
abstract class AuditVo{
abstract val audit: AuditLoggingVo
}
/**
* 社团注册审核记录
*
*
*/
data class AuditAssociationVo(val name:String, val desc:String,
val logo:String, override val audit: AuditLoggingVo
): AuditVo()
/**
* 通用审核记录
@ -284,35 +294,67 @@ fun User.faculty():AssociationFaculty{
* @property auditTime
* @property nextAudit
*/
data class AuditLoggingVo(val id:Int, val user:UserInfoVo, val applyTime: Long, val manager:ManagerInfoVo?,
data class AuditLoggingVo(val id:Int, val user: UserInfoVo, val applyTime: Long, val manager: ManagerInfoVo?,
val acceptTime:Long?, val cause:String?, val result:Boolean?,
val auditTime:Long?, val nextAudit:AuditLoggingVo?)
val auditTime:Long?, val nextAudit: AuditLoggingVo?)
/**
* 社团注册资料受理
* 资料受理
*
* @property regId
* @property auditId
* @property clientType
*/
data class AcceptRegAssociation(val regId:Int,
val isFirstAccept:Boolean,
override val clientType: ClientType=ClientType.Background,
override val token: Token
):ClientBaseVo()
data class AcceptVo(val auditId:Int,
override val clientType: ClientType = ClientType.Background,
override val token: Token
): ClientBaseVo()
/**
* 社团注册审核记录
*资料审核
*
* @property auditId
* @property result
* @property cause
* @property clientType
*/
data class DisposeRegInfoVo(val name:String,val desc:String,val logo:String,val log:AuditLoggingVo)
data class CheckVo(val auditId:Int, val result:Boolean, val cause:String,
override val clientType: ClientType = ClientType.Background, override val token: Token
): ClientBaseVo()
data class BaseActivityVo(
val activityName:String,
val activityTime: Long,
val activityAddress:String,
val activityDesc:String,
val activitySize:Int
)
/**
* 社团注册资料审核
* 前台活动申请书
*
* @property regId
* @property result
* @property cause
* @property activityId
* @property clientType
*/
data class CheckRegVo(val regId:Int, val result:Boolean, val cause:String,
override val clientType: ClientType=ClientType.Background, override val token: Token
):ClientBaseVo()
data class ActivityApplyVo(val activityId:Int?,
val associationId: Int,
val baseActivityVo: BaseActivityVo,
override val token: Token,
override val clientType: ClientType = ClientType.Foreground
): ClientBaseVo()
/**
* 后台活动申请书
*
* @property auditId
* @property activityName
* @property activityTime
* @property activityAddress
* @property activityDesc
* @property activitySize
*/
data class AuditActVo(val auditId:Int, val activityName:String, val activityTime: Long,
val activityAddress:String,
val activityDesc:String, val activitySize:Int,
override val audit: AuditLoggingVo
): AuditVo()
Loading…
Cancel
Save