@@ -0,0 +1,1131 @@
+import json%0Aimport flask%0A%0Aclass BaseServiceHandler:%0A%0A    return_result = %7B%7D%0A    return_code = 200%0A%0A    def validate_required_args(self, request, required_args):%0A        for arg in required_args:%0A            if arg not in request.form:%0A                print 'missing %25s' %25 arg%0A                return False%0A            else:%0A                print '%5B%25s%5D=%5B%25s%5D' %25 (arg, request.form%5Barg%5D)%0A        return True%0A%0A    def handle_request(self, request, service):%0A        '''return message, status_code '''%0A        self.process_request(request, service)%0A        key = 'result' if self.return_code == 200 else 'error'%0A        return flask.jsonify(%7Bkey:self.return_result%7D), self.return_code%0A%0A    def get_json_param(self, request):%0A        #jstr = request.data.replace('%5Cr', '%5C%5Cr').replace('%5Cn', '%5C%5Cn')%0A        jstr = request.data%0A        j = json.loads(jstr)%0A        return j%0A%0A    def set_result(self, result, code):%0A        self.return_result = result%0A        self.return_code = code%0A%0A    def process_request(self, request, service):%0A        ''' logic to process request%0A            please call set_result at the end%0A        '''%0A        pass%0A

add back missing web framework