def update_order_status_service(self, connection, data):
        try:
            # 권한 조회 및 에러 처리
            if not (data['permission'] == 1 or data['permission'] == 2):
                raise NoPermission('권한이 없습니다.')

            # 현재 주문 상태가 상품 준비 혹은 배송중이 아닌 경우 상태 업데이트 불가
            if not (data['status'] == 1 or data['status'] == 2):
                raise NotAllowedStatus('현재 상태는 업데이트가 불가합니다.')

            # 새로운 주문 상태 id 생성
            data['new_status'] = data['status'] + 1

            # 주문 히스토리 DAO 데이터
            data['update_data'] = [[id, data['new_status'], data['account']]
                                   for id in data['ids']]

            # 주문 상태 변경 및 히스토리 내역 추가 개수
            data['count_new_status'] = len(data['update_date'])

            self.admin_order_dao.update_order_status_dao(connection, data)
            self.admin_order_dao.add_order_history_dao(connection, data)

        except KeyError:
            return 'key_error'
    def update_order_detail_service(self, connection, data):
        try:
            # 권한 조회 및 에러 처리
            if not (data['permission'] == 1 or data['permission'] == 2):
                raise NoPermission('권한이 없습니다.')

            order_item_id = data['order_item_id']
            updated_at_time = data['updated_at_time']
            sender_phone = data['sender_phone']
            recipient_phone = data['recipient_phone']
            address1 = data['address1']
            address2 = data['address2']

            # 수정 정보가 없는 경우 에러 처리
            if not (sender_phone or recipient_phone or address1 or address2):
                raise InputDoesNotExist('수정 정보가 없습니다.')

            # 주소 정보와 상세 주소 정보 둘 중 하나가 없는 경우 에러 처리
            if (not address1 and address2) or (not address2 and address1):
                raise UnableUpdateAddress('수정 주소 정보가 누락되었습니다.')

            # 최근 업데이트 시각 정보 조회
            time = self.admin_order_dao.get_updated_time_dao(
                connection, order_item_id)
            time = time[0].strftime("%Y-%m-%d %H:%M:%S")

            # 최근 업데이트 시각과 다를 때 에러 처리
            if time != updated_at_time:
                raise UnableToUpdate('업데이트가 불가합니다.')

            # 주소와 상세주소 정보 수정
            if address1 and address2:
                self.admin_order_dao.update_address_dao(connection, data)

            # 주문자 번호 정보 수정
            if sender_phone:
                self.admin_order_dao.update_sender_phone_dao(connection, data)

            # 수취자 번호 정보 수정
            if recipient_phone:
                self.admin_order_dao.update_recipient_phone_dao(
                    connection, data)

        except Exception as e:
            raise e
