@startuml title 画面遷移 [*] -> 商品一覧 商品一覧 --> 追加入力: 追加リンク 追加入力 --> 追加: 追加ボタン 商品一覧 --> 削除確認: 削除リンク 削除確認 --> 削除: 削除ボタン 商品一覧 --> 変更入力: 変更リンク 変更入力 --> 変更: 変更ボタン 商品一覧 --> 売上: 売上リンク 商品一覧 --> 検索: 検索ボタン @enduml
@startuml title 商品の削除 autonumber "#." actor ユーザ boundary 商品一覧 boundary 削除確認 control 販売管理 database 商品DB entity 商品 ユーザ -[#green]> 商品一覧:削除リンククリック 商品一覧 -> 販売管理:削除確認(商品ID) 販売管理-> 商品DB:検索(商品ID) 商品DB -> 商品:生成 商品DB --> 販売管理:商品 販売管理 -> 削除確認:表示 削除確認--[#green]>ユーザ:表示 ユーザ -[#green]> 削除確認:削除ボタン 削除確認 -> 販売管理:商品削除(商品ID) 販売管理 -> 商品DB:削除(商品ID) 販売管理 -> 商品一覧:遷移 商品一覧 --[#green]> ユーザ:表示 @enduml
@startuml left to right direction package コントローラ{ class 販売管理{ 商品一覧() 商品追加(商品) 商品削除(商品ID) 削除確認(商品ID) 商品編集(商品ID) 商品変更(商品) 売上一覧() 検索(商品名) } } package モデル{ class 商品{ -商品ID -商品名 -単価 -カテゴリID } class 商品DB{ +全検索():商品リスト +検索(商品ID):商品 +追加(商品) +変更(商品) +削除(商品ID) } class 売上{ -売上 -商品ID -個数 -売上日付 } class 売上DB{ +検索(商品ID):売上リスト } class カテゴリ{ -カテゴリID -カテゴリ名 } class カテゴリDB{ +全検索():カテゴリリスト } } 販売管理 --> 商品DB 販売管理 --> 売上DB 販売管理 --> カテゴリDB 売上 -> 商品 商品 -> カテゴリ 商品DB o-- 商品 売上DB o-- 売上 カテゴリDB o-- カテゴリ @enduml
@startuml title ページ遷移図 slist : GET 商品一覧 insert: GET 追加フォーム\nPOST 追加 del: GET 削除確認\nPOST 削除 edit: GET 変更入力\nPOST 更新 uriage :GET 売上一覧 search: GET 検索 [*]->slist slist-->insert: リンク insert-->insert: POST\n追加ボタン\nShouhin slist-->del: リンク\n/sid del-->del: POST\n削除ボタン\nsid slist-->edit: リンク\n/sid edit-->edit: POST\n変更ボタン\nShouhin slist-->uriage: リンク\n/sid slist-->search: 検索ボタン\nsname @enduml
@startuml @startuml title 商品一覧 autonumber "#." actor ユーザ boundary "/slist" as slist control HanbaiController database ShouhinRepository entity Shouhin participant Model ユーザ -[#green]> slist:GET slist -> HanbaiController:slist(model) HanbaiController-> ShouhinRepository:findAll() ShouhinRepository -> Shouhin:生成 ShouhinRepository --> HanbaiController:Listlist HanbaiController->Model:list HanbaiController-->slist:slist.html slist --[#green]> ユーザ:表示 @enduml
@startuml title 商品の削除 autonumber "#." actor ユーザ boundary "/slist" as slist boundary "/del" as del control HanbaiController database ShouhinRepository entity Shouhin participant Model ユーザ -[#green]> slist:削除リンク slist -[#blue]> del:GET del -> HanbaiController:del(sid, model) HanbaiController-> ShouhinRepository:findById(sid) ShouhinRepository -> Shouhin:生成 ShouhinRepository --> HanbaiController:shouhin HanbaiController->Model:shouhin HanbaiController-->del:del.html del --[#green]> ユーザ:確認画面 ユーザ -[#green]> del:削除ボタン del -[#blue]> del:POST del -> HanbaiController:del(sid) HanbaiController -> ShouhinRepository:deleteById(sid) HanbaiController -[#blue]> slist:リダイレクト slist --[#green]> ユーザ:表示 @enduml
@startuml @startuml left to right direction package controller{ class HanbaiController{ +slist(Model model) +insert(Shouhin s) +del(int sid,Model model) +del(int sid) +edit(int sid, Model model) +edit(Shouhin s) +uriage(int sid, Model model) +search(String sname, Model model) } } package model{ class Shouhin{ -sid : int -sname : String -tanka : int } class Uriage{ -uid : int -sid : int -kosu : int -hi : Date } class Category{ -cid : int -cname : String } interface UriageRepository{ +findBySid(int sid):List} interface ShouhinRepository{ +findBySname(String sname):List } interface CategoryRepository{ } } HanbaiController --> ShouhinRepository HanbaiController --> UriageRepository HanbaiController --> CategoryRepository Uriage -> Shouhin Shouhin -> Category ShouhinRepository o-- Shouhin UriageRepository o-- Uriage CategoryRepository o-- Category @enduml @enduml