2024/4/15

实体类:

package com.example.personalwork.data.models

data class WeekData(
val week: Week
)

package com.example.personalwork.data.models


data class Week(
var id: Int = 0,
var userid: Int = 0,
var title: String = "",
var description: String = "",
var starttime: String = "",
var finaltime: String = "",
var aming: Int = 0,
var accomplish: Int = 0
){

constructor(id: Int,userid: Int):this(){
this.id = id
this.userid = userid
}

constructor(userid: Int,title: String,starttime: String,finaltime: String,description: String,aming: Int):this(){
this.userid = userid
this.title = title
this.description = description
this.starttime = starttime
this.finaltime = finaltime
this.aming = aming
}
}

package com.example.personalwork.data.models

import User

data class UserData(
val user: User
)

import android.widget.EditText
import com.google.gson.annotations.SerializedName

data class User(
val id: Int = 0,
var no: String = "",
var password: String = "",
var name: String = "",
var phone: String = "",
var classnum: String = "",
val roleid: Int = 0,
@SerializedName("recordTimes") val recordTimes: Int = 0
) {
constructor(no: String, password: String) : this() {
this.no = no
this.password = password
}

constructor(no: String, password:String, name: String, phone: String,classnum: String) : this(){
this.no = no
this.password = password
this.name = name
this.phone = phone
this.classnum = classnum
}
}

package com.example.personalwork.data.models

data class Records(
val id: Int,
val userid: Int,
val startTime: String,
val finalTime: String,
val dateRecord: String,
val no: String,
val name: String,
val classnum: String
)

package com.example.personalwork.data.models

data class Record(
var userid: String = "",
var startTime: String="",
var finalTime: String="",
var dateRecord: String=""
)

package com.example.personalwork.data.models

data class Param(
private var id: String?=null,
private var name:String?=null,
private var no:String?=null
)

package com.example.personalwork.data.models

import android.os.Parcelable
import androidx.room.Entity
import androidx.room.PrimaryKey
import kotlinx.parcelize.Parcelize

@Entity(tableName = "todo_table")
@Parcelize
data class DaySum(
@PrimaryKey(autoGenerate = true)
var id: Int,
var title: String,
var description: String,
var startTime: String,
var finalTime: String,
):Parcelable
posted @ 2024-04-15 09:01  Hbro  阅读(18)  评论(0)    收藏  举报