示例#3
0
    def delete(self, *args):
        if g.permission_type_id != 1:
            raise NoPermission('마스터 이용자만 사용 가능합니다')
        """ 기획전 논리삭제

            Args:
               args[0](event_id) : 이벤트 아이디

            Returns:
                {
                    'message': 'success',
                    'deleted_event_id': 삭제된 이벤트 아이디
                }

            Raises:
                400, {'message': 'event is not deleted',
                      'errorMessage': 'failed to delete event'} : 이벤트 삭제 실패했을 때

            History:
                    2021-01-04(강두연): 작성
        """
        data = {'event_id': args[0]}

        try:
            connection = get_connection(self.database)
            self.service.event_delete_service(connection, data)
            connection.commit()
            return jsonify({
                'message': 'success',
                'deleted_event_id': data['event_id']
            })

        except Exception as e:
            connection.rollback()
            traceback.print_exc()
            raise e

        finally:
            try:
                if connection:
                    connection.close()
            except Exception:
                raise DatabaseCloseFail('database close fail')
    def get_order_detail_service(self, connection, data):
        try:
            # 권한 조회 및 에러 처리
            if not (data['permission'] == 1 or data['permission'] == 2):
                raise NoPermission('권한이 없습니다.')
            order_item_id = data["order_item_id"]

            # 주문 정보 조회
            order_info = self.admin_order_dao.get_order_info_dao(
                connection, order_item_id)

            # 주문 상세 정보 조회
            order_detail_info = self.admin_order_dao.get_order_detail_info_dao(
                connection, order_item_id)

            # 상품 정보 조회
            product_info = self.admin_order_dao.get_product_info_dao(
                connection, order_item_id)

            # 수취자 정보 조회
            recipient_info = self.admin_order_dao.get_recipient_info_dao(
                connection, order_item_id)

            # 주문 상태 변경 히스토리 조회
            order_status_history = self.admin_order_dao.get_order_status_history_info_dao(
                connection, order_item_id)

            # 최근 업데이트 시각 조회
            updated_at_time = self.admin_order_dao.get_updated_time_dao(
                connection, order_item_id)[0]

            return {
                "order_info": order_info,
                "order_detail_info": order_detail_info,
                "product_info": product_info,
                "recipient_info": recipient_info,
                "order_status_history": order_status_history,
                "updated_at_time": updated_at_time
            }

        except Exception as e:
            raise e
    def get_orders_service(self, connection, data):
        try:
            # 권한 체크 (마스터 혹은 셀러가 아닌 경우)
            if not (data['permission'] == 1 or data['permission'] == 2):
                raise NoPermission('권한이 없습니다.')

            # 2개의 날짜 조건 모두 있는지 확인
            if (data['start_date']
                    and not data['end_date']) or (not data['start_date']
                                                  and data['end_date']):
                raise DateInputDoesNotExist('시작일과 마지막일이 모두 포함되어야 합니다.')

            # 시작일이 마지막일보다 더 늦는 경우
            if data['start_date'] and data['end_date']:
                if data['start_date'] > data['end_date']:
                    raise EndDateIsInvalid("시작일이 마지막일보다 늦습니다.")

            # 날짜 조건과 검색어 조건 둘 중 하나의 조건은 반드시 필요
            if not (data['start_date'] or data['end_date'] or data['number']
                    or data['detail_number'] or data['sender_name']
                    or data['sender_phone'] or data['seller_name']
                    or data['product_name']):
                raise OrderFilterNotExist(
                    '검색어 조건과 날짜 조건 둘 중에 하나는 반드시 포함되어야 합니다.')

            # 페이지네이션
            data['length'] = int(data['length'])
            data['page'] = (data['page'] - 1) * data['length']

            # 주문자 연락처
            if data['sender_phone']:
                data['sender_phone'] = data['sender_phone'].replace("-", "")

            # 상품명
            if data['product_name']:
                data['product_name'] = '%' + data['product_name'] + '%'

            return self.admin_order_dao.get_order_list_dao(connection, data)

        except KeyError:
            raise KeyError('Key Error')
