import path_setting
from in_common.base_request import BaseRequest


class answer_request(BaseRequest):
    def __init__(self):
        self.abc = self.api_load(path_setting.DETAIL_CONFIG)
        # print(self.abc)

    # 回答详情页
    def detail(self, current_city_id, answer_id=""):
        self.params["current_city_id"] = current_city_id
        self.params["answer_id"] = answer_id
        return self.api_send(self.abc["detail"])

    # 回答详情页点赞
    def vote(self, answer_id=""):
        self.params["answer_id"] = answer_id
        return self.api_send(self.abc["vote"])

    # 回答详情页取消点赞
    def cancel_vote(self, answer_id=""):
        self.params["answer_id"] = answer_id
        return self.api_send(self.abc["cancel_vote"])