---
# System prepended metadata

title: LOL

---

# LOL


## 相關連結

- [Github](https://github.com/Yu-Hsuan-1220/Database-Project?fbclid=IwZXh0bgNhZW0CMTEAAR2u4tV0YydyADGQKbz-ThNy8KPe_bx9temygm0WiKqfaelEfSa3RKWe5DE_aem_dobSo_3opdyNEH9gIFMKjQ)

- [Word Proposal](https://docs.google.com/document/d/15RRnk6UsR6baaO-G6HQgI7PPnh71IgNE1MCzyvw_5P4/edit?fbclid=IwZXh0bgNhZW0CMTEAAR2ufaqAP6-jK6zseqLvSXdimMnl9VG4olE7dsujJlW08eBLWf2UuznSctw_aem_TuHF7Gk5-44mjMxrX2LoGA&pli=1&tab=t.8swj2ktrck8f)

- [Report](https://docs.google.com/document/d/1SPLtlShw0P_0GqSCZJdhvkao2JO2u7Y8q7gyfcs7Ywc/edit?tab=t.ert0kpxps5n1#heading=h.n4qxlj7eg67g)

- [PPT](https://www.canva.com/design/DAGajjBjvwY/qjkENWl0zawVbIpmE8sNHQ/edit?utm_content=DAGajjBjvwY&utm_campaign=designshare&utm_medium=link2&utm_source=sharebutton)

- Dataset
    - [champion_stats_S12](https://www.kaggle.com/datasets/vivovinco/league-of-legends-champion-stats/data)
    - [champion_stats_S13](https://www.kaggle.com/datasets/vivovinco/league-of-legends-stats-s13)
    - [S4開始的180000場的積分對戰資料](https://www.kaggle.com/datasets/paololol/league-of-legends-ranked-matches/data?select=teamstats.csv)


- [組員名單](https://docs.google.com/spreadsheets/d/15W61o0fwhSG5l8hu2JFP_i7UKWLNPPkQ27gHDo2wA5U/edit?gid=0#gid=0)

## 討論紀錄

task 
- 做封面可以連節所有頁面(/)

    看要不要加甚麼，圖片動畫或介紹網頁甚麼的
    
- 創建user功能 (/adduser)
    
    就單純創建使用者，帳號與密碼(user winrate 要用)
    
- 英雄資料查詢系統
 
    給賽季(s12-s13)與英雄，回傳路線與強度等資料

- 對局 

    功能還在想
- user evaluation系統 (/evaluation) ----finish
- user winrate系統 (/winrate) ----finish
## API 與 資料json格式
- 範例 : evaluation系統  /evaluation
    - 顯示資料
        - request: get /evaluation/data?role=路線
        
        - response: {"result" : array}
        element in array = { "ID": 6, "hero": '雷文', "role": '上路', "rate": 6}
        
    - 新增資料
        -  request: post /evalation/data
        ```data {"hero" : heroname, "role" : rolename, "rate" : rate}```
        
        -  response: {"message" , "成功"} or {"message" : "插入資料失敗"}

        
            
    - 刪除資料
    - 修改資料

- personal winrate 系統 /winrate
    - 懶得寫

- 新增 username 與密碼  /adduser
    - 新增使用者
        - request /adduser/addNewUser
            data = {"username" : username, "passwd" : password}
        - response
            {"result" : "already_exist"}
            {"result" : "fail"}
            {"result" : "success"}
- s12~s13英雄資料查詢系統 /heroData
    - 查詢賽季英雄資料
        - request /heroData/hero?hero={heroname}&season={season}
        - response
            {"result" = "NoData"}
            {"result" = [array of datas]}
            
            data = {"name":"LUX" , "role": "mid", "tier" = "S", "score" = 66.92, "win_rate" : 51.08, "pick_rate" : 14.64, "ban_rate" = 12.68, "kda" = 2.53}

- Match data
    - 查詢兩個英雄對線勝率
        - request
         data = {
            hero1: hero1 name
            hero2: hero2 name
        };
    - 查詢特殊條件下的勝率
        - request get /match/calculate?type=dragon(blue, baron, inhib, tower)
        - response 
            {"result" : winrate};


## table
hero_evaluation
- ID
- hero
- role
- rate

users
- username
- password

users_game
- username
- hero
- role
- is_win

12.(1~23) & 13.({1~13} - {2})
- name
- role
- tier
- score
- win_rate
- pick_rate
- ban_rate
- kda

champ(與下面heroid對照出英雄名字)
- name
- id 

participants
- id
- matchid
- player (1~10)
- heroid (foreign key champ id)
- role

states (for each player in each match)
- id (participant id)
- win (0-lose 1-win)

teamstates
- matchid
- teamid (player 1~5 teamid = 100, player 6~10 teamid = 200)
- firstblood (1 or 0)
- firsttower
- firstinhib
- firstdragon
- firstbaron














