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

56 lines
1.4 KiB

package com.gyf.csams
import kotlinx.serialization.Serializable
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>{
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 姓名
*/
@Serializable
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)
@Serializable
data class UserLogoutVo(val studentId:String)
data class UserResDto(val password:String)
data class Token(val token:String,val createTime:Long,val studentId:String,val name:String)
data class TokenVo(val token:String,val studentId:String)
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 LeaveMessageFormatVo(val message: String,val studentId: String)