GithubHelp home page GithubHelp logo

chat-assignment's Introduction

Chat API Assignment

DB 立ち上がり方

/docker ディレクトリーにあるdocker-composeでMySQLデータベースを作成する

コンテーナー作成コマンド

    docker-compose up --build -d

コンテーナー削除コマンド

    docker-compose down
  • DBのUserMstテーブルに5人ユーザーが作成されるので、そのユーザーを使用する。
  • DB作成sqlファイルは/docker/schemas/chat.sqlにあります

Unit Test

Junit 5で作成
ServiceとControllerの全てのClassのテスト済み

API 実行エビデンス

1対1チャット

チャット作成

ユーザー1とユーザー2でチャット作成
isGroup: グループチャットではないのでFalse
結果: チャットID:4 作成される Create1on1Chat.png

メッセージ投稿

ユーザー1が2件メッセージを投稿する (chatID:4にて) 結果: メッセージID 19と20作成される CreateMessage1.png

CreateMessage2.png

メッセージを取得

ユーザー1(投稿者)としてメッセージの一覧を取得したら、readCountとreadStatusが変わらない GetMessagesAsMessageCreator.png

ユーザー2がメッセージの一覧を取得したら、

  • readCount + 1
  • 2人チャットなので、既読に変わる

GetMessagesAsUser2.png

グループチャット

チャットお作成

ユーザー1、ユーザー2、ユーザ3でチャット作成
isGroup: グループチャットなのでTrue
結果: チャットID:5 作成される CreateGroupChat.png

メッセージ投稿

ユーザー1が2件メッセージを投稿する (chatID:4にて) 結果: メッセージID 21と22作成される CreateMessagesInGroupChat.png

メッセージ取得

ユーザー1(投稿者)としてメッセージの一覧を取得したら、readCountとreadStatusが変わらない GetMessagesAsMessageCreator.png

ユーザー2がメッセージの一覧を取得したら、

  • readCount = 1
  • 3人のグループチャットなので、未読のまま GetMessagesAsUser2.png

ユーザー3がメッセージの一覧を取得したら、

  • readCount = 2
  • 3人のグループチャットなので、既読に変わる GetMessagesAsUser3.png

メッセージ削除

1対1チャットで作成されたメッセージID:19を削除する 結果:successがTrueなので削除成功 DeleteMessage.png

削除確認
メッセージID:19削除された CheckDeletion.png

通知設定

notificationPushがtrueなのでPush通知のみ PushSettings1.png

notificationPushとnotificationEmailがTrueの場合
両方通知設定されます PushSettings2.png

chat-assignment's People

Watchers

 avatar

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.