import path_setting
from in_common.base_request import BaseRequest


class visual_request(BaseRequest):
    def __init__(self):
        self.data = self.api_load(path_setting.VISUAL_CONFIG)

    # 自定义专题详情
    def page_detail(self, page_id):
        self.params["page_id"] = page_id
        return self.api_send(self.data["page_detail"])

    # 签到--其他tab 美购feed——自定义专题商品列表
    def service_list(self, unit_id, page, current_city_id, order_by, area, tag_ids):
        self.params["unit_id"] = unit_id
        self.params["page"] = page
        self.params["current_city_id"] = current_city_id
        self.params["order_by"] = order_by
        self.params["area"] = area
        self.params["tag_ids"] = tag_ids
        return self.api_send(self.data["service_list"])

    # 自定义专题-筛选器
    def unit_filter(self, unit_id):
        self.params["unit_id"] = unit_id
        return self.api_send(self.data["unit_filter"])

if __name__ == '__main__':
    # 自定义专题详情
    # print(visual_request().page_detail(903))
    # 自定义专题商品列表
    # print(visual_request().service_list(20236, 0, "beijing", 0, "worldwide", [66]))
    # 自定义专题筛选器
    print(visual_request().unit_filter(20236))
