This repository has been archived on 2020-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
2017-03-25 16:09:17 +01:00
|
|
|
package http
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2017-03-30 18:43:18 +02:00
|
|
|
"github.com/genofire/hs_master-kss-monolith/lib/database"
|
2017-03-30 15:36:04 +02:00
|
|
|
lib "github.com/genofire/hs_master-kss-monolith/lib/http"
|
|
|
|
logger "github.com/genofire/hs_master-kss-monolith/lib/log"
|
2017-03-30 18:43:18 +02:00
|
|
|
"github.com/genofire/hs_master-kss-monolith/models"
|
2017-03-25 16:09:17 +01:00
|
|
|
)
|
|
|
|
|
2017-03-30 18:43:18 +02:00
|
|
|
func status(w http.ResponseWriter, r *http.Request) {
|
2017-03-30 15:36:04 +02:00
|
|
|
log := logger.HTTP(r)
|
2017-03-30 18:43:18 +02:00
|
|
|
var reviews []*models.Review
|
|
|
|
var count int64
|
|
|
|
database.Read.Find(&reviews).Count(&count)
|
|
|
|
lib.Write(w, map[string]interface{}{"status": "running", "review_count": count})
|
|
|
|
log.Info("done")
|
2017-03-25 16:09:17 +01:00
|
|
|
}
|