def set_recruitment(): no = None no = request.args.get("no", no) try: handler.get_request(util.RECRUITMENT, request_data=None, args=no) return "HTTP/1.1 200 OK", 200 except: return jsonify(exception.SEND_ERROR), 500
def get_board_info(): ''' If you click a component of ListView , this handler will be invoked. Print detail informations of a board. :param board_no: filter on database by board_no :return: { "no": row[0], "title": row[1], "storename": row[2], "start_time": row[3], "end_time": row[4], "urgency": row[5], "job_condition": row[6], "job": job, "favorable_condition": row[8], "detail": row[9], "local": local, "local_sub": row[11], "id": row[12] } ''' board_no = None board_no = request.args.get("no", board_no) args = {"no": board_no} if board_no == None: return jsonify(exception.NO_BOARD_INFO), 404 try: response = handler.get_request(type=util.BOARD_INFO, request_data=None, args=args) return jsonify(response), 200 except: return jsonify(exception.SEND_ERROR), 500
def get_home(): ''' Print board list on main page. :return: { "1" : { "title": title, "storename" : storename, "start_time": start_time, "end_time": end_time, "urgency" : urgency, }, "2" : { }, "3" : {} } ''' local_name = None job_name = None local_name = request.args.get("local", local_name) job_name = request.args.get("job", job_name) args = {"local": local_name, "job": job_name} try: response = handler.get_request(type=util.HOME, request_data=None, args=args) return jsonify(response), 200 except: return jsonify(exception.SEND_ERROR), 500
def regitst_board(): ''' If you regist a board in this server, server will send status_code to you. :return: status_code ''' try: req = request.get_json() try: handler.get_request(type=util.REGIST_BOARD, request_data=req, args=None) except: return "HTTP/1.1 500 Internal Server Error", 500 return "HTTP/1.1 200 OK", 200 except: return "HTTP/1.1 500 Internal Server Error", 500
def support(): ''' :return: ''' req = request.get_json() try: response = handler.get_request(util.SURPPORT, request_data=req, args=None) return jsonify(response), 200 except: return jsonify(exception.SEND_ERROR), 500
def get_job_list(): ''' If you click or call job_list, you will be seen job_list in dialog. :return: {"local_list": job_list} ''' args = {"filter": util.GET_JOB} try: response = handler.get_request(type=util.JOB_LIST, request_data=None, args=args) return jsonify(response), 200 except: return jsonify(exception.SEND_ERROR), 500
def applying(): id = None id = request.args.get("id", id) args = {"id": id} print("\'" + id + "\'") try: response = handler.get_request(util.APPLYING, request_data=None, args=args) return jsonify(response), 200 except: return jsonify(exception.SEND_ERROR), 500
def login(): ''' :return: ''' req = request.get_json() if req == None: return jsonify(exception.BAD_REQUEST), 400 try: response = handler.get_request(util.LOGIN, request_data=req, args=None) return jsonify(response), 200 except: return jsonify(exception.SEND_ERROR), 500
def get_supports(): ''' :return: ''' id = None id = request.args.get("id", id) args = {"id": id} try: response = handler.get_request(util.GET_SUPPORTERS, request_data=None, args=args) return jsonify(response), 200 except: return jsonify(exception.SEND_ERROR), 500
def sign_up(): ''' If you request to sign up, server will send status code to you. :return: status code ''' req = request.get_json() response = handler.get_request(util.SIGNUP, request_data=req, args=None) if response != None: try: return jsonify(response), 200 except: return jsonify(exception.SEND_ERROR), 500 else: return jsonify(response), 406
def get_local_list(): ''' If you click or call local_list, you will be seen local_list in dialog. :return: {"local_list": local_list} ''' local_name = None local_name = request.args.get("filter", local_name) args = {"filter": util.GET_LOCAL, "local_name": local_name} try: response = handler.get_request(type=util.LOCAL_LIST, request_data=None, args=args) return jsonify(response), 200 except: return jsonify(exception.SEND_ERROR), 500