class CityAvgPriceHandle(BaseController): """ desc: [MP接口] 城市均价接口 """ def initialize(self): self.service = MiniProgramService() @catch() # 异常装饰器 def post(self, *args, **kwargs): city = kwargs.get('city', '') data = self.service.city_avgprice(city=city) return data
class SellWeekChangeCnt(BaseController): """ desc: [MP接口] 二手房城市成交城区房源分布 """ def initialize(self): self.service = MiniProgramService() @catch() # 异常装饰器 def get(self, *args, **kwargs): city = kwargs.get('city') data = self.service.sellFinishCityareaDistribution(city=city) return {"data": data}
class HousetypeDistributionHandle(BaseController): """ desc: [MP接口] 户型分布 """ def initialize(self): self.service = MiniProgramService() @catch() # 异常装饰器 def post(self, *args, **kwargs): city = kwargs.get('city', '') pms = json.loads(self.request.body) data = self.service.getHousetypeDistribution(city=city, pms=pms) return data
class SellWeekChangeCnt(BaseController): """ desc: [MP接口] 房源变动趋势接口 """ def initialize(self): self.service = MiniProgramService() @catch() # 异常装饰器 def get(self, *args, **kwargs): city = kwargs.get('city') cityarea_id = int(self.get_argument("cityarea_id", 0)) cityarea2_id = int(self.get_argument("cityarea2_id", 0)) data = self.service.sell_week_change_cnt(city=city, cityarea_id=cityarea_id, cityarea2_id=cityarea2_id) return {"data": data}
def initialize(self): self.service = MiniProgramService()