package com.gyf.csams import kotlinx.serialization.Serializable data class ApiResponse(val code:Int=200,val message:String,val body:T?=null) class Simple { companion object { fun success(message: String):ApiResponse{ return ApiResponse(code = 200, message = message, body = null) } fun error(message: String): ApiResponse { 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) /** * 令牌传输 * * @property isValid * @property token */ data class TokenResDto(val isValid:Boolean,val token: Token?=null) data class TokenVo(val token:String,val studentId:String)