package com.yidian.bcommon.utils

import com.orhanobut.hawk.Hawk
import com.yidian.bcommon.constant.HawkConfig

/**
 * author: yinjiacheng
 * date: 6/17/21 4:16 PM
 * description: 统一管理Hawk存储
 */
object StorageUtil {

  /**
   * 存储生活号id
   */
  fun putLifeAccountId(lifeAccountId: String?) {
    Hawk.put(HawkConfig.LifeAccountId, lifeAccountId ?: "")
  }

  /**
   * 获取生活号id
   */
  fun getLifeAccountId(): String? {
    return Hawk.get(HawkConfig.LifeAccountId, null)
  }

  /**
   * 删除生活号id
   */
  fun deleteLifeAccountId() {
    Hawk.delete(HawkConfig.LifeAccountId)
  }
}