示例#6
0
    def get(self, *args):
        """ 기획전에 추가할 상품 조회

            Args:
                args[0](product_name): 상품이름
                args[1](product_number): 상품번호
                args[2](seller_name): 셀러명
                args[3](seller_number): 셀러번호
                args[4](menu_id): 메뉴 아이디 - 트렌드 4, 브렌드 5, 뷰티 6
                args[5](main_category_id): 1차 카테고리 아이디
                args[6](sub_category_id): 2차 카테고리 아이디
                args[7](page): 페이지 번호
                args[8](length): 페이지네이션 리미트
                args[9](start_date): 등록일 기준 검색할 때 시작날짜
                args[10](end_date): 등록일 기준 검색할 때 끝나는날짜

            Returns: {
                "message": "success",
                "result": {
                    "products": [
                        {
                            "discount_rate": 0.1,
                            "discounted_price": 9000.0,
                            "id": 99,
                            "is_display": 1,
                            "is_sale": 1,
                            "original_price": 10000.0,
                            "product.discounted_price": 9000.0,
                            "product_name": "성보의하루99",
                            "product_number": "P0000000000000000099",
                            "seller_name": "나는셀러5",
                            "thumbnail_image_url": "https://img.freepik.com"
                        },
                        {
                            "discount_rate": 0.1,
                            "discounted_price": 9000.0,
                            "id": 98,
                            "is_display": 1,
                            "is_sale": 1,
                            "original_price": 10000.0,
                            "product.discounted_price": 9000.0,
                            "product_name": "성보의하루98",
                            "product_number": "P0000000000000000098",
                            "seller_name": "나는셀러5",
                            "thumbnail_image_url": "https://img.freepik.com"
                        }
                    ],
                    "total_count": 31
                }
            }

            Raises:
                400, {'message': 'filter must be at least one',
                'errorMessage': 'search filter must be at least one'} : 검색 필터가 하나도 없을 때

                400, {'message': 'search inputs must be only one',
                'errorMessage': 'search value accept only one of name or number'} : 동시에 사용할수 없는 필터가 들어왔을 때

                400, {'message': 'filter does not match',
                'errorMessage': 'upper category is required'} : 상품 분류로 검색할 때 하위카테고리만 있고 상위카테고리는 없는경우

                400, {'message': 'date inputs should be start_date and end_date',
                'errorMessage': 'start_date or end_date is missing'} : 등록일로 검색할 때 시작일 또는 종료일이 하나만 있는경우

            History:
                    2020-12-31(강두연): 초기 작성
        """
        if g.permission_type_id != 1:
            raise NoPermission('마스터 이용자만 사용 가능합니다')

        data = {
            'product_name': args[0],
            'product_number': args[1],
            'seller_name': args[2],
            'seller_number': args[3],
            'menu_id': args[4],
            'main_category_id': args[5],
            'sub_category_id': args[6],
            'page': args[7],
            'length': args[8],
            'start_date': args[9],
            'end_date': args[10]
        }
        if not data['product_name'] \
                and not data['product_number'] \
                and not data['seller_number'] \
                and not data['seller_name'] \
                and not data['menu_id'] \
                and not (data['start_date'] and data['end_date']):
            raise SearchFilterRequired('search filter must be at least one')

        if (data['product_number']
                and data['product_name']) or (data['seller_number']
                                              and data['seller_name']):
            raise SearchTwoInput(
                'search value accept only one of name or number')

        if not data['menu_id'] and (data['main_category_id']
                                    or data['sub_category_id']):
            raise FilterDoesNotMatch('upper category is required')

        if not data['main_category_id'] and data['sub_category_id']:
            raise FilterDoesNotMatch('upper category is required')

        if (data['start_date']
                and not data['end_date']) or (not data['start_date']
                                              and data['end_date']):
            raise DateMissingOne('start_date or end_date is missing')

        try:
            connection = get_connection(self.database)
            products = self.service.get_products_to_post_service(
                connection, data)
            return jsonify({'message': 'success', 'result': products})

        except Exception as e:
            traceback.print_exc()
            raise e

        finally:
            try:
                if connection:
                    connection.close()
            except Exception:
                raise DatabaseCloseFail('database close fail')
示例#7
0
    def get(self, *args):
        """ GET 메소드: 이벤트 리스트 조회

            Args:
                args[0](name): 기획전 이름
                args[1](number): 기획전 번호
                args[2](status): 기획전 상태
                args[3](exposure): 노출 여부
                args[4](page): 페이지 번호
                args[5](length): 페이지네이션 리미트
                args[6](start_date): 등록일 기준 검색할 때 시작날짜
                args[7](end_date): 등록일 기준 검색할 때 끝나는날짜

            Author: 강두연

            Returns:
                {
                    "message": success,
                    "events": [
                        {
                            "created_at": "2020-12-28 16:40:41",
                            "end_date": "2021-03-01 00:00:00",
                            "event_kind": "버튼",
                            "event_name": "성보의 하루 시리즈2(버튼형)",
                            "event_number": 2,
                            "event_status": "진행중",
                            "event_type": "상품(이미지)",
                            "is_display": "노출",
                            "product_count": 59,
                            "start_date": "2020-10-19 00:00:00"
                        },
                        {
                            "created_at": "2020-12-28 16:40:41",
                            "end_date": "2021-03-01 00:00:00",
                            "event_kind": "상품",
                            "event_name": "성보의 하루 시리즈",
                            "event_number": 1,
                            "event_status": "진행중",
                            "event_type": "상품(이미지)",
                            "is_display": "노출",
                            "product_count": 40,
                            "start_date": "2020-10-19 00:00:00"
                        }
                    ],
                    "total_count": 2
                }

            Raises:
                400, {'message': 'search inputs must be only one',
                'errorMessage': 'search value accept only one of name or number'} : 동시에 사용할수 없는 필터가 들어왔을 때

                400, {'message': 'date inputs should be start_date and end_date',
                'errorMessage': 'start_date or end_date is missing'} : 등록일로 검색할 때 시작일 또는 종료일이 하나만 있는경우

            History:
                2020-12-28(강두연): 초기 생성
                2020-12-29(강두연): 검색 조건에 맞게 필터링 기능 작성
        """
        if g.permission_type_id != 1:
            raise NoPermission('마스터 이용자만 사용 가능합니다')

        data = {
            'name': args[0],
            'number': args[1],
            'status': args[2],
            'exposure': args[3],
            'page': args[4],
            'length': args[5],
            'start_date': args[6],
            'end_date': args[7]
        }
        if (data['start_date']
                and not data['end_date']) or (not data['start_date']
                                              and data['end_date']):
            raise DateMissingOne('start_date or end_date is missing')

        if data['name'] and data['number']:
            raise SearchTwoInput(
                'search value accept only one of name or number')

        try:
            connection = get_connection(self.database)
            events = self.service.get_events_service(connection, data)
            return jsonify({'message': 'success', 'result': events})

        except Exception as e:
            traceback.print_exc()
            raise e

        finally:
            try:
                if connection:
                    connection.close()
            except Exception:
                raise DatabaseCloseFail('database close fail')
示例#8
0
    def get(self, *args):
        """ 기획전에 상품추가 페이지에서 상품 카테고리 받아오기

            Args:
                args[0](filter): 데이터베이스 연결 객체
                args[1](menu_id): 메뉴 아이디
                args[2](first_category_id): 1차 카테고리 아이디

            Author: 강두연

            Returns:
                case1: {
                    "message": "success",
                    "result": [
                        {
                            "id": 4,
                            "name": "트렌드"
                        },
                        {
                            "id": 5,
                            "name": "브랜드"
                        },
                        {
                            "id": 6,
                            "name": "뷰티"
                        }
                    ]
                }

                case2: {
                    "message": "success",
                    "result": [
                        {
                            "id": 1,
                            "name": "아우터"
                        },
                        {
                            "id": 2,
                            "name": "상의"
                        },
                        {
                            "id": 3,
                            "name": "바지"
                        },
                        {
                            "id": 4,
                            "name": "원피스"
                        },
                        {
                            "id": 5,
                            "name": "스커트"
                        },
                        {
                            "id": 6,
                            "name": "신발"
                        },
                        {
                            "id": 7,
                            "name": "가방"
                        },
                        {
                            "id": 8,
                            "name": "주얼리"
                        },
                        {
                            "id": 9,
                            "name": "잡화"
                        },
                        {
                            "id": 10,
                            "name": "라이프웨어"
                        },
                        {
                            "id": 11,
                            "name": "빅사이즈"
                        }
                    ]
                }

                case3: {
                    "message": "success",
                    "result": [
                        {
                            "id": 1,
                            "name": "자켓"
                        },
                        {
                            "id": 2,
                            "name": "가디건"
                        },
                        {
                            "id": 3,
                            "name": "코트"
                        },
                        {
                            "id": 4,
                            "name": "점퍼"
                        },
                        {
                            "id": 5,
                            "name": "패딩"
                        },
                        {
                            "id": 6,
                            "name": "무스탕/퍼"
                        },
                        {
                            "id": 7,
                            "name": "기타"
                        }
                    ]
                }

            Raises:
                400, {'message': 'filter does not match',
                'errorMessage': 'upper category is required'} : 키 'filter' 의 값과 주어진 필터링 데이터가 알맞지 않는경우

            History:
                2020-12-31(강두연): 초기 작성
        """
        if g.permission_type_id != 1:
            raise NoPermission('마스터 이용자만 사용 가능합니다')

        data = {
            'filter': args[0],
            'menu_id': args[1],
            'first_category_id': args[2]
        }
        if data['filter'] == "none" and (data['menu_id']
                                         or data['first_category_id']):
            raise FilterDoesNotMatch('error: filter does not match')
        elif data['filter'] == "menu":
            if not data['menu_id']:
                raise FilterDoesNotMatch('error: filter does not match')
            if data['first_category_id']:
                raise FilterDoesNotMatch('error: filter does not match')
        elif data['filter'] == "both":
            if not data['menu_id'] or not data['first_category_id']:
                raise FilterDoesNotMatch('error: filter does not match')

        try:
            connection = get_connection(self.database)
            result = self.service.get_products_category_service(
                connection, data)
            return jsonify({'message': 'success', 'result': result})

        except Exception as e:
            traceback.print_exc()
            raise e

        finally:
            try:
                if connection:
                    connection.close()
            except Exception:
                raise DatabaseCloseFail('database close fail')
