Comments (3)
sequenceDiagram
participant C as PostController
participant S as PostService
participant R as PostsRepository
participant DB
C->>+S: findAllDesc()
S->>+R: findAllDesc()
R->>+DB: SELECT p FROM Posts AS p ORDER BY p.id DESC
DB->>-R:List<Post>(id, title, content, author)
R->>-S: PostsResponse4ListDto(id, title, content, author)
S->>-C: List<PostsResponse4ListDto>
sequenceDiagram
participant C as PostController
participant S as PostService
participant R as PostsRepository
C->>+S: save(PostsSaveRequestDto)(title, content, author)
%%db에 저장 안되면 사용자에게 에러
rect rgb(176, 224, 230)
S->>+R: save(Post)(title, content, author)
S->>+R: saveOnEmail(PostOnEmailDto)(title, content, author, id)
S->>+R: saveOnFile(PostOnFileDto)(title, content, author, id)
S->>+R: saveOnExcel(PostOnExcelDto)(title, content, author, id)
end
S->>C: id
%% 안쓰임
sequenceDiagram
participant Client
participant C as PostController
participant S as PostService
participant R as PostsRepository
Client->>+C: resultForm(id)
C->>+S: findByIdOnDB(id)
S->>+R: findById(id)
alt id 있으면
R->>S: Post(id, title, content, author)
S->>C: PostResponseDto(id, title, content, author)
C->>Client: Page"post_result"
else id 없으면
R->>S: IllegalArgumentException(id)
%% 로깅 해야됨.
S->>C: IllegalArgumentException(id)
C->>Client: Page"500"
%%상황에 따라 보여질 500페이지 다듬어야 돼.
end
sequenceDiagram
participant Client
participant C as PostController
participant S as PostService
participant R as PostsRepository
Client->>C: PostUpdateRequestDto(id, title, content)
C->>S: update(PostUpdateRequestDto)(id, title, conetent)
S->>R: findById(id)
alt id 있으면
R->>S: (id, title, author, content)
else
R->>S: IllegalException(id)
S->>C: IllegalException(id)
end
rect rgb(176, 224, 230)
S->>S: update(title, content)
S->>R: updateOnFile(PostOnFile)(id, title, content, author)
S->>R: updateOnExcel(PostOnExcel)(id, title, content, author)
S->>R: updateOnEmail(PostOnEmail)(id, title, content, author)
end
S->>C: id
C->>Client: "/"
sequenceDiagram
participant Client
participant C as PostController
participant S as PostService
participant R as PostsRepository
Client->>C: id
C->>S: delete(id)
S->>R: findById(id)
alt id 있으면
R->>S: (id, title, author, content)
else
R->>S: IllegalException(id)
S->>C: IllegalException(id)
end
rect rgb(176, 224, 230)
S->>R: delete(Post)(id, title, content, author)
S->>R: deleteOnFile(id)
S->>R: deleteOnExcel(id)
S->>R: deleteOnEmail(id)
end
S->>C: boolean(exist or not based on "id")
alt true
C->>Client: IllegalArgumentException("no exists")
else false
C->>Client: "/"
end
sequenceDiagram
participant C as PostController
participant ApiC as PostApiController
participant S as PostService
participant R as PostsRepository
participant DB
from bulletin.
sequenceDiagram
actor Client
participant C as PostController
participant ApiC as PostApiController
participant S as PostService
participant R as PostsRepository
participant DB
participant Log
Client->>+ApiC: getAllTypePostData(id)
ApiC->>+S: findByIdOnDBNFileNExcel(id)
S->>+S: getDataFromStorage(id)
%%findByIdOnXX -> getDataFromStorage, getData XX -> mergeDataFromStorage [rename]
S->>+S: getDataFromDB(id)
S->>+R: findById(id)
alt id 없으면
R->>S: null
S->>Log: log.info(id)
else id 있으면
R->>S: JSONObject(id, title, content, author)
end
S->>+S: getDataFromFile(id)
S->>+R: findByIdOnFile(id)
alt id 없으면
R->>S: null
S->>Log: log.info()
%%log 어케 남기지?
else id 있으면
R->>S: JSONObject(id, title, content, author)
end
S->>+S: getDataFromExcel(id)
S->>+R: findByIdOnExcel(id)
alt id 없으면
R->>S: null
S->>Log: log.info()
else id 있으면
R->>S: JSONObject(id, title, content, author)
end
S->>-ApiC: jsonString("post-db:내용, post-excel:내용, post-file:내용")
ApiC->>-Client: jsonString("post-db:내용, post-excel:내용, post-file:내용")
sequenceDiagram
actor Client
participant C as PostController
participant ApiC as PostApiController
participant S as PostService
participant R as PostsRepository
participant DB
participant Log
Client->>+ApiC: getFormApiJson(id)
alt id is not int
ApiC->>-Client: 에러 처리 별도 안함.뭐뜨냐
%%log 해야 하는데
end
ApiC->>+S: findByIdOnDB(id)
S->>R: findById(id)
alt id 없으면
R->>ApiC: IllegalArgumentException(id)
ApiC->>Log: log.info()
ApiC->Client: IllegalArgumentException()
else id 있으면
R->>S: Post(id, title, content, author)
S->>ApiC:PostResponseDto(id, title, content, author)
ApiC->>Client: jsonString(id, title, content, author)
end
sequenceDiagram
actor Client
participant ApiC as PostApiController
participant S as PostService
participant R as PostsRepository
participant DB
participant Log
Client->>+ApiC: postSaveApi(jsonString)(title, content, author)
alt parse할 수 없는 형식이면
ApiC->>Client: ParseException
%% 필요한 정보 없어도 parse error날리게 처리하셈
end
ApiC->>+S: save(PostsSaveRequestDto)(title, content,author)
rect rgb(105,105,105)
S->>+R: save(post)(title, content, author)
R->>-S: post(id, title, content, author)
S->>+R: saveOnEmail(PostOnEmailDto)(id, title, content , author)
S->>+R: saveOnExcel(PostOnExcelDto)(id, title, content, author)
S->>+R: saveOnFile(PostOnFileDto)(id, title, content, author)
end
S->>-ApiC: id
ApiC->>-Client: id, 200
sequenceDiagram
actor Client
participant ApiC as PostApiController
participant S as PostService
participant A as 외부Api
participant R as PostsRepository
participant DB
participant Log
Client->>+ApiC: target
ApiC->>+S: getPostInOutsidePostApi(target)
S->>A: target, subcondition
alt api에서 데이터를 받아오는데 실패
S->>L: log.info()
S->>ApiC: InsufficientException(msg, 404)
ApiC->>Client: 404 json 해야 함
else
S->>ApiC:PostSaveRequestDto(title, content, author)
ApiC->>+S: save(PostsSaveRequestDto)(title, content,author)
rect rgb(105,105,105)
S->>+R: save(post)(title, content, author)
R->>-S: post(id, title, content, author)
S->>+R: saveOnEmail(PostOnEmailDto)(id, title, content , author)
S->>+R: saveOnExcel(PostOnExcelDto)(id, title, content, author)
S->>+R: saveOnFile(PostOnFileDto)(id, title, content, author)
end
S->>-ApiC: id
ApiC->>Client: jsonString(id)
end
from bulletin.
seq 작성 완료.
jpa, 에러 핸들링 추가 학습 을 에러 핸들링 하면서 병행하길 요망
from bulletin.
Related Issues (20)
- 공공데이터 포털 service key is not registered error HOT 3
- parser 분리
- json simple import gradle 못찾음
- open api 사용법 학습
- json simple 라이브러리로 json <-> obj, parser, jsonarray 학습
- resTemplate 학습, URLConnection 학습
- com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type `java.time.LocalDateTime` not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling
- 스프링 예외처리 학습
- 함수 예외처리 하기 HOT 1
- 함수별 인아웃풋, 기능 각주 달기
- 멘토링 받은 내용 정리 HOT 1
- 로그 분리하기
- 에러 핸들링 상황 엑셀에 명세
- imtranslator 설치
- jpa 동작 원리 학습
- 블로그 포스팅 작성 HOT 5
- 라이브러리 작성법 학습
- 인스타그램 기획서 작성(서비스 + 운영)
- 인스타그램 시퀀스 다이어그램 작성(서비스 + 운영)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bulletin.