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

49 lines
1.1 KiB

4 years ago
package com.gyf.csams
import kotlinx.serialization.Serializable
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
@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)
data class UserResDto(val password:String)
data class Token(val token:String,val createTime:Long,val studentId:String)
/**
* 令牌传输
*
* @property isValid
* @property token
*/
data class TokenResDto(val isValid:Boolean,val token: Token?=null)
data class TokenVo(val token:String,val studentId:String)