- HTTP framework - gin
- ORM - mongo-go-driver
- line SDK - line-bot-sdk-go
- Config - viper
- CLI tools - cobra
- Install docker
- Needs to edit your userid in config/config.yaml
- Create a line bot account with line developers
- Enabled webhook and add the bot to your line account.
- needs to edit channel_access_token and channel_secret in config.yaml
make init
make dev
make build
- After start the service,you can use ngrok to create a temporary link to use webhook in line developers.
- When verified succeed,you can use postman to use APIs from below.
- /line
- Method:POST
- When user type message to line bot,this api will be triggerred and stored message and user info to Mongodb.
- /line/push
- Method:POST
- Line bot will push messages to specific user(use USERID)
- /users/:userid/messages
- Method:GET
- Param:userid
- query string :limit
- It will use userid to find all messages from Mongodb and return records with limited number.