diff --git a/HELP.md b/HELP.md index 1bb2acd..cffb91e 100644 --- a/HELP.md +++ b/HELP.md @@ -27,4 +27,11 @@ ### H2 console http://localhost:8080/h2-console/ +--- +## 設計図 + +- [クラス図](uml/class.png) +- [controller](uml/controller.png) +- [geojson](uml/geojson.png) +- [TaskStatus](uml/TaskStatus.png) diff --git a/uml/TaskStatus.png b/uml/TaskStatus.png new file mode 100644 index 0000000..0f4ef49 --- /dev/null +++ b/uml/TaskStatus.png Binary files differ diff --git a/uml/TaskStatus.pu b/uml/TaskStatus.pu new file mode 100644 index 0000000..8f84573 --- /dev/null +++ b/uml/TaskStatus.pu @@ -0,0 +1,44 @@ +@startuml + +state "準備中" as PREPARATION #FFFFFF { +} + +state "受付中" as ACCEPTING #orange { +} + +state "NG" as NG #red { + NG : 担当者 + NG : 種別 + NG : 事象 +} + +state "担当登録済み" as RESERVED #yellow { + RESERVED : 担当者 +} + +state "インポート済み" as IMPORTED #lightgreen { + IMPORTED : 担当者 + IMPORTED : 変更セットNo +} + +state "完了" as END #green { + END : 担当者 + END : 変更セットNo + END : 検証者 +} + +[*] --> PREPARATION +PREPARATION --> ACCEPTING +ACCEPTING --> RESERVED : 担当登録 +NG --> RESERVED : 担当登録 +ACCEPTING --> IMPORTED : 編集完了 +NG --> IMPORTED : 編集完了 +RESERVED --> NG : 編集中止 +RESERVED --> IMPORTED : 編集完了 +IMPORTED --> IMPORTED : 編集完了 +ACCEPTING <- RESERVED : 担当取消 + +IMPORTED --> END : 検証[OK] +NG <- IMPORTED : 検証[NG] + +@enduml \ No newline at end of file diff --git a/uml/class.png b/uml/class.png new file mode 100644 index 0000000..720e895 --- /dev/null +++ b/uml/class.png Binary files differ diff --git a/uml/class.pu b/uml/class.pu new file mode 100644 index 0000000..2ea8599 --- /dev/null +++ b/uml/class.pu @@ -0,0 +1,209 @@ +@startuml + +database "h2" as db { + entity city { + + citycode : VARCHAR 255 + cityname : VARCHAR 255 + folder : VARCHAR 255 + lng : VARCHAR 255 + lat :VARCHAR 255 + } + + entity site_user { + + id : BIGINT + active : BOOLEAN + admin : BOOLEAN + email : VARCHAR 255 + password : VARCHAR 255 + role :VARCHAR 255 + username :VARCHAR 20 + } + + entity citymesh { + + citycode : VARCHAR 255 + + meshcode : VARCHAR 255 + version :VARCHAR 255 + path : VARCHAR 255 + line : VARCHAR 255 + point :VARCHAR 255 + city : City@ManyToOne + } + + city |o--|{ citymesh + + entity task { + +currentId : VARCHAR 255 + preId : VARCHAR 255 + citycode : VARCHAR 255 + meshcode : VARCHAR 255 + status : Status + username : VARCHAR 255 + validator : VARCHAR 255 + operation : Operation + updateTime : Date + mesh : @ManyToOne + } + citymesh ||--o{ task +} +note bottom of db : spring.datasource.url=jdbc:h2:./taskdb\nspring.jpa.hibernate.ddl-auto=update + +class SecurityConfig <> { + - userDetailsService : UserDetailsService + + passwordEncoder() : PasswordEncoder + + configure(WebSecurity) + configure(HttpSecurity) + configure(AuthenticationManagerBuilder) +} + +class UserDetailsServiceImpl <> { + - userRepository : SiteUserRepository + + loadUserByUsername(username) : UserDetails + + createUserDetails(:SiteUser) : User +} + +class SecurityController <> { + - userRepository : userRepository + - passwordEncoder : PasswordEncoder + + success() + + showList(loginUser, model) +} + +class SiteUser <> { + + id : Long + - username : String + - email : String@Email + - admin : boolean + - role : String + - active : boolean +} +SiteUser .. site_user + +class UniqueLoginValidator <> { + - userRepository : SiteUserRepository + + isValid(String, ConstraintValidatorContext) : boolean +} + +class UniqueLogin <> { + message() : String + groups() : Class[] + payload() : Class[] +} + +interface SiteUserRepository <> { + findByUsername(String) + existsByUsername(String) +} +SecurityConfig ..> UserDetailsServiceImpl +UserDetailsServiceImpl ..> SiteUserRepository +SecurityController ..> SiteUserRepository +UniqueLoginValidator ..> SiteUserRepository +UniqueLogin .. UniqueLoginValidator +SiteUserRepository <|-- SiteUser + +class City <> { + site : static String + + citycode : String@NumberFormat + - cityname : String + - folder : String + - lng : String@NumberFormat + - lat : String@NumberFormat + + setSite(String) + + getSite() : String + + setLng(BigDecimal) + + setLat(BigDecimal) + + setPoint(lng,lat) + + getPoint() : Point + + toString() : String +} +City .. city +City . CityPK : citycode + +class CityPK { + citycode : String + + equals(Object) : boolean + + hashCode() : int +} + +interface CityRepository <> { + findByCitycode(String) : City + deleteByCitycode(String) : List +} +CityRepository <|-- City + +class CityController <> { + - repository : CityRepository + + showList(model) + + addCity(city) + + process(city, result) + + editCity(id, model) + + deleteCity(id) +} +CityController ..> CityRepository + +class CitymeshController <> { + - repository : CitymeshRepository + + showList(citycode, model) +} +CitymeshController ..> CitymeshRepository + +interface CitymeshRepository <> { + findByCitycode() : List +} +CitymeshRepository <|-- Citymesh + +class Citymesh <> { + - citycode : String@NumberFormat + - meshcode : String@NumberFormat + version : String + path : String + point : String + line : String + + setPoint(Point) + + setLine(JsonLine) +} +Citymesh .. citymesh +Citymesh . CitymeshPK +class CitymeshPK { + citycode : String + meshcode : String + + equals(Object) : boolean + + hashCode() : int +} + +class Task <> { + + currentId : String + preId : String + - citycode : String@NumberFormat + - meshcode : String@NumberFormat + mesh : Citymesh + status : Status + username : String + validator : String + operation : Operation + updateTime : Date +} +class TaskPK { + currentId : String + + equals(Object) : boolean + + hashCode() : int +} + +Task .. task +Task . TaskPK + +interface TaskRepository <> { +} + + +interface CommandLineRunner + +class DataLoader <> { + - repository : CityRepository + + run() +} +DataLoader ..> CityRepository +DataLoader ..> CitymeshRepository + +CommandLineRunner <|-- DataLoader + +@enduml diff --git a/uml/controller.png b/uml/controller.png new file mode 100644 index 0000000..32c187f --- /dev/null +++ b/uml/controller.png Binary files differ diff --git a/uml/controller.pu b/uml/controller.pu new file mode 100644 index 0000000..8049e4b --- /dev/null +++ b/uml/controller.pu @@ -0,0 +1,88 @@ +@startuml + +state "register.html" as register { + state "user" as register_user { + register_user : username + register_user : password + register_user : email + register_user : admin + } +} + +state "login" as login { + login : Username + login : Password +} + +state sidebar { + state "ログイン" as login_ + state "ログアウト" as logout_ + state "BLDGデータリスト" as indeies_ + state "マッパーリスト" as list_ + state "管理" as admin_ + state "使い方(外部リンク)" as howto_ + logout_ --> logout_ : /logout +} + +state "ユーザ一覧" as list { + state ユーザ { + ユーザ : id + ユーザ : username + ユーザ : email + ユーザ : role + } +} + +state cities { + state city_list { + city_list : *{citycode} + city_list : *{cityname} + city_list : *{path} + } +} + +state meshes { + state mesh_list +} + +state tasks { + state task_履歴 +} + +state task { + task : citycode + task : meshcode + task : operation + task : username + task : updateTime +} + +state "管理" as admin { + admin : download +} + +state "外部リンク" as howto { + howto : "https://github.com/yuuhayashi/task-bldg/wiki" +} + +[*] --> sidebar + +register <-- login : /register 新規登録 + +login <-- login_ : /login +login --> login : [!success] +login --> sidebar : [success] + +indeies_ --> cities : /city +howto_ --> howto : /howto + +list_ --> list : /admin/list +cities --> cities : /city/delete/{citycode} +cities --> meshes : /mesh/{citycode} +meshes --> tasks : /tasks +tasks -> task : /task +tasks <- task : /tasks +admin_ --> admin : /admin +admin --> admin : /admin/download + +@enduml \ No newline at end of file diff --git a/uml/geojson.png b/uml/geojson.png new file mode 100644 index 0000000..d5fb96c --- /dev/null +++ b/uml/geojson.png Binary files differ diff --git a/uml/geojson.pu b/uml/geojson.pu new file mode 100644 index 0000000..df3de6a --- /dev/null +++ b/uml/geojson.pu @@ -0,0 +1,81 @@ +@startuml + +class Geojson { + type : "FeatureCollection" + crs : JsonCrs + features : List + out() : boolean + toString() : String + parse(JsonNode) +} +Geojson *--|| JsonCrs : crs +Geojson *--|{ JsonFeature : features + +class JsonCrs { + type : "name" + properties : JsonProperties + toString() : String + parse(JsonNode) +} + +class JsonProperties { + name : String + path : String + id : String + version : String + toString() : String + parse(JsonNode) +} +JsonCrs *.. JsonProperties + +class JsonFeature { + geometryPoint : JsonGeometryPoint + geometryLine : JsonGeometryLine + type : String + properties : JsonProperties + toString() : String + parse(JsonNode) +} +JsonFeature o..o| JsonProperties +JsonFeature o..o| JsonGeometry + +interface JsonGeometry { +} +JsonGeometry <|-- JsonGeometryLine +JsonGeometry <|-- JsonGeometryPoint + +class JsonGeometryLine { + type : "LineString" + coordinates : List + toString() : String + parse(JsonNode) +} +JsonGeometryLine *..|{ Point + +class JsonGeometryPoint { + type : "Point" + coordinates : Point + toString() : String + parse(JsonNode) +} +JsonGeometryPoint *..|| Point + +class Point { + lng : String + lnt : String + setLng(BigDecimal) + setLng(String) + setLat(BigDecimal) + setLat(String) + store() + toString() : String + parse(JsonNode) +} +Point --|> JsonNumberArray + +class JsonNumberArray { + list : List + toString() : String +} + +@enduml \ No newline at end of file