Optimize code

This commit is contained in:
2023-10-23 15:39:54 +08:00
parent 5e21963610
commit f927851cb0
15 changed files with 40 additions and 60 deletions

View File

@@ -4,17 +4,13 @@ import io.swagger.v3.oas.annotations.media.Schema
import java.io.Serializable
class ResponseResult<T> private constructor(
@Schema(description = "响应码", defaultValue = "200")
val code: Int,
@Schema(description = "响应码", defaultValue = "200") val code: Int,
@Schema(description = "是否调用成功")
val success: Boolean,
@Schema(description = "是否调用成功") val success: Boolean,
@Schema(description = "信息")
val msg: String,
@Schema(description = "信息") val msg: String,
@Schema(description = "数据")
val data: T?
@Schema(description = "数据") val data: T?
) : Serializable {
companion object {
fun <T> build(code: ResponseCode, success: Boolean, msg: String, data: T?) =