Initial commit
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
package web_applicationstat
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"stat/common/stdLog"
|
||||
"stat/service/srv_applicationstat"
|
||||
)
|
||||
|
||||
// @Tags 应用中心
|
||||
// @Summary 查询应用统计
|
||||
// @Description 查询应用统计
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param param body srv_applicationstat.GetApplicationStatReq true "参数列表"
|
||||
// @Success 200 {object} srv_applicationstat.GetApplicationStatResp "成功"
|
||||
// @Failure 400 {string} string "获取失败的返回结果"
|
||||
// @Router /api/stat/web/apps/stat [POST]
|
||||
func GetApplicationStat(ctx *gin.Context) {
|
||||
param := &srv_applicationstat.GetApplicationStatReq{}
|
||||
err := ctx.ShouldBind(¶m)
|
||||
if err != nil {
|
||||
stdLog.ServerJSON(ctx, stdLog.ParamError, nil)
|
||||
return
|
||||
}
|
||||
result, sErr := srv_applicationstat.GetAppStatList(ctx, param)
|
||||
if sErr != nil {
|
||||
stdLog.ServerJSON(ctx, sErr.Code, sErr.Error())
|
||||
return
|
||||
}
|
||||
stdLog.ServerJSON(ctx, stdLog.Success, result)
|
||||
}
|
||||
|
||||
// @Tags 应用中心
|
||||
// @Summary 查询应用统计
|
||||
// @Description 查询应用统计
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param param body srv_applicationstat.GetApplicationStatTotalReq true "参数列表"
|
||||
// @Success 200 {object} srv_applicationstat.GetApplicationStatTotalResp "成功"
|
||||
// @Failure 400 {string} string "获取失败的返回结果"
|
||||
// @Router /api/stat/web/apps/stattotal [POST]
|
||||
func GetApplicationTotalStat(ctx *gin.Context) {
|
||||
param := &srv_applicationstat.GetApplicationStatTotalReq{}
|
||||
err := ctx.ShouldBind(¶m)
|
||||
if err != nil {
|
||||
stdLog.ServerJSON(ctx, stdLog.ParamError, nil)
|
||||
return
|
||||
}
|
||||
result, sErr := srv_applicationstat.GetAppTotalStatList(ctx, param)
|
||||
if sErr != nil {
|
||||
stdLog.ServerJSON(ctx, sErr.Code, sErr.Error())
|
||||
return
|
||||
}
|
||||
stdLog.ServerJSON(ctx, stdLog.Success, result)
|
||||
}
|
||||
Reference in New Issue
Block a user