import path_setting
from in_common.base_request import BaseRequest


class user_request(BaseRequest):

    def __init__(self):
        self.data = self.api_load(path_setting.PERSONAL_CENTER_CONFIG)

    def personal_center(self):

        return self.api_send(self.data["personal_center"])


    def __init__(self):
        self.data = self.api_load(path_setting.USER_ANSWER_CONFIG)

    #医院主页问答列表
    def answer(self, user):
        self.params["user"] = user
        return self.api_send(self.data["answer"])
    #日记贴相关部分配置
    def __init__(self):
        self.data = self.api_load(path_setting.TOPIC_FAVOR_CONFIG)

    #日记贴帖子相关-收藏
    def topic_favor(self):
        return self.api_send(self.data["favor"])
    #日记贴取消收藏
    def topic_canclefavor(self):
        return self.api_send(self.data["canclefavor"])

    #关注主播
    def follow_add(self,uid,from_live):
        self.params["uid"] = uid
        self.params["from_live"] = from_live
        return self.api_send(self.data['follow_add'])

    #取消关注
    def follow_del(self,uid,from_live):
        self.params["uid"] = uid
        self.params["from_live"] = from_live
        return self.api_send(self.data["follow_del"])




    #我的-日记
    def my_diary_v2(self, start_num, count):

        self.params["start_num"] = start_num
        self.params["count"] = count


        return self.api_send(self.data["my_diary_v2"])

     # 我的-日记
    def user_tractate(self, page, count):

        self.params["page"] = page
        self.params["count"] = count


        return self.api_send(self.data["user_tractate"])

if __name__ == '__main__':
    #个人中心
    print(user_request().personal_center())


    #打印医生/医院主页问答列表接口返回
    print(user_request().answer("21476198"))

    # 日记贴收藏&取消收藏
    # print(user_request().topic_favor())
    # print(user_request().topic_canclefavor())
    print(user_request().follow_del("33909625","4196"))

    #我的-日记
    print(user_request().my_diary_v2(0, 10))

    #我的-帖子
    print(user_request().user_tractate(1, 10))

