You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
csamsserver/src/Vo.kt

65 lines
1.9 KiB

4 years ago
package com.gyf.csams
data class ApiResponse<T>(val code:Int=200,val message:String,val body:T?=null)
4 years ago
class Simple {
companion object {
fun success(message: String):ApiResponse<Any>{
return ApiResponse(code = 200, message = message, body = null)
}
fun error(message: String): ApiResponse<Any> {
return ApiResponse(code = 500, message = message, body = null)
}
}
}
/**
* 用户注册表单
*
* @property studentId 学号
* @property name 姓名
*/
4 years ago
data class UserVo(val studentId:String,val name:String)
/**
* 用户登陆表单
*
* @property studentId 学号
* @property password 密码
* @property device 设备型号
*/
data class UserLoginVo(val studentId: String,val password: String,val device: String)
data class UserLogoutVo(val userId:Int)
data class UserResDto(val password:String)
data class Token(val token:String, val createTime:Long, val id:Int)
sealed class BaseVo{
abstract val token:Token
}
data class LeaveMessageVo(val message: String, override val token:Token):BaseVo()
data class OnlyToken(override val token: Token):BaseVo()
//data class PageVo(val pageSize:Int=10,val page:, override val token: Token):BaseVo()
data class LeaveMessageDto(val message: String,val user: UserVo)
data class RegAssociationVo(val name:String, val desc:String,val fileId:Int, override val token: Token):BaseVo()
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)
data class PageDto(val currentPage:Long,val pageSize:Int=10)
data class NotificationDto(val receiverId:Int, val receiverClient:ReceiverType, override val token: Token,
val page:PageDto?):BaseVo()
data class NotificationVo(val title:String,val content:String,val id:Int,val createTime: Long)