Git Product home page Git Product logo

attendance-recorder's Introduction

attendance-recorder

出退勤を記録するアプリケーションです。

実行方法

実行にはJava(JDK8以上)が必要となります。

下記から最新の実行ファイル(attendance-recorder-x.x.x.jar)を入手します。

入手したjarファイルを指定してアプリケーションを実行します。

java -jar attendance-recorder-1.0.0.jar

実行ディレクトリに配下にh2dbというディレクトリが作成されます。このディレクトリにデータが格納されますので、削除しないようにご注意ください。

出退勤の登録

APIで出退勤の情報を登録します。

POST http://localhost:8080/api/attendances
{
    "userName" : "user1",
    "type" : "COME"
}
  • userName : ユーザ名です。
  • type : 出退勤の種別です。出勤時はCOME、退勤時はLEAVEを指定します。

出退勤の参照

画面として出退勤を参照できます。

Attendances screen

Rocket.Chatとの連携

Rocket.ChatのOutgoing WebHookを利用することで、Rocket.Chatと簡単に連携できます。

Outgoing WebHook の設定にて下記のように設定します。

  • イベントトリガー : メッセージが送信されました
  • URLs : http://attendance-recorder:8080/api/chat/handle ※attendance-recorderを実行しているサーバのIP、ドメイン等に置き換えてください。
  • 投稿ユーザ : attendance-bot ※他の名前を利用する場合は、アプリケーション側の設定を変更する必要があります。

botに対して出勤退勤とメッセージを送ることで、出退勤を記憶してくれます。

Rocket.Chat screen

設定ファイル

各種設定は、下記のファイルで定義されています。(Spring Bootの設定ファイル)

spring:
  datasource: 
    url: jdbc:h2:./h2db/db
application:
  chat:
    bot-name: attendance-bot
    come-phrase: 出勤
    leave-phrase: 退勤
    come-response-message: おはようございます。
    leave-response-message: 'お疲れ様でした。(勤務時間: %s - %s)'

Rocket.Chatとの連携時の動きを変えたい場合には、application.chat 配下の各種設定を変更することで対応できます。

  • application.chat.bot-name : Rocket.Chat上のbotの名前です。Rocket.Chat側のOutgoing WebHookで設定した投稿ユーザと同じ名前にしてください。
  • application.chat.come-phrase : 出勤として扱う単語です。この単語が含まれるメッセージを受け取った際に、出勤を記録します。
  • application.chat.leave-phrase : 退勤として扱う単語です。この単語が含まれるメッセージを受け取った際に、退勤を記録します。
  • application.come-response-message : 出勤時にbotが返すメッセージです。
  • application.chat.leave-response-message : 退勤時にbotが返すメッセージです。1番目の%sは出勤時間、2番目の%sは退勤時間に置換されます。

変更したapplication.ymlを実行ディレクトリに配置して実行すると、変更したapplication.ymlの内容で起動できます。

attendance-recorder's People

Contributors

onozaty avatar

Watchers

 avatar  avatar  avatar

Forkers

gucci67

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.