資料庫小組
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ###### tags: `Reports` # Report 3 (5/20) [toc] ## E-R diagram 轉成 Relational Table 之 DDL 的形式 ``` create table User (id int NOT NULL AUTO_INCREMENT, username varchar(20), password varchar(40) NOT NULL, #encrypted by sha1() hashing function primary key (id) ) ENGINE=INNODB; create table Product (user_id int, product_id int NOT NULL AUTO_INCREMENT, name varchar(20), description TEXT, category varchar(30) check (category in ('Antiques', 'Art', 'Books', 'CDs, DVDs, Games', 'Clothing', 'Collectibles', 'Computers', 'Dining', 'Electronics', 'Food & Gourmet Items', 'For Your Pet', 'Golf & Sports Gear', 'Handbags', 'Health & Fitness', 'Home', 'Jewelry', 'Lawn & Garden', 'Memorabilia', 'Other', 'Services', 'Spa & Beauty', 'Tickets-Entertainment', 'Tickets-Sports', 'Toys', 'Travel', 'Unique Experiences', 'Wine' )), image varchar(10000), #stores URL start_time DATE NOT NULL, end_time DATE NOT NULL, start_price int check(start_price >= 0), current_price int DEFAULT -1, date_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, primary key (product_id), foreign key (user_id) references User(id) on delete cascade, ) ENGINE=INNODB; create table watchlist (user_id int, product_id int, primary key (user_id, product_id), foreign key (user_id) references User(id) on delete cascade, foreign key (product_id) references Product(product_id) on delete cascade ) ENGINE=INNODB; create table comments (user_id int, product_id int, comment TEXT, date_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, primary key (user_id, product_id, date_time), foreign key (user_id) references User(id) on delete cascade, foreign key (product_id) references Product(product_id) on delete cascade ) ENGINE=INNODB; create table winner (user_id int, product_id int, primary key (user_id, product_id), foreign key (user_id) references User(id) on delete cascade, foreign key (product_id) references Product(product_id) on delete cascade ) ENGINE=INNODB; BID_FINAL 沒有用到!!!!!!!!! create table bid_final (user_id int, product_id int, is_notified boolean, date_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, primary key (user_id, product_id), foreign key (user_id) references User(id) on delete cascade, foreign key (product_id) references Product(product_id) on delete cascade, ) ENGINE=INNODB; create table Bid_record (user_id int, product_id int, date_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, bid_price int, primary key (user_id, product_id, date_time), foreign key (user_id) references User(id) on delete cascade, foreign key (product_id) references Product(product_id) on delete cascade, ) ENGINE=INNODB; ``` ## 系統內容功能詳細敘述 ### 管理者: 功能 ##### 解決下標糾紛: * 檢視下標列表 管理者能夠檢視網站近期所以的下標明細,如果有消費糾紛的話,能夠調閱資料維護消費公平性。 * 強制下架商品 管理者發現有違反規定之物品,或是拍賣狀態有異常時,能夠手動下架這些物品,避免發生更多問題。 ### 使用者: 主要功能: * 瀏覽商品 提供使用者瀏覽目前正在進行的競標 * 瀏覽使用者商品 提供使用者瀏覽自己上架的競標,與得標的商品 * 上架商品 提供使用者上架欲拍賣的商品,使用者需填寫商品名稱、商品類別、商品照片、競標開始與結束時間與起標價格等資訊 * 依據商品的類別搜尋 於瀏覽商品頁面能根據不同商品類別搜尋,類別包含 >`Antiques, Art, Books, CDs DVDs Games, Clothing, Collectibles, Computers, Dining, Electronics, Food & Gourmet Items, For Your Pet, Golf & Sports Gear, Handbags, Health & Fitness, Home, Jewelry, Lawn & Garden, Memorabilia, Other, Services, Spa & Beauty, Tickets-Entertainment, Tickets-Sports, Toys, Travel, Unique Experiences, Wine` * 於商品頁面競標 在各個商品頁面,設置可以競標的區塊,讓使用者進行競標 附加功能: * 於商品頁面留言 在商品的頁面下留下你的言論,記錄了問題內容,使用者id及時間。 * 將商品加入或刪除於觀看名單 每個使用者會有自己的觀看名單,而在商品頁會有個按鈕讓使用者可以將此商品加入自己的觀看名單,方便使用者下次查詢 * 瀏覽觀看名單的商品 提供使用者瀏覽自己加入觀看名單的競標,包含正在進行與結束的競標 * 通知小鈴鐺 此小鈴鐺通知使用者,有其他使用者出的價格更高,或是由他人得標,或是競標時間即將結束。 ## 系統功能實作規劃 ### 流程圖 (許欣平) ![](https://i.imgur.com/tt97OgV.jpg) ### 介面設計 (許哲安) |編號| 頁面 | | -------| -------- | |FE-01| 登入 | |FE-02| 瀏覽商品 | |FE-03| 上架商品 | |FE-04| 競標商品 | |FE-05| 商品列表 | |FE-06| 商品下標列表 | * FE-01 #### 包含登入與創建新帳號 登入Login ![](https://i.imgur.com/V6rkQYe.png) 創建新帳號CreateNewAccount ![](https://i.imgur.com/3HYUb3H.png) * FE-02 Listing ![](https://i.imgur.com/KI6h4d8.png) * FE-03 CreateListing ![](https://i.imgur.com/TirVuCi.png) * FE-04 Product ![](https://i.imgur.com/zxq9C0w.png) * FE-05 BidListAuction ![](https://i.imgur.com/QvPDsUB.png) * FE-06 BidList ![](https://i.imgur.com/N8EagEe.png) ### 連結資料庫部份之技術 (林俊誠) **django + mysql** django是個用 Python 寫成的,免費而且開放原始碼的 Web 應用程式框架。他是個 Web 框架,可以幫助開發網站。 django會有些固定的檔案結構 manage.py settings.py urls.py wsgi.py __init__.py 為了連接mysql資料庫,將settings.py中預設 ``` DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } ``` 更改為 ``` DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'databaseName', 'USER': 'databaseUser', 'PASSWORD': 'databasePassword', 'HOST': 'localhost', 'PORT': 'portNumber', } } ``` | 密鑰 | 內容 | | -------- | -------- | | NAME | 此鍵存儲您的 MySQL 數據庫的名稱。 | | USER | 此密鑰存儲您的 MySQL 帳戶的用戶名,將使用該用戶名連接 MySQL 數據庫。 | | PASSWORD | 此密鑰存儲該 MySQL 帳戶的密碼。 | | HOST |此密鑰存儲託管 MySQL 數據庫的 IP 地址。 | | PORT |此密鑰存儲託管 MySQL 數據庫的端口號。 | ## 預定工作分配 許哲安 * 前端設計 * 瀏覽商品 * 上架商品 * 依據商品的類別搜尋 * 瀏覽觀看名單的商品 許欣平 * 檢視下標列表 * 強制下架商品 * 登入、登出 林俊誠 * 於商品頁面競標 * 於商品頁面留言 * 將商品加入或刪除於觀看名單 * 通知小鈴鐺

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully