통합검색 - Team-MySide/MySide_Server Wiki

Original URL: https://github.com/Team-MySide/MySide_Server/wiki/통합검색

통합검색 (키워드는 자동완성)

메소드 경로 짧은 설명
GET /search/total/:keyword 통합 검색

요청 파람스

keyword: 암 명칭 OR 영양성분 OR 음식 (자동완성)

자동완성, 통합검색 API 참조

예시

/search/total/위암

요청 헤더

Content-Type: application/json,
token: access-token // 로그인 시 받은 token을 넣어주세요.., 안넣어도 비로그인으로 처리 

요청 바디

응답 바디

flag : food, nutrition, cancer

성공

{
    "status": 200,
    "success": true,
    "message": "통합 검색 성공",
    "data": [
        {
            "food_id": 203,
            "name": "당근",
            "img": "https://mysidebucket.s3.ap-northeast-2.amazonaws.com/02%E1%84%8E%E1%85%A2%E1%84%89%E1%85%A9_%E1%84%83%E1%85%A1%E1%86%BC%E1%84%80%E1%85%B3%E1%86%AB.png",
            "category": "채소류",
            "background_color": "FFF3D9",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "위암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 204,
            "name": "빨간고추",
            "img": "",
            "category": "채소류",
            "background_color": "",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "위암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 205,
            "name": "시금치(포항초)",
            "img": "",
            "category": "채소류",
            "background_color": "123123",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "위암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 205,
            "name": "시금치(포항초)",
            "img": "",
            "category": "채소류",
            "background_color": "123123",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "위암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 206,
            "name": "쑥",
            "img": "",
            "category": "채소류",
            "background_color": "",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "위암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 206,
            "name": "쑥",
            "img": "",
            "category": "채소류",
            "background_color": "",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "위암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 213,
            "name": "마늘",
            "img": "https://mysidebucket.s3.ap-northeast-2.amazonaws.com/%EB%A7%88%EB%8A%98.png",
            "category": "채소류",
            "background_color": "",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "위암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 213,
            "name": "마늘",
            "img": "https://mysidebucket.s3.ap-northeast-2.amazonaws.com/%EB%A7%88%EB%8A%98.png",
            "category": "채소류",
            "background_color": "",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "위암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 215,
            "name": "연어(홍연어)",
            "img": "",
            "category": "해산물",
            "background_color": "",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "유방암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 218,
            "name": "우유",
            "img": "",
            "category": "기타",
            "background_color": "",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "유방암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 219,
            "name": "우유(저지방)",
            "img": "",
            "category": "기타",
            "background_color": "",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "유방암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 220,
            "name": "우유(고칼슘)",
            "img": "",
            "category": "기타",
            "background_color": "",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "유방암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 221,
            "name": "분유(탈지)",
            "img": "",
            "category": "기타",
            "background_color": "",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "유방암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 226,
            "name": "치즈(체다)",
            "img": "",
            "category": "기타",
            "background_color": "",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "유방암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 227,
            "name": "치즈(모짜렐라)",
            "img": "",
            "category": "기타",
            "background_color": "",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "유방암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 230,
            "name": "토마토",
            "img": "https://mysidebucket.s3.ap-northeast-2.amazonaws.com/02%E1%84%8E%E1%85%A2%E1%84%89%E1%85%A9_%E1%84%90%E1%85%A9%E1%84%86%E1%85%A1%E1%84%90%E1%85%A9.png",
            "category": "채소류",
            "background_color": "FFEFE7",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "대장암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 230,
            "name": "토마토",
            "img": "https://mysidebucket.s3.ap-northeast-2.amazonaws.com/02%E1%84%8E%E1%85%A2%E1%84%89%E1%85%A9_%E1%84%90%E1%85%A9%E1%84%86%E1%85%A1%E1%84%90%E1%85%A9.png",
            "category": "채소류",
            "background_color": "FFEFE7",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "대장암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 239,
            "name": "양배추",
            "img": "https://mysidebucket.s3.ap-northeast-2.amazonaws.com/02%E1%84%8E%E1%85%A2%E1%84%89%E1%85%A9_%E1%84%8B%E1%85%A3%E1%86%BC%E1%84%87%E1%85%A2%E1%84%8E%E1%85%AE.png",
            "category": "채소류",
            "background_color": "EEF8D8",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "대장암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 239,
            "name": "양배추",
            "img": "https://mysidebucket.s3.ap-northeast-2.amazonaws.com/02%E1%84%8E%E1%85%A2%E1%84%89%E1%85%A9_%E1%84%8B%E1%85%A3%E1%86%BC%E1%84%87%E1%85%A2%E1%84%8E%E1%85%AE.png",
            "category": "채소류",
            "background_color": "EEF8D8",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "대장암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 239,
            "name": "양배추",
            "img": "https://mysidebucket.s3.ap-northeast-2.amazonaws.com/02%E1%84%8E%E1%85%A2%E1%84%89%E1%85%A9_%E1%84%8B%E1%85%A3%E1%86%BC%E1%84%87%E1%85%A2%E1%84%8E%E1%85%AE.png",
            "category": "채소류",
            "background_color": "EEF8D8",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "대장암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        },
        {
            "food_id": 203,
            "name": "당근",
            "img": "https://mysidebucket.s3.ap-northeast-2.amazonaws.com/02%E1%84%8E%E1%85%A2%E1%84%89%E1%85%A9_%E1%84%83%E1%85%A1%E1%86%BC%E1%84%80%E1%85%B3%E1%86%AB.png",
            "category": "채소류",
            "background_color": "FFF3D9",
            "foreground_color": "",
            "wishes": 0,
            "likes": 0,
            "cancerNm": "폐암",
            "nutrition": "Vitamin_C",
            "flag": "nutrition"
        }
    ]
}

DB 오류

{
    "status": 600,
    "success": false,
    "message": "DB 오류 입니다"
}

INTERNAL_SERVER_ERROR

{
    "status": 500,
    "success": false,
    "message": "내부 서버 오류 입니다"
}