Initial commit

This commit is contained in:
2026-05-20 16:13:58 +08:00
commit ceffbe382e
500 changed files with 157469 additions and 0 deletions
+142
View File
@@ -0,0 +1,142 @@
package appInfoApi
import (
"github.com/gin-gonic/gin"
"stat/api/proto"
"stat/common/stdLog"
"stat/common/utils"
"stat/service/appInfoSer"
"stat/service/opLogSer"
)
// @Tags 应用管理
// @Summary app列表
// @Description app列表
// @Accept json
// @Produce json
// @Security ApiKeyAuth
// @Param param body proto.ListAppInfoReq true "参数列表"
// @Success 200 {object} proto.ListAppInfoRes "成功"
// @Failure 400 {string} string "失败"
// @Security ApiKeyAuth
// @Router /api/stat/appInfo/list [POST]
func ListAppInfo(ctx *gin.Context) {
param := proto.ListAppInfoReq{}
if err := ctx.ShouldBind(&param); err != nil {
stdLog.ServerJSON(ctx, stdLog.ParamError, err.Error())
return
}
code, data, err := appInfoSer.GetAppInfoList(ctx, param)
if err != nil {
stdLog.ServerJSON(ctx, code, err)
return
}
stdLog.ServerJSON(ctx, code, data)
}
// @Tags 应用管理
// @Summary 添加app
// @Description 添加app
// @Accept json
// @Produce json
// @Security ApiKeyAuth
// @Param param body proto.AddAppInfoReq true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "失败"
// @Security ApiKeyAuth
// @Router /api/stat/appInfo/add [POST]
func AddAppInfo(ctx *gin.Context) {
account, err := utils.GetAdmin(ctx)
if err != nil {
stdLog.ServerJSON(ctx, stdLog.NoToken, err.Error())
return
}
param := proto.AddAppInfoReq{}
if err := ctx.ShouldBind(&param); err != nil {
stdLog.ServerJSON(ctx, stdLog.ParamError, err.Error())
return
}
code, data, err := appInfoSer.AddAppInfo(ctx, param)
if err != nil {
stdLog.ServerJSON(ctx, code, err)
return
}
// 增加操作日志
opLogSer.AddOpLog(ctx, account, true, param)
stdLog.ServerJSON(ctx, code, data)
}
// @Tags 应用管理
// @Summary 修改app
// @Description 修改app
// @Accept json
// @Produce json
// @Security ApiKeyAuth
// @Param param body proto.UpdateAppInfoReq true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "失败"
// @Security ApiKeyAuth
// @Router /api/stat/appInfo/update [POST]
func UpdateAppInfo(ctx *gin.Context) {
account, err := utils.GetAdmin(ctx)
if err != nil {
stdLog.ServerJSON(ctx, stdLog.NoToken, err.Error())
return
}
param := proto.UpdateAppInfoReq{}
if err := ctx.ShouldBind(&param); err != nil {
stdLog.ServerJSON(ctx, stdLog.ParamError, err.Error())
return
}
code, data, err := appInfoSer.UpdateAppInfo(ctx, param)
if err != nil {
stdLog.ServerJSON(ctx, code, err)
return
}
// 增加操作日志
opLogSer.AddOpLog(ctx, account, true, param)
stdLog.ServerJSON(ctx, code, data)
}
// @Tags 应用管理
// @Summary 删除app
// @Description 删除app
// @Accept json
// @Produce json
// @Security ApiKeyAuth
// @Param param body proto.DelAppInfoReq true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "失败"
// @Security ApiKeyAuth
// @Router /api/stat/appInfo/del [DELETE]
func DelAppInfo(ctx *gin.Context) {
account, err := utils.GetAdmin(ctx)
if err != nil {
stdLog.ServerJSON(ctx, stdLog.NoToken, err.Error())
return
}
param := proto.DelAppInfoReq{}
if err := ctx.ShouldBind(&param); err != nil {
stdLog.ServerJSON(ctx, stdLog.ParamError, err.Error())
return
}
code, data, err := appInfoSer.DelAppInfo(ctx, param)
if err != nil {
stdLog.ServerJSON(ctx, code, err)
return
}
// 增加操作日志
opLogSer.AddOpLog(ctx, account, true, param)
stdLog.ServerJSON(ctx, code, data)
}
+143
View File
@@ -0,0 +1,143 @@
package appInfoApi
import (
"stat/api/proto"
"stat/common/stdLog"
"stat/common/utils"
"stat/service/appInfoSer"
"stat/service/opLogSer"
"github.com/gin-gonic/gin"
)
// @Tags 落地页
// @Summary 落地页列表
// @Description 落地页列表
// @Accept json
// @Produce json
// @Security ApiKeyAuth
// @Param param body proto.FindLandingPageReq true "参数列表"
// @Success 200 {object} proto.LandingPageListRes "成功"
// @Failure 400 {string} string "失败"
// @Security ApiKeyAuth
// @Router /api/stat/landingPage/list [POST]
func ListLandingPageInfo(ctx *gin.Context) {
param := proto.FindLandingPageReq{}
if err := ctx.ShouldBind(&param); err != nil {
stdLog.ServerJSON(ctx, stdLog.ParamError, err.Error())
return
}
code, data, err := appInfoSer.GetLandingPageList(ctx, param)
if err != nil {
stdLog.ServerJSON(ctx, code, err)
return
}
stdLog.ServerJSON(ctx, code, data)
}
// @Tags 落地页
// @Summary 添加落地页
// @Description 添加落地页
// @Accept json
// @Produce json
// @Security ApiKeyAuth
// @Param param body proto.AddLandingPageReq true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "失败"
// @Security ApiKeyAuth
// @Router /api/stat/landingPage/add [POST]
func AddLandingPageInfo(ctx *gin.Context) {
account, err := utils.GetAdmin(ctx)
if err != nil {
stdLog.ServerJSON(ctx, stdLog.NoToken, err.Error())
return
}
param := proto.AddLandingPageReq{}
if err := ctx.ShouldBind(&param); err != nil {
stdLog.ServerJSON(ctx, stdLog.ParamError, err.Error())
return
}
code, data, err := appInfoSer.AddLandingPage(ctx, param)
if err != nil {
stdLog.ServerJSON(ctx, code, err)
return
}
// 增加操作日志
opLogSer.AddOpLog(ctx, account, true, param)
stdLog.ServerJSON(ctx, code, data)
}
// @Tags 落地页
// @Summary 修改落地页
// @Description 修改落地页
// @Accept json
// @Produce json
// @Security ApiKeyAuth
// @Param param body proto.UpdateLandingPageReq true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "失败"
// @Security ApiKeyAuth
// @Router /api/stat/landingPage/update [POST]
func UpdateLandingPageInfo(ctx *gin.Context) {
account, err := utils.GetAdmin(ctx)
if err != nil {
stdLog.ServerJSON(ctx, stdLog.NoToken, err.Error())
return
}
param := proto.UpdateLandingPageReq{}
if err := ctx.ShouldBind(&param); err != nil {
stdLog.ServerJSON(ctx, stdLog.ParamError, err.Error())
return
}
code, data, err := appInfoSer.UpdateLandingPage(ctx, param)
if err != nil {
stdLog.ServerJSON(ctx, code, err)
return
}
// 增加操作日志
opLogSer.AddOpLog(ctx, account, true, param)
stdLog.ServerJSON(ctx, code, data)
}
// @Tags 落地页
// @Summary 删除落地页
// @Description 删除落地页
// @Accept json
// @Produce json
// @Security ApiKeyAuth
// @Param param body proto.DelLandingPageReq true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "失败"
// @Security ApiKeyAuth
// @Router /api/stat/landingPage/del [DELETE]
func DelLandingPageInfo(ctx *gin.Context) {
account, err := utils.GetAdmin(ctx)
if err != nil {
stdLog.ServerJSON(ctx, stdLog.NoToken, err.Error())
return
}
param := proto.DelLandingPageReq{}
if err := ctx.ShouldBind(&param); err != nil {
stdLog.ServerJSON(ctx, stdLog.ParamError, err.Error())
return
}
code, data, err := appInfoSer.DelLandingPage(ctx, param)
if err != nil {
stdLog.ServerJSON(ctx, code, err)
return
}
// 增加操作日志
opLogSer.AddOpLog(ctx, account, true, param)
stdLog.ServerJSON(ctx, code, data)
}
+155
View File
@@ -0,0 +1,155 @@
package appInfoApi
import (
"github.com/gin-gonic/gin"
"stat/api/proto"
"stat/common/stdLog"
"stat/common/utils"
"stat/models/landPageConfig"
"stat/service/appInfoSer"
"stat/service/opLogSer"
)
// @Tags 落地页配置
// @Summary 落地页配置列表
// @Description 落地页配置列表
// @Accept json
// @Produce json
// @Param param body proto.FindLandPageConfigReq true "参数列表"
// @Success 200 {object} proto.LandPageConfigListResp "成功"
// @Failure 400 {string} string "失败"
// @Security ApiKeyAuth
// @Router /api/stat/landPageConfig/list [POST]
func ListLandPageConfig(ctx *gin.Context) {
param := &proto.FindLandPageConfigReq{}
if err := ctx.ShouldBind(&param); err != nil {
stdLog.ServerJSON(ctx, stdLog.ParamError, err.Error())
return
}
code, data, err := appInfoSer.GetLandPageConfigList(ctx, param)
if err != nil {
stdLog.ServerJSON(ctx, code, err)
return
}
stdLog.ServerJSON(ctx, code, data)
}
// @Tags 落地页配置
// @Summary 添加落地页配置
// @Description 添加落地页配置
// @Accept json
// @Produce json
// @Param param body proto.AddLandPageConfigReq true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "失败"
// @Security ApiKeyAuth
// @Router /api/stat/landPageConfig/add [POST]
func AddLandPageConfig(ctx *gin.Context) {
account, err := utils.GetAdmin(ctx)
if err != nil {
stdLog.ServerJSON(ctx, stdLog.NoToken, err.Error())
return
}
param := &proto.AddLandPageConfigReq{}
if err := ctx.ShouldBind(&param); err != nil {
stdLog.ServerJSON(ctx, stdLog.ParamError, err.Error())
return
}
code, data, err := appInfoSer.AddLandPageConfig(ctx, param)
if err != nil {
stdLog.ServerJSON(ctx, code, err)
return
}
// 增加操作日志
opLogSer.AddOpLog(ctx, account, true, param)
stdLog.ServerJSON(ctx, code, data)
}
// @Tags 落地页配置
// @Summary 修改落地页配置
// @Description 修改落地页配置
// @Accept json
// @Produce json
// @Param param body landPageConfig.LandPageConfig true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "失败"
// @Security ApiKeyAuth
// @Router /api/stat/landPageConfig/update [POST]
func UpdateLandPageConfig(ctx *gin.Context) {
account, err := utils.GetAdmin(ctx)
if err != nil {
stdLog.ServerJSON(ctx, stdLog.NoToken, err.Error())
return
}
param := &landPageConfig.LandPageConfig{}
if err := ctx.ShouldBind(&param); err != nil {
stdLog.ServerJSON(ctx, stdLog.ParamError, err.Error())
return
}
code, data, err := appInfoSer.UpdateLandPageConfig(ctx, param)
if err != nil {
stdLog.ServerJSON(ctx, code, err)
return
}
// 增加操作日志
opLogSer.AddOpLog(ctx, account, true, param)
stdLog.ServerJSON(ctx, code, data)
}
// @Tags 落地页配置
// @Summary 删除落地页配置
// @Description 删除落地页配置
// @Accept json
// @Produce json
// @Param param body proto.DelLandPageConfigReq true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "失败"
// @Security ApiKeyAuth
// @Router /api/stat/landPageConfig/del [POST]
func DelLandPageConfig(ctx *gin.Context) {
account, err := utils.GetAdmin(ctx)
if err != nil {
stdLog.ServerJSON(ctx, stdLog.NoToken, err.Error())
return
}
param := &proto.DelLandPageConfigReq{}
if err := ctx.ShouldBind(&param); err != nil {
stdLog.ServerJSON(ctx, stdLog.ParamError, err.Error())
return
}
code, data, err := appInfoSer.DelLandPageConfig(ctx, param)
if err != nil {
stdLog.ServerJSON(ctx, code, err)
return
}
// 增加操作日志
opLogSer.AddOpLog(ctx, account, true, param)
stdLog.ServerJSON(ctx, code, data)
}
// @Tags 落地页配置
// @Summary 根据类型获取落地页配置
// @Description 根据类型获取落地页配置
// @Accept json
// @Produce json
// @Param param body proto.GetLandPageConfigByTypeReq true "参数列表"
// @Success 200 {object} proto.LandingPageConfigList "成功"
// @Failure 400 {string} string "失败"
// @Router /api/stat/landPageConfig/getByType [POST]
func GetLandPageConfigByType(ctx *gin.Context) {
param := &proto.GetLandPageConfigByTypeReq{}
if err := ctx.ShouldBind(&param); err != nil {
stdLog.ServerJSON(ctx, stdLog.ParamError, err.Error())
return
}
code, data, err := appInfoSer.GetLandPageConfigByType(ctx, param)
if err != nil {
stdLog.ServerJSON(ctx, code, err)
return
}
stdLog.ServerJSON(ctx, code, data)
}