import path_setting
from in_common.base_request import BaseRequest


class web_request(BaseRequest):
    def __init__(self):
        self.ACCOUNT_URL = self.api_load(path_setting.ACCOUNT_URL)

    def account_unreadbadgecount(self) :
        return self.api_send(self.ACCOUNT_URL["account_unreadbadgecount"])

    def article_videotoken(self) :
        return self.api_send(self.ACCOUNT_URL["article_videotoken"])

    def doctor_submechanisms(self) :
        return self.api_send(self.ACCOUNT_URL["doctor_submechanisms"])

    # 医生后台-商户管理-医生管理列表
    def doctor_doctorlist(self,doctor_type):
        self.params["doctor_type"] = doctor_type
        return self.api_send(self.ACCOUNT_URL["doctor_doctorlist"])

    # 医生后台-商户管理-医生管理列表--创建医生发送验证码
    def doctor_verificationcode(self,phone):
        self.params["phone"] = phone
        return self.api_send(self.ACCOUNT_URL["doctor_verificationcode"])

    # 医生后台-商户管理-医生管理列表--创建医生上传头像图片--暂时还没写case待定
    def file_upload(self,phone):
        self.params["phone"] = phone
        return self.api_send(self.ACCOUNT_URL["file_upload"])

    # 医生后台-商户管理-医生管理列表--创建医生--提交创建单
    def doctor_register_post(self,profession_licences,b_licences,p_licences,personal_pictures,register_phone,verification_code):
        self.params["profession_licences"] = profession_licences
        self.params["b_licences"] = b_licences
        self.params["p_licences"] = p_licences
        self.params["personal_pictures"] = personal_pictures
        self.params["register_phone"] = register_phone
        self.params["verification_code"] = verification_code
        return self.api_send(self.ACCOUNT_URL["doctor_register_post"])

    # 医生后台-商户管理-医生管理列表--查看审核中的医生
    def doctor_register(self,doctorregister_id):
        self.params["doctorregister_id"] = doctorregister_id
        return self.api_send(self.ACCOUNT_URL["doctor_register"])

    # 医生后台-密码登录
    def account_login(self,name, password, method='password' ):
        self.params["name"] = name
        self.params["password"] = password
        self.params["method"] = method
        return self.api_send(self.ACCOUNT_URL["account_login"])

    # 医生后台-修改密码发送验证码
    def account_code_online(self,csrfmiddlewaretoken ):
        self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken
        return self.api_send(self.ACCOUNT_URL["account_code_online"])

    # 医生后台-修改密码
    def account_password(self,new_password, code='' ):
        self.params["new_password"] = new_password
        # code = self.xxx()  # 待会补上方法
        self.params["code"] = code
        return self.api_send(self.ACCOUNT_URL["account_password"])







    def service_offline(self,id,csrfmiddlewaretoken):
        self.params["id"] = id
        self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken
        return self.api_send(self.ACCOUNT_URL["service_offline"])

    def conversation(self, is_star, page):
        self.params["is_star"] = is_star
        self.params["page"] = page
        return self.api_send(self.ACCOUNT_URL["conversation"])

    def conversation_unread_list(self, page):
        self.params["page"] = page
        return self.api_send(self.ACCOUNT_URL["conversation_unread_list"])

    def service(self):
        return self.api_send(self.ACCOUNT_URL["service"])

    def conversation_diary(self, doctor_user_id):
        self.params["doctor_user_id"] = doctor_user_id
        return self.api_send(self.ACCOUNT_URL["conversation_diary"])

    def conversation_coupon(self, doctor_user_id):
        self.params["doctor_user_id"] = doctor_user_id
        return self.api_send(self.ACCOUNT_URL["conversation_coupon"])

    def service_all(self):
        return self.api_send(self.ACCOUNT_URL["service_all"])

    def conversation_user_id(self, type, content, doctor_user_id, t, csrfmiddlewaretoken):
        self.params["type"] = type
        self.params["content"] = content
        self.params["doctor_user_id"] = doctor_user_id
        self.params["t"] = t
        self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken
        return self.api_send(self.ACCOUNT_URL["conversation_user_id"])

    # def file_upload(self, img_type,csrfmiddlewaretoken,id,name,type,lastModifiedDate,size,file):
    #     self.params["img_type"] = img_type
    #     self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken
    #     self.params["id"] = id
    #     self.params["name"] = name
    #     self.params["type"] = type
    #     self.params["lastModifiedDate"] = lastModifiedDate
    #     self.params["size"] = size
    #     self.params["file"] = file
    #     return self.api_send(self.ACCOUNT_URL["file_upload"])
    def cpc_homepage(self):
        return self.api_send(self.ACCOUNT_URL["cpc_homepage"])

    def artemis_ad_type_list(self):
        return self.api_send(self.ACCOUNT_URL["artemis_ad_type_list"])

    def artemis_order_list(self, status, page):
        self.params["status"] = status
        self.params["page"] = page
        return self.api_send(self.ACCOUNT_URL["artemis_order_list"])

    def artemis_order_id_detail(self):
        "上线中订单详情页"
        return self.api_send(self.ACCOUNT_URL["artemis_order_id_detail"])

    def cpc_community_homepage(self):
        "点点通-内容-概览"
        return self.api_send(self.ACCOUNT_URL["cpc_community_homepage"])

    def cpc_community_diaries(self):
        "点点通-内容-数据统计-内容"
        return self.api_send(self.ACCOUNT_URL["cpc_community_diaries"])

    def cpc_community_data_info(self,diary_id,start_time,end_time):
        "点点通-内容-数据统计"
        self.params["diary_id"] = diary_id
        self.params["start_time"] = start_time
        self.params["end_time"] = end_time
        return self.api_send(self.ACCOUNT_URL["cpc_community_data_info"])

    def cpc_community_click_logs(self,page):
        "点点通-内容-推广明细"
        self.params["page"] = page
        return self.api_send(self.ACCOUNT_URL["cpc_community_click_logs"])

    def cpc_promote_flows(self, month):
        "点点通商品-历史每月推广明细"
        self.params["month"] = month
        return self.api_send(self.ACCOUNT_URL["cpc_promote_flows"])

    def cpc_promote_flows_excel(self, month):
        "点点通商品-历史每月推广明细-导出"
        self.params["month"] = month
        return self.api_send(self.ACCOUNT_URL["cpc_promote_flows_excel"])

    def cpc_community_promote_flows(self, month):
        "点点通内容-历史每月推广明细"
        self.params["month"] = month
        return self.api_send(self.ACCOUNT_URL["cpc_community_promote_flows"])


if __name__ == '__main__':
    print(web_request().account_unreadbadgecount())
    print(web_request().article_videotoken())
    print(web_request().doctor_submechanisms())
    print(web_request().service_offline("209992", "PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"))
    print(web_request().conversation(0, 1))
    print(web_request().conversation_unread_list(1))
    print(web_request().service())
    print(web_request().conversation_diary(602329))
    print(web_request().conversation_coupon(602329))
    print(web_request().service_all())
    # print(web_request().file_upload("19","PC8uTySuxipukIMuqNV1OPB376C2ZZ3g","WU_FILE_0","lADPDg7mQdiUTiLNAZDNAZA_400_400.jpg_720x720g.jpg","image/jpeg","Mon Apr 26 2021 11:29:45 GMT+0800 (中国标准时间)","17688","(binary)"))
    print(web_request().conversation_user_id(0, "您好", 602329, "271caac2ae1687ca0a56ee18115b8183", "NLeTxEx1BOQo1zjv2us9BQ00ViMAHGpJ"))
    print(web_request().cpc_homepage())
    print(web_request().artemis_ad_type_list())
    print(web_request().artemis_order_list(0, 1))
    print(web_request().artemis_order_list(1, 1))
    print(web_request().artemis_order_list(2, 1))
    print(web_request().artemis_order_id_detail())
    print(web_request().cpc_community_homepage())
    print(web_request().cpc_community_diaries())
    print(web_request().cpc_community_data_info("15604767","2021-07-02","2021-07-12"))
    print(web_request().cpc_community_click_logs(1))
    print(web_request().cpc_promote_flows("2021-7"))
    print(web_request().cpc_promote_flows_excel("2021-7"))
    print(web_request().cpc_community_promote_flows("2021-7"))