def post(self, *args, **kwargs): result = {"message": "success", "code": 200} pms = json.loads(self.request.body) city = kwargs.get('city') self.service = BoroughGuesswordService() guessword_dict = pms.get('guessword_dict', {}) data = self.service.modify_borough_name(city=city, guessword_dict=guessword_dict) result["data"] = data self.write(result)
def post(self, *args, **kwargs): result = {"message": "success", "code": 200} pms = json.loads(self.request.body) city = kwargs.get('city') self.service = BoroughGuesswordService() guessword_list = pms.get("guessword_list", []) type_id = pms.get("type_id") data = self.service.delete_guessword(city=city, guessword_list=guessword_list, type_id=type_id) result["data"] = data self.write(result)
class BoroughGuesswordModify(BaseController): def initialize(self): pass @catch_exception # 异常装饰器 def post(self, *args, **kwargs): result = {"message": "success", "code": 200} pms = json.loads(self.request.body) city = kwargs.get('city') self.service = BoroughGuesswordService() guessword_dict = pms.get('guessword_dict', {}) data = self.service.modify_borough_name(city=city, guessword_dict=guessword_dict) result["data"] = data self.write(result)
class BoroughGuesswordDelete(BaseController): def initialize(self): pass @catch_exception # 异常装饰器 def post(self, *args, **kwargs): result = {"message": "success", "code": 200} pms = json.loads(self.request.body) city = kwargs.get('city') self.service = BoroughGuesswordService() guessword_list = pms.get("guessword_list", []) type_id = pms.get("type_id") data = self.service.delete_guessword(city=city, guessword_list=guessword_list, type_id=type_id) result["data"] = data self.write(result)