示例#9
0
    def put(self, *args):
        """ 기획전 수

            Args:
                args[0] (event_id): 기획전 번호(아이디)
                name: 기획전 이름
                start_datetime: 기획전 시작날짜시간
                end_datetime: 기획전 종료날짜시간
                is_display: 노출여부
                banner_image_uploaded: 배너이미지 수정여부
                detail_image_uploaded: 상세이미지 수정여부
                buttons: 기획전에 수정된 버튼 (최종 버튼)
                products: 기획전에 수정된 상품 (최종 상품)
                banner_image: 배너이미지 파일
                detail_image: 상세이미지 파일

            Returns: {
                'message': 'success',
                'event_id': 수정된 기획전 아이디
            }

            Raises:
                400, {'message': 'at least two buttons should be created',
                      'errorMessage': 'button is required'} : 기획전 종류가 버튼형일때 버튼이 없을 때

                400, {'message': 'at least two buttons should be created',
                      'errorMessage': 'at least two buttons are required'} : 기획전 종류가 버튼인데 2개 미만의 버튼이 들어왔을 때

                400, {
                    'message': 'button name is required in each product',
                    'errorMessage': 'button name is required in each product'
                } : 기획전 종류가 버튼인데 상품에 버튼이름 키,값이 없을 때

                400, {'message': 'Event kind does not match',
                      'errorMessage': 'event kind is not buttons'} : 기획전 종류가 버튼형이 아닌데 버튼들에 대한 정보가 들어왔을 때

                400, {'message': 'image files are required',
                      'errorMessage': 'image is required'} : 이미지가 필요함

                400, {'message': 'start date and end date context error',
                      'errorMessage': 'start and end datetime context error'} : 시작날짜가 종료날짜보다 미래일 때

            History:
                    2021-01-04(강두연): 초기 작성
        """
        if g.permission_type_id != 1:
            raise NoPermission('마스터 이용자만 사용 가능합니다')

        data = {
            'event_id': args[0],
            'name': request.form.get('name'),
            'start_datetime': request.form.get('start_datetime'),
            'end_datetime': request.form.get('end_datetime'),
            'is_display': request.form.get('is_display'),
            'banner_image_uploaded': request.form.get('banner_image_uploaded'),
            'detail_image_uploaded': request.form.get('detail_image_uploaded')
        }

        if data['banner_image_uploaded'] == '1':
            data['banner_image_uploaded'] = True
            banner_image = request.files.get('banner_image')
            # 이미지 파일 존재 유무 확인
            if not banner_image or not banner_image.filename:
                raise ImageIsRequired('banner image is required')
            data['banner_image'] = banner_image
        else:
            data['banner_image_uploaded'] = False

        if data['detail_image_uploaded'] == '1':
            data['detail_image_uploaded'] = True
            detail_image = request.files.get('detail_image')
            # 이미지 파일 존재 유무 확인
            if not detail_image or not detail_image.filename:
                raise ImageIsRequired('detail image is required')
            data['detail_image'] = detail_image
        else:
            data['detail_image_uploaded'] = False

        buttons = request.form.get('buttons')
        products = request.form.get('products')

        if products:
            products = json.loads(products)

        # 시작 날짜가 종료날짜보다 미래일 때
        start = datetime.strptime(data['start_datetime'], "%Y-%m-%d %H:%M")
        end = datetime.strptime(data['end_datetime'], "%Y-%m-%d %H:%M")

        if start >= end:
            raise StartAndEndDateContext(
                'start and end datetime context error')

        try:
            connection = get_connection(self.database)

            # 기획전 종류 체크
            data['event_kind_id'] = self.service.get_event_kind_id_service(
                connection, data['event_id'])
            if data['event_kind_id'] == 2:
                # 기획전 종류가 버튼인데 버튼이 없을 때
                if not buttons:
                    raise ButtonsMinimumCount('button is required')

                buttons = json.loads(buttons)

                # 기획전 종류가 버튼인데 2개 미만의 버튼이 들어왔을 때
                if len(buttons) < 2:
                    raise ButtonsMinimumCount(
                        'at least two buttons are required')

                # 기획전 종류가 버튼인데 상품에 버튼이름 키,값이 없을 때
                if products:
                    for product in products:
                        if 'button_name' not in product or not product[
                                'button_name']:
                            raise ProductButtonNameRequired(
                                'button name is required in each product')

            # 기획전 종류가 버튼형이 아닌데 버튼들에 대한 정보가 들어왔을 때
            elif data['event_kind_id'] != 2 and buttons:
                print(data['event_kind_id'])
                raise EventKindDoesNotMatch('event kind is not buttons')

            self.service.modify_event_service(connection, data, buttons,
                                              products)

            connection.commit()

            return jsonify({
                'message': 'success',
                'event_id': data['event_id']
            }), 200

        except Exception as e:
            traceback.print_exc()
            connection.rollback()
            raise e

        finally:
            try:
                if connection:
                    connection.close()
            except Exception:
                raise DatabaseCloseFail('database close fail')
示例#10
0
    def get(self, *args):
        """ 이벤트 상세정보 및 등록된 상품 조회

            Args:
               args[0](event_id) : 이벤트 아이디

            Author: 강두연

            Returns:
                기획전 종류가 상품일 때
                {
                    "message": "success",
                    "result": {
                        "event_detail": {
                            "banner_image": "https://brandi-intern-8.s3.amazonaws.com/events/2021/01/03/banners",
                            "detail_image": "https://brandi-intern-8.s3.amazonaws.com/events/2021/01/03/details",
                            "end_date": "2021-01-05 23:13:00",
                            "event_id": 20,
                            "event_kind": "상품",
                            "event_kind_id": 1,
                            "event_name": "이벤트(상품동시추가)생성",
                            "event_type": "상품(이미지)",
                            "event_type_id": 1,
                            "is_display": 1,
                            "start_date": "2021-01-02 12:13:00"
                        },
                        "event_products": {
                            "products": [
                                {
                                    "discount_rate": 0.1,
                                    "discounted_price": 9000.0,
                                    "event_button_id": null,
                                    "event_id": 20,
                                    "id_discount": "할인",
                                    "is_display": "진열",
                                    "is_sale": "판매",
                                    "original_price": 10000.0,
                                    "product_created_at": "2020-12-25 00:17:36",
                                    "product_id": 3,
                                    "product_name": "성보의하루3",
                                    "product_number": "P0000000000000000003",
                                    "seller_name": "나는셀러2",
                                    "thumbnail_image_url": "https://img.freepik.com/free-psd"
                                },
                                {
                                    "discount_rate": 0.1,
                                    "discounted_price": 9000.0,
                                    "event_button_id": null,
                                    "event_id": 20,
                                    "id_discount": "할인",
                                    "is_display": "진열",
                                    "is_sale": "판매",
                                    "original_price": 10000.0,
                                    "product_created_at": "2020-12-25 00:17:36",
                                    "product_id": 2,
                                    "product_name": "성보의하루2",
                                    "product_number": "P0000000000000000002",
                                    "seller_name": "나는셀러8",
                                    "thumbnail_image_url": "https://img.freepik.com/free-psd"
                                }
                            ],
                            "total_count": 2
                        }
                    }
                }
                기획전 종류가 버튼일 때
                {
                    "message": "success",
                    "result": {
                        "event_buttons": [
                            {
                                "id": 4,
                                "name": "버튼1",
                                "order_index": 1,
                                "product_count": 1,
                                "products": [
                                    {
                                        "discount_rate": 0.1,
                                        "discounted_price": 9000.0,
                                        "event_button_id": 4,
                                        "event_id": 22,
                                        "id_discount": "할인",
                                        "is_display": "진열",
                                        "is_sale": "판매",
                                        "original_price": 10000.0,
                                        "product_created_at": "2020-12-25 00:17:36",
                                        "product_id": 1,
                                        "product_name": "성보의하루1",
                                        "product_number": "P0000000000000000001",
                                        "seller_name": "나는셀러9",
                                        "thumbnail_image_url": "https://img.freepik.com/free-psd"
                                    }
                                ]
                            },
                            {
                                "id": 5,
                                "name": "버튼2",
                                "order_index": 2,
                                "product_count": 2,
                                "products": [
                                    {
                                        "discount_rate": 0.1,
                                        "discounted_price": 9000.0,
                                        "event_button_id": 5,
                                        "event_id": 22,
                                        "id_discount": "할인",
                                        "is_display": "진열",
                                        "is_sale": "판매",
                                        "original_price": 10000.0,
                                        "product_created_at": "2020-12-25 00:17:36",
                                        "product_id": 3,
                                        "product_name": "성보의하루3",
                                        "product_number": "P0000000000000000003",
                                        "seller_name": "나는셀러2",
                                        "thumbnail_image_url": "https://img.freepik.com/free-psd"
                                    },
                                    {
                                        "discount_rate": 0.1,
                                        "discounted_price": 9000.0,
                                        "event_button_id": 5,
                                        "event_id": 22,
                                        "id_discount": "할인",
                                        "is_display": "진열",
                                        "is_sale": "판매",
                                        "original_price": 10000.0,
                                        "product_created_at": "2020-12-25 00:17:36",
                                        "product_id": 2,
                                        "product_name": "성보의하루2",
                                        "product_number": "P0000000000000000002",
                                        "seller_name": "나는셀러8",
                                        "thumbnail_image_url": "https://img.freepik.com/free-psd"
                                    }
                                ]
                            }
                        ],
                        "event_detail": {
                            "banner_image": "https://brandi-intern-8.s3.amazonaws.com/events/2021/01/03/banners",
                            "detail_image": "https://brandi-intern-8.s3.amazonaws.com/events/2021/01/03/details",
                            "end_date": "2021-01-05 23:13:00",
                            "event_id": 22,
                            "event_kind": "버튼",
                            "event_kind_id": 2,
                            "event_name": "이벤트(상품동시추가)생성",
                            "event_type": "상품(이미지)",
                            "event_type_id": 1,
                            "is_display": 1,
                            "start_date": "2021-01-02 12:13:00"
                        }
                    }
                }

            History:
                2020-12-31(강두연): 작성
        """
        data = {'event_id': args[0]}
        if g.permission_type_id != 1:
            raise NoPermission('마스터 이용자만 사용 가능합니다')

        try:
            connection = get_connection(self.database)
            result = self.service.get_event_detail_service(connection, data)
            return jsonify({"message": "success", "result": result})

        except Exception as e:
            traceback.print_exc()
            raise e

        finally:
            try:
                if connection:
                    connection.close()
            except Exception:
                raise DatabaseCloseFail('database close fail')