package com.cheng.blzb.net.model


/**
 * 列表基本结构(服务返回)
 */

open class HttpListResult<T> {

    var total: String = "0"              //总条数
    var total_amount:String = "0.00"     //总金额

    private var content = listOf<T>()    //列表数据
    private var records = listOf<T>()    //列表数据
    private var list = listOf<T>()       //列表数据
    val items = listOf<T>()               //列表数据
        get() {
            if (content.isNotEmpty()) {
                return content
            }
            if (records.isNotEmpty()) {
                return records
            }
            if (list.isNotEmpty()) {
                return list
            }
            return field   // 防止服务器数据为null 蛋疼
        }


    override fun toString(): String {
        return "HttpListResult{" +
                "total=" + total +
                "total_amount="+total_amount+
                ", rows=" + items +
                '}'
    }
}

