add:api /activity/develop
This commit is contained in:
parent
a02afaf830
commit
448848d02c
|
@ -604,6 +604,7 @@ func Routes() *web.Route {
|
|||
m.Group("/activity", func() {
|
||||
m.Get("", report.GetActivity)
|
||||
m.Get("/project", report.GetActivityProject)
|
||||
m.Get("/develop", report.GetActivityDevelop)
|
||||
})
|
||||
// Notifications
|
||||
m.Group("/notifications", func() {
|
||||
|
|
|
@ -94,6 +94,55 @@ func GetActivityProject(ctx *context.APIContext) {
|
|||
ctx.JSON(http.StatusOK, data)
|
||||
}
|
||||
|
||||
type DevelopDTO struct {
|
||||
Develop interface{} `json:"develop"`
|
||||
}
|
||||
|
||||
func GetActivityDevelop(ctx *context.APIContext) {
|
||||
// swagger:operation GET /activity/develop activity develop
|
||||
// ---
|
||||
// summary: Statistics of submitted data by developers **
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
// - name: from
|
||||
// in: query
|
||||
// description: Query begin timestamp
|
||||
// type: string
|
||||
// required: false
|
||||
// - name: to
|
||||
// in: query
|
||||
// description: Query end timestamp
|
||||
// type: string
|
||||
// required: false
|
||||
// - name: top
|
||||
// in: query
|
||||
// description: Display the previous n records
|
||||
// type: integer
|
||||
// required: false
|
||||
// responses:
|
||||
// "200":
|
||||
// "$ref": "#/responses/PlatformDTO"
|
||||
// "404":
|
||||
// "$ref": "#/responses/notFound"
|
||||
|
||||
opt := GetParamOption(ctx)
|
||||
if opt == nil {
|
||||
return
|
||||
}
|
||||
|
||||
list, err := models.GetActivityDevelop(opt)
|
||||
if err != nil {
|
||||
ctx.ServerError("GetActivityDevelop", err)
|
||||
return
|
||||
}
|
||||
data := DevelopDTO{
|
||||
Develop: list,
|
||||
}
|
||||
ctx.JSON(http.StatusOK, data)
|
||||
|
||||
}
|
||||
|
||||
func GetParamOption(ctx *context.APIContext) (opt *models.GetGetActivityOptions) {
|
||||
Layout := "2006-01-02 15:04:05"
|
||||
//##top
|
||||
|
|
|
@ -57,6 +57,46 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/activity/develop": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"activity"
|
||||
],
|
||||
"summary": "Statistics of submitted data by developers **",
|
||||
"operationId": "develop",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Query begin timestamp",
|
||||
"name": "from",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Query end timestamp",
|
||||
"name": "to",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Display the previous n records",
|
||||
"name": "top",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/responses/PlatformDTO"
|
||||
},
|
||||
"404": {
|
||||
"$ref": "#/responses/notFound"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/activity/project": {
|
||||
"get": {
|
||||
"produces": [
|
||||
|
|
Loading…
Reference in New Issue