Skip to content

Commit

Permalink
Develop dxyinme (#6)
Browse files Browse the repository at this point in the history
* update documentation

* update documentation

* update task_metrics table to save the running node

* update documentation

* update

* update

* update

* update
  • Loading branch information
dxyinme authored Dec 27, 2023
1 parent 9f3c2ba commit 02131eb
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 5 deletions.
15 changes: 15 additions & 0 deletions app/controllers/taskcontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,18 @@ func (tc *TaskController) Get(ctx *gin.Context) {
response.FromDBTask(&taskData)
ctx.JSON(http.StatusOK, &response)
}

// Task Metrics godoc
//
// @Summary Get task running metric
// @Description Get task running metric
// @Tags task
// @Accept json
// @Produce json
// @Param taskName path string true "task name"
// @Param body body types.TaskMetricsReq true "task metrics request"
// @Success 200 {object} types.TaskMetricsResp
// @Router /tasks/{taskName}/metrics [get]
func (tc *TaskController) GetMetric(ctx *gin.Context) {

}
2 changes: 1 addition & 1 deletion app/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module app

go 1.18
go 1.19

require (
github.com/gin-gonic/gin v1.9.0
Expand Down
2 changes: 1 addition & 1 deletion app/internal/common/innercall/innercall.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"context"
"encoding/json"

"github.com/go-redis/redis/v8"
redis "github.com/redis/go-redis/v9"
"github.com/sirupsen/logrus"
)

Expand Down
2 changes: 1 addition & 1 deletion app/internal/crontasks/crontaskscontainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"app/internal/db"
"time"

redis "github.com/go-redis/redis/v8"
"github.com/libi/dcron"
"github.com/libi/dcron/driver"
redis "github.com/redis/go-redis/v9"
"github.com/sirupsen/logrus"
)

Expand Down
11 changes: 11 additions & 0 deletions app/types/webmodels.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,14 @@ type DB struct {
CustomerName string `json:"customerName" binding:"required"`
DBBase
}

// TaskMetricsReq example
type TaskMetricsReq struct {
BeginTime int `json:"beginTime" binding:"optional"`
EndTime int `json:"endTime" binding:"optional"`
}

// TaskMetricsResp example
type TaskMetricsResp struct {
TaskBase
}
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
go 1.18
go 1.19

use (
./app
Expand Down
12 changes: 12 additions & 0 deletions go.work.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=

0 comments on commit 02131eb

Please sign in to comment.