package com.lukouguoji.aerologic.page.log.list

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.lukouguoji.aerologic.R
import com.lukouguoji.aerologic.databinding.ActivityLogListBinding
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.ktx.getLifecycleOwner

class LogListActivity : BaseBindingActivity<ActivityLogListBinding, LogListViewModel>() {

    override fun layoutId(): Int {
        return R.layout.activity_log_list
    }

    override fun viewModelClass(): Class<LogListViewModel> {
        return LogListViewModel::class.java
    }

    override fun initOnCreate(savedInstanceState: Bundle?) {
        setBackArrow("日志查询")
        binding.viewModel = viewModel
        viewModel.pageModel.bindSmartRefreshLayout(
            binding.srl,
            binding.rv,
            viewModel,
            getLifecycleOwner()
        )
        viewModel.refresh()
    }

    companion object {
        @JvmStatic
        fun start(context: Context) {
            val starter = Intent(context, LogListActivity::class.java)
            context.startActivity(starter)
        }
    }

}