genofire/hs_monolith
genofire
/
hs_monolith
Archived
1
0
Fork 0

[TASK] add freshness

This commit is contained in:
mlabusch 2017-05-12 11:15:54 +02:00
parent 9d33f6deda
commit c0ad2028fb
2 changed files with 10 additions and 3 deletions

View File

@ -99,8 +99,10 @@ func getGoodFreshness(w http.ResponseWriter, r *http.Request){
http.Error(w, "the good was not found in database", http.StatusNotFound) http.Error(w, "the good was not found in database", http.StatusNotFound)
return return
} }
fresh := false
fresh := good.FouledAt.Before(time.Now().Add(-time.Duration(3) * time.Hour * 24)) if good.FouledAt != nil {
fresh = time.Now().Add(-time.Duration(3) * time.Hour * 24).Before(*good.FouledAt)
}
log = log.WithField("type", r.Header.Get("Content-Type")) log = log.WithField("type", r.Header.Get("Content-Type"))
switch r.Header.Get("Content-Type") { switch r.Header.Get("Content-Type") {

View File

@ -27,8 +27,13 @@
<footer class="ui vertical footer segment"> <footer class="ui vertical footer segment">
<div class="ui center aligned container"> <div class="ui center aligned container">
<p>&copy; 2017 MM / Go - Team</p> <p>&copy; 2017 MM / Go - Team</p>
</div </div>
</footer> </footer>
<script src="//cdn.jsdelivr.net/webshim/1.14.5/polyfiller.js"></script>
<script>
webshims.setOptions('forms-ext', {types: 'date'});
webshims.polyfill('forms forms-ext');
</script>
<script src="/node_modules/angular/angular.min.js"></script> <script src="/node_modules/angular/angular.min.js"></script>
<script src="/node_modules/angular-animate/angular-animate.min.js"></script> <script src="/node_modules/angular-animate/angular-animate.min.js"></script>
<script src="/node_modules/angular-ui-router/release/angular-ui-router.min.js"></script> <script src="/node_modules/angular-ui-router/release/angular-ui-router.min.js"></script>