Skip to content

Commit

Permalink
Merge pull request #275 from chhsiao1981/release-0.19.2
Browse files Browse the repository at this point in the history
update version to 0.19.2
  • Loading branch information
chhsiao1981 authored Dec 3, 2021
2 parents f6d849f + b73f8f1 commit 2e352ac
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 3 deletions.
5 changes: 5 additions & 0 deletions api/get_user_visit_count_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package api

import (
"reflect"
"sync"
"testing"
"unsafe"

Expand Down Expand Up @@ -33,8 +34,11 @@ func TestGetUserVisitCount(t *testing.T) {
false,
},
}
var wg sync.WaitGroup
for _, tt := range tests {
wg.Add(1)
t.Run(tt.name, func(t *testing.T) {
defer wg.Done()
got, err := GetUserVisitCount(testIP, nil)
if (err != nil) != tt.wantErr {
t.Errorf("GetUserVisitCount() error = %v, wantErr %v", err, tt.wantErr)
Expand All @@ -44,5 +48,6 @@ func TestGetUserVisitCount(t *testing.T) {
t.Errorf("GetUserVisitCount() got = %v, want %v", got, tt.want)
}
})
wg.Wait()
}
}
8 changes: 8 additions & 0 deletions apidoc/apidoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,14 @@ def _get_fav(uid):
return ''


@app.route(_with_app_prefix('/uservisitcount'), methods=['GET'])
def _get_user_visit_count():
"""
swagger_from_file: apidoc/get_user_visit_count.yaml
"""
return ''


@app.route(_with_app_prefix('/existsuser'), methods=['POST'])
def _check_exists_user():
"""
Expand Down
19 changes: 19 additions & 0 deletions apidoc/get_user_visit_count.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
getUserVisitCount
---
tags:
- user
- count
description: get user visit count (the most recent 10 mins)
parameters:
- '$ref': '#/definitions/Host'
- '$ref': '#/definitions/XForwardedFor'
- '$ref': '#/definitions/Authorization'
responses:
200:
schema:
'$id': https://json-schema.org/draft/2019-09/output/schema
type: object
properties:
total:
type: number
description: total.
2 changes: 1 addition & 1 deletion apidoc/template.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
info:
version: '0.19.1'
version: '0.19.2'
title: go-pttbbs
definitions:
!include defs/board_summary.yaml
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2'
services:
go-pttbbs:
image: pttofficialapps/go-pttbbs:v0.19.1
image: pttofficialapps/go-pttbbs:v0.19.2
ports:
- "127.0.0.1:3456:3456"
- "127.0.0.1:8889:8888"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2'
services:
go-pttbbs:
image: pttofficialapps/go-pttbbs:v0.19.1
image: pttofficialapps/go-pttbbs:v0.19.2
ports:
- "127.0.0.1:3456:3456"
- "127.0.0.1:8889:8888"
Expand Down
8 changes: 8 additions & 0 deletions initgin/init_gin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,14 @@ func TestInitGin(t *testing.T) {
method: "GET",
},
},
{
name: "GetUserVisitCount",
args: args{
path: fmt.Sprintf("/uservisitcount"),
jwt: jwtTest,
method: "GET",
},
},
{
name: "EditArticle",
args: args{
Expand Down

0 comments on commit 2e352ac

Please sign in to comment.