@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 @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