Git Product home page Git Product logo

Comments (3)

mtak0235 avatar mtak0235 commented on August 15, 2024
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>
Loading
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
%% 안쓰임

Loading
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

Loading
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: "/"
Loading
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
Loading
sequenceDiagram
participant C as PostController
participant ApiC as PostApiController 
participant S as PostService
participant R as PostsRepository
participant DB
Loading

from bulletin.

mtak0235 avatar mtak0235 commented on August 15, 2024
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:내용")
Loading
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
Loading
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
Loading
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
Loading

from bulletin.

mtak0235 avatar mtak0235 commented on August 15, 2024

seq 작성 완료.
jpa, 에러 핸들링 추가 학습 을 에러 핸들링 하면서 병행하길 요망

from bulletin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.