package com.yidian.shenghuoquan.newscontent.service

import com.yidian.xarc.xrouter.ResultResolver
import com.yidian.yac.core.zap.ZapService
import org.json.JSONObject

class UserService: ZapService(){
    companion object{
        const val serviceName: String = "UserService"
    }

    private lateinit var resolver: ResultResolver

    override fun onAction(name: String, action: String, params: Any, options: Any, resolver: ResultResolver) {
        this.resolver = resolver
        params as JSONObject
        val path = params.optString("path")
        val body = params.optJSONObject("body")
        when(action){
            "addComment" -> addComment(path, body)
            "like" -> like(path, body)
        }
    }

    override fun onExit() {

    }

    override fun onInit() {

    }

    private fun addComment(path: String, params: JSONObject){

    }

    private fun like(path: String, params: JSONObject){

    }
}