修复生成的文档注释返回结构不正确

This commit is contained in:
xiangheng
2024-07-01 22:23:14 +08:00
parent e37f313b09
commit a3ee34aa66
14 changed files with 4013 additions and 3521 deletions

View File

@@ -14,7 +14,8 @@ export default defineConfig({
nav: [ nav: [
{ text: 'Home', link: '/' }, { text: 'Home', link: '/' },
{ text: '后端', link: '/server/准备.md' }, { text: '后端', link: '/server/准备.md' },
{ text: '前端', link: '/admin/准备.md' } { text: '前端', link: '/admin/准备.md' },
{ text: '在线体验', link: 'https://x.adtk.cn/' },
], ],
sidebar: [ sidebar: [

View File

@@ -40,15 +40,14 @@ pm2 start 打包后的二进制文件名 --name x_admin
pm2 startup pm2 startup
# 保存 # 保存
pm2 save pm2 save
# 所有任务列表 # 所有任务列表
pm2 list pm2 list
# 停止 # 停止
```bash
pm2 stop x_admin pm2 stop x_admin
# 重启 # 重启
```bash
pm2 restart x_admin pm2 restart x_admin
# 查看日志 # 查看日志
pm2 log x_admin pm2 log x_admin

View File

@@ -11,24 +11,23 @@ import (
type FlowApplyHandler struct{} type FlowApplyHandler struct{}
// @Summary 申请流程列表 // @Summary 申请流程列表
// @Tags flow_apply-申请流程 // @Tags flow_apply-申请流程
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param PageNo query int true "页码" // @Param PageNo query int true "页码"
// @Param PageSize query int true "每页数量" // @Param PageSize query int true "每页数量"
// @Param templateId query int false "模板" // @Param templateId query int false "模板"
// @Param applyUserId query int false "申请人id" // @Param applyUserId query int false "申请人id"
// @Param applyUserNickname query string false "申请人昵称" // @Param applyUserNickname query string false "申请人昵称"
// @Param flowName query string false "流程名称" // @Param flowName query string false "流程名称"
// @Param flowGroup query int false "流程分类" // @Param flowGroup query int false "流程分类"
// @Param flowRemark query string false "流程描述" // @Param flowRemark query string false "流程描述"
// @Param flowFormData query string false "表单配置" // @Param flowFormData query string false "表单配置"
// @Param flowProcessData query string false "流程配置" // @Param flowProcessData query string false "流程配置"
// @Param status query int false "状态1待提交2审批中3审批完成4审批失败" // @Param status query int false "状态1待提交2审批中3审批完成4审批失败"
// @Success 200 {object} []FlowApplyResp "成功" // @Success 200 {object} response.Response{data=response.PageResp{lists=[]FlowApplyResp}} "成功"
// @Failure 400 {object} string "请求错误" // @Router /api/admin/flow/flow_apply/list [get]
// @Router /api/flow_apply/list [get]
func (hd FlowApplyHandler) List(c *gin.Context) { func (hd FlowApplyHandler) List(c *gin.Context) {
var page request.PageReq var page request.PageReq
var listReq FlowApplyListReq var listReq FlowApplyListReq
@@ -42,13 +41,13 @@ func (hd FlowApplyHandler) List(c *gin.Context) {
response.CheckAndRespWithData(c, res, err) response.CheckAndRespWithData(c, res, err)
} }
// @Summary 申请流程详情 // @Summary 申请流程详情
// @Tags flow_apply-申请流程 // @Tags flow_apply-申请流程
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param id query int false "申请id" // @Param id query int false "申请id"
// @Success 200 {object} FlowApplyResp "成功" // @Success 200 {object} response.Response{data=FlowApplyResp} "成功"
// @Router /api/flow_apply/detail [get] // @Router /api/admin/flow/flow_apply/detail [get]
func (hd FlowApplyHandler) Detail(c *gin.Context) { func (hd FlowApplyHandler) Detail(c *gin.Context) {
var detailReq FlowApplyDetailReq var detailReq FlowApplyDetailReq
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &detailReq)) { if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &detailReq)) {
@@ -58,21 +57,21 @@ func (hd FlowApplyHandler) Detail(c *gin.Context) {
response.CheckAndRespWithData(c, res, err) response.CheckAndRespWithData(c, res, err)
} }
// @Summary 申请流程新增 // @Summary 申请流程新增
// @Tags flow_apply-申请流程 // @Tags flow_apply-申请流程
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param templateId body int false "模板" // @Param templateId body int false "模板"
// @Param applyUserId body int false "申请人id" // @Param applyUserId body int false "申请人id"
// @Param applyUserNickname body string false "申请人昵称" // @Param applyUserNickname body string false "申请人昵称"
// @Param flowName body string false "流程名称" // @Param flowName body string false "流程名称"
// @Param flowGroup body int false "流程分类" // @Param flowGroup body int false "流程分类"
// @Param flowRemark body string false "流程描述" // @Param flowRemark body string false "流程描述"
// @Param flowFormData body string false "表单配置" // @Param flowFormData body string false "表单配置"
// @Param flowProcessData body string false "流程配置" // @Param flowProcessData body string false "流程配置"
// @Param status body int false "状态1待提交2审批中3审批完成4审批失败" // @Param status body int false "状态1待提交2审批中3审批完成4审批失败"
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/flow_apply/add [post] // @Router /api/admin/flow/flow_apply/add [post]
func (hd FlowApplyHandler) Add(c *gin.Context) { func (hd FlowApplyHandler) Add(c *gin.Context) {
var addReq FlowApplyAddReq var addReq FlowApplyAddReq
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &addReq)) { if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &addReq)) {
@@ -88,22 +87,22 @@ func (hd FlowApplyHandler) Add(c *gin.Context) {
response.CheckAndResp(c, Service.Add(addReq)) response.CheckAndResp(c, Service.Add(addReq))
} }
// @Summary 申请流程编辑 // @Summary 申请流程编辑
// @Tags flow_apply-申请流程 // @Tags flow_apply-申请流程
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param id body int false "申请id" // @Param id body int false "申请id"
// @Param templateId body int false "模板" // @Param templateId body int false "模板"
// @Param applyUserId body int false "申请人id" // @Param applyUserId body int false "申请人id"
// @Param applyUserNickname body string false "申请人昵称" // @Param applyUserNickname body string false "申请人昵称"
// @Param flowName body string false "流程名称" // @Param flowName body string false "流程名称"
// @Param flowGroup body int false "流程分类" // @Param flowGroup body int false "流程分类"
// @Param flowRemark body string false "流程描述" // @Param flowRemark body string false "流程描述"
// @Param flowFormData body string false "表单配置" // @Param flowFormData body string false "表单配置"
// @Param flowProcessData body string false "流程配置" // @Param flowProcessData body string false "流程配置"
// @Param status body int false "状态1待提交2审批中3审批完成4审批失败" // @Param status body int false "状态1待提交2审批中3审批完成4审批失败"
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/flow_apply/edit [post] // @Router /api/admin/flow/flow_apply/edit [post]
func (hd FlowApplyHandler) Edit(c *gin.Context) { func (hd FlowApplyHandler) Edit(c *gin.Context) {
var editReq FlowApplyEditReq var editReq FlowApplyEditReq
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &editReq)) { if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &editReq)) {
@@ -112,13 +111,13 @@ func (hd FlowApplyHandler) Edit(c *gin.Context) {
response.CheckAndResp(c, Service.Edit(editReq)) response.CheckAndResp(c, Service.Edit(editReq))
} }
// @Summary 申请流程删除 // @Summary 申请流程删除
// @Tags flow_apply-申请流程 // @Tags flow_apply-申请流程
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param id body int false "申请id" // @Param id body int false "申请id"
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/flow_apply/del [post] // @Router /api/admin/flow/flow_apply/del [post]
func (hd FlowApplyHandler) Del(c *gin.Context) { func (hd FlowApplyHandler) Del(c *gin.Context) {
var delReq FlowApplyDelReq var delReq FlowApplyDelReq
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &delReq)) { if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &delReq)) {

View File

@@ -12,25 +12,24 @@ import (
type FlowHistoryHandler struct { type FlowHistoryHandler struct {
} }
// @Summary 流程历史列表 // @Summary 流程历史列表
// @Tags flow_history-流程历史 // @Tags flow_history-流程历史
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param PageNo query int true "页码" // @Param PageNo query int true "页码"
// @Param PageSize query int true "每页数量" // @Param PageSize query int true "每页数量"
// @Param applyId query int false "申请id" // @Param applyId query int false "申请id"
// @Param templateId query int false "模板id" // @Param templateId query int false "模板id"
// @Param applyUserId query int false "申请人id" // @Param applyUserId query int false "申请人id"
// @Param applyUserNickname query string false "申请人昵称" // @Param applyUserNickname query string false "申请人昵称"
// @Param approverId query int false "审批人id" // @Param approverId query int false "审批人id"
// @Param approverNickname query string false "审批用户昵称" // @Param approverNickname query string false "审批用户昵称"
// @Param nodeId query string false "节点" // @Param nodeId query string false "节点"
// @Param formValue query string false "表单值" // @Param formValue query string false "表单值"
// @Param passStatus query int false "通过状态0待处理1通过2拒绝" // @Param passStatus query int false "通过状态0待处理1通过2拒绝"
// @Param passRemark query string false "通过备注" // @Param passRemark query string false "通过备注"
// @Success 200 {object} []FlowHistoryResp "成功" // @Success 200 {object} response.Response{data=response.PageResp{lists=[]FlowHistoryResp}} "成功"
// @Failure 400 {object} string "请求错误" // @Router /api/admin/flow/flow_history/list [get]
// @Router /api/flow_history/list [get]
func (hd FlowHistoryHandler) List(c *gin.Context) { func (hd FlowHistoryHandler) List(c *gin.Context) {
var page request.PageReq var page request.PageReq
var listReq = FlowHistoryListReq{ var listReq = FlowHistoryListReq{
@@ -46,11 +45,11 @@ func (hd FlowHistoryHandler) List(c *gin.Context) {
response.CheckAndRespWithData(c, res, err) response.CheckAndRespWithData(c, res, err)
} }
// @Summary 流程历史列表-所有 // @Summary 流程历史列表-所有
// @Tags flow_history-流程历史 // @Tags flow_history-流程历史
// @Produce json // @Produce json
// @Success 200 {object} []FlowHistoryResp "成功" // @Success 200 {object} response.Response{data=FlowHistoryResp} "成功"
// @Router /api/flow_history/listAll [get] // @Router /api/admin/flow/flow_history/listAll [get]
func (hd FlowHistoryHandler) ListAll(c *gin.Context) { func (hd FlowHistoryHandler) ListAll(c *gin.Context) {
var listReq FlowHistoryListReq var listReq FlowHistoryListReq
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &listReq)) { if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &listReq)) {
@@ -60,13 +59,13 @@ func (hd FlowHistoryHandler) ListAll(c *gin.Context) {
response.CheckAndRespWithData(c, res, err) response.CheckAndRespWithData(c, res, err)
} }
// @Summary 流程历史详情 // @Summary 流程历史详情
// @Tags flow_history-流程历史 // @Tags flow_history-流程历史
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param id query int false "历史id" // @Param id query int false "历史id"
// @Success 200 {object} FlowHistoryResp "成功" // @Success 200 {object} response.Response{data=FlowHistoryResp} "成功"
// @Router /api/flow_history/detail [get] // @Router /api/admin/flow/flow_history/detail [get]
func (hd FlowHistoryHandler) Detail(c *gin.Context) { func (hd FlowHistoryHandler) Detail(c *gin.Context) {
var detailReq FlowHistoryDetailReq var detailReq FlowHistoryDetailReq
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &detailReq)) { if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &detailReq)) {
@@ -76,22 +75,22 @@ func (hd FlowHistoryHandler) Detail(c *gin.Context) {
response.CheckAndRespWithData(c, res, err) response.CheckAndRespWithData(c, res, err)
} }
// @Summary 流程历史新增 // @Summary 流程历史新增
// @Tags flow_history-流程历史 // @Tags flow_history-流程历史
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param applyId body int false "申请id" // @Param applyId body int false "申请id"
// @Param templateId body int false "模板id" // @Param templateId body int false "模板id"
// @Param applyUserId body int false "申请人id" // @Param applyUserId body int false "申请人id"
// @Param applyUserNickname body string false "申请人昵称" // @Param applyUserNickname body string false "申请人昵称"
// @Param approverId body int false "审批人id" // @Param approverId body int false "审批人id"
// @Param approverNickname body string false "审批用户昵称" // @Param approverNickname body string false "审批用户昵称"
// @Param nodeId body string false "节点" // @Param nodeId body string false "节点"
// @Param formValue body string false "表单值" // @Param formValue body string false "表单值"
// @Param passStatus body int false "通过状态0待处理1通过2拒绝" // @Param passStatus body int false "通过状态0待处理1通过2拒绝"
// @Param passRemark body string false "通过备注" // @Param passRemark body string false "通过备注"
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/flow_history/add [post] // @Router /api/admin/flow/flow_history/add [post]
func (hd FlowHistoryHandler) Add(c *gin.Context) { func (hd FlowHistoryHandler) Add(c *gin.Context) {
var addReq FlowHistoryAddReq var addReq FlowHistoryAddReq
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &addReq)) { if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &addReq)) {
@@ -100,23 +99,23 @@ func (hd FlowHistoryHandler) Add(c *gin.Context) {
response.CheckAndResp(c, Service.Add(addReq)) response.CheckAndResp(c, Service.Add(addReq))
} }
// @Summary 流程历史编辑 // @Summary 流程历史编辑
// @Tags flow_history-流程历史 // @Tags flow_history-流程历史
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param id body int false "历史id" // @Param id body int false "历史id"
// @Param applyId body int false "申请id" // @Param applyId body int false "申请id"
// @Param templateId body int false "模板id" // @Param templateId body int false "模板id"
// @Param applyUserId body int false "申请人id" // @Param applyUserId body int false "申请人id"
// @Param applyUserNickname body string false "申请人昵称" // @Param applyUserNickname body string false "申请人昵称"
// @Param approverId body int false "审批人id" // @Param approverId body int false "审批人id"
// @Param approverNickname body string false "审批用户昵称" // @Param approverNickname body string false "审批用户昵称"
// @Param nodeId body string false "节点" // @Param nodeId body string false "节点"
// @Param formValue body string false "表单值" // @Param formValue body string false "表单值"
// @Param passStatus body int false "通过状态0待处理1通过2拒绝" // @Param passStatus body int false "通过状态0待处理1通过2拒绝"
// @Param passRemark body string false "通过备注" // @Param passRemark body string false "通过备注"
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/flow_history/edit [post] // @Router /api/admin/flow/flow_history/edit [post]
func (hd FlowHistoryHandler) Edit(c *gin.Context) { func (hd FlowHistoryHandler) Edit(c *gin.Context) {
var editReq FlowHistoryEditReq var editReq FlowHistoryEditReq
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &editReq)) { if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &editReq)) {
@@ -125,13 +124,13 @@ func (hd FlowHistoryHandler) Edit(c *gin.Context) {
response.CheckAndResp(c, Service.Edit(editReq)) response.CheckAndResp(c, Service.Edit(editReq))
} }
// @Summary 流程历史删除 // @Summary 流程历史删除
// @Tags flow_history-流程历史 // @Tags flow_history-流程历史
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param id body int false "历史id" // @Param id body int false "历史id"
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/flow_history/del [post] // @Router /api/admin/flow/flow_history/del [post]
func (hd FlowHistoryHandler) Del(c *gin.Context) { func (hd FlowHistoryHandler) Del(c *gin.Context) {
var delReq FlowHistoryDelReq var delReq FlowHistoryDelReq
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &delReq)) { if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &delReq)) {
@@ -142,7 +141,7 @@ func (hd FlowHistoryHandler) Del(c *gin.Context) {
// 提交申请,通过审批 // 提交申请,通过审批
// //
// @Router /api/flow_apply/pass [post] // @Router /api/admin/flow_apply/pass [post]
func (hd FlowHistoryHandler) Pass(c *gin.Context) { func (hd FlowHistoryHandler) Pass(c *gin.Context) {
var pass PassReq var pass PassReq
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &pass)) { if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &pass)) {
@@ -154,7 +153,7 @@ func (hd FlowHistoryHandler) Pass(c *gin.Context) {
} }
// 拒绝审批 // 拒绝审批
// @Router /api/flow_apply/back [post] // @Router /api/admin/flow_apply/back [post]
func (hd FlowHistoryHandler) Back(c *gin.Context) { func (hd FlowHistoryHandler) Back(c *gin.Context) {
var back BackReq var back BackReq
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &back)) { if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &back)) {

View File

@@ -10,20 +10,19 @@ import (
type FlowTemplateHandler struct{} type FlowTemplateHandler struct{}
// @Summary 流程模板列表 // @Summary 流程模板列表
// @Tags flow_template-流程模板 // @Tags flow_template-流程模板
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param PageNo query int true "页码" // @Param PageNo query int true "页码"
// @Param PageSize query int true "每页数量" // @Param PageSize query int true "每页数量"
// @Param flowName query string false "流程名称" // @Param flowName query string false "流程名称"
// @Param flowGroup query int false "流程分类" // @Param flowGroup query int false "流程分类"
// @Param flowRemark query string false "流程描述" // @Param flowRemark query string false "流程描述"
// @Param flowFormData query string false "表单配置" // @Param flowFormData query string false "表单配置"
// @Param flowProcessData query string false "流程配置" // @Param flowProcessData query string false "流程配置"
// @Success 200 {object} []FlowTemplateResp "成功" // @Success 200 {object} response.Response{data=response.PageResp{lists=[]FlowTemplateResp}} "成功"
// @Failure 400 {object} string "请求错误" // @Router /api/admin/flow/flow_template/list [get]
// @Router /api/flow_template/list [get]
func (hd FlowTemplateHandler) List(c *gin.Context) { func (hd FlowTemplateHandler) List(c *gin.Context) {
var page request.PageReq var page request.PageReq
var listReq FlowTemplateListReq var listReq FlowTemplateListReq
@@ -37,21 +36,21 @@ func (hd FlowTemplateHandler) List(c *gin.Context) {
response.CheckAndRespWithData(c, res, err) response.CheckAndRespWithData(c, res, err)
} }
// @Summary 流程模板列表-所有 // @Summary 流程模板列表-所有
// @Tags flow_template-流程模板 // @Tags flow_template-流程模板
// @Router /api/flow_template/listAll [get] // @Router /api/admin/flow/flow_template/listAll [get]
func (hd FlowTemplateHandler) ListAll(c *gin.Context) { func (hd FlowTemplateHandler) ListAll(c *gin.Context) {
res, err := Service.ListAll() res, err := Service.ListAll()
response.CheckAndRespWithData(c, res, err) response.CheckAndRespWithData(c, res, err)
} }
// @Summary 流程模板详情 // @Summary 流程模板详情
// @Tags flow_template-流程模板 // @Tags flow_template-流程模板
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param id query int false "历史id" // @Param id query int false "历史id"
// @Success 200 {object} FlowTemplateResp "成功" // @Success 200 {object} FlowTemplateResp "成功"
// @Router /api/flow_template/detail [get] // @Router /api/admin/flow/flow_template/detail [get]
func (hd FlowTemplateHandler) Detail(c *gin.Context) { func (hd FlowTemplateHandler) Detail(c *gin.Context) {
var detailReq FlowTemplateDetailReq var detailReq FlowTemplateDetailReq
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &detailReq)) { if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &detailReq)) {
@@ -61,17 +60,17 @@ func (hd FlowTemplateHandler) Detail(c *gin.Context) {
response.CheckAndRespWithData(c, res, err) response.CheckAndRespWithData(c, res, err)
} }
// @Summary 流程模板新增 // @Summary 流程模板新增
// @Tags flow_template-流程模板 // @Tags flow_template-流程模板
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param flowName body string false "流程名称" // @Param flowName body string false "流程名称"
// @Param flowGroup body int false "流程分类" // @Param flowGroup body int false "流程分类"
// @Param flowRemark body string false "流程描述" // @Param flowRemark body string false "流程描述"
// @Param flowFormData body string false "表单配置" // @Param flowFormData body string false "表单配置"
// @Param flowProcessData body string false "流程配置" // @Param flowProcessData body string false "流程配置"
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/flow_template/add [post] // @Router /api/admin/flow/flow_template/add [post]
func (hd FlowTemplateHandler) Add(c *gin.Context) { func (hd FlowTemplateHandler) Add(c *gin.Context) {
var addReq FlowTemplateAddReq var addReq FlowTemplateAddReq
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &addReq)) { if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &addReq)) {
@@ -80,18 +79,18 @@ func (hd FlowTemplateHandler) Add(c *gin.Context) {
response.CheckAndResp(c, Service.Add(addReq)) response.CheckAndResp(c, Service.Add(addReq))
} }
// @Summary 流程模板编辑 // @Summary 流程模板编辑
// @Tags flow_template-流程模板 // @Tags flow_template-流程模板
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param id body int false "." // @Param id body int false "."
// @Param flowName body string false "流程名称" // @Param flowName body string false "流程名称"
// @Param flowGroup body int false "流程分类" // @Param flowGroup body int false "流程分类"
// @Param flowRemark body string false "流程描述" // @Param flowRemark body string false "流程描述"
// @Param flowFormData body string false "表单配置" // @Param flowFormData body string false "表单配置"
// @Param flowProcessData body string false "流程配置" // @Param flowProcessData body string false "流程配置"
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/flow_template/edit [post] // @Router /api/admin/flow/flow_template/edit [post]
func (hd FlowTemplateHandler) Edit(c *gin.Context) { func (hd FlowTemplateHandler) Edit(c *gin.Context) {
var editReq FlowTemplateEditReq var editReq FlowTemplateEditReq
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &editReq)) { if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &editReq)) {
@@ -100,13 +99,13 @@ func (hd FlowTemplateHandler) Edit(c *gin.Context) {
response.CheckAndResp(c, Service.Edit(editReq)) response.CheckAndResp(c, Service.Edit(editReq))
} }
// @Summary 流程模板删除 // @Summary 流程模板删除
// @Tags flow_template-流程模板 // @Tags flow_template-流程模板
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param id body int false "历史id" // @Param id body int false "历史id"
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/flow_template/del [post] // @Router /api/admin/flow/flow_template/del [post]
func (hd FlowTemplateHandler) Del(c *gin.Context) { func (hd FlowTemplateHandler) Del(c *gin.Context) {
var delReq FlowTemplateDelReq var delReq FlowTemplateDelReq
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &delReq)) { if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &delReq)) {

View File

@@ -22,16 +22,15 @@ type {{{ title (toCamelCase .ModuleName) }}}Handler struct {}
{{{- range .Columns }}} {{{- range .Columns }}}
{{{- if .IsQuery }}} {{{- if .IsQuery }}}
{{{- if eq .HtmlType "datetime" }}} {{{- if eq .HtmlType "datetime" }}}
// @Param {{{ toCamelCase .GoField }}}Start query {{{ .GoType }}} false "{{{ .ColumnComment }}}." // @Param {{{ toCamelCase .GoField }}}Start query {{{ .GoType }}} false "{{{ .ColumnComment }}}"
// @Param {{{ toCamelCase .GoField }}}End query {{{ .GoType }}} false "{{{ .ColumnComment }}}." // @Param {{{ toCamelCase .GoField }}}End query {{{ .GoType }}} false "{{{ .ColumnComment }}}"
{{{- else }}} {{{- else }}}
// @Param {{{ toCamelCase .GoField }}} query {{{ .GoType }}} false "{{{ .ColumnComment }}}." // @Param {{{ toCamelCase .GoField }}} query {{{ .GoType }}} false "{{{ .ColumnComment }}}"
{{{- end }}} {{{- end }}}
{{{- end }}} {{{- end }}}
{{{- end }}} {{{- end }}}
// @Success 200 {object} []{{{ title (toCamelCase .EntityName) }}}Resp "成功" //@Success 200 {object} {{{getPageResp (title (toCamelCase .EntityName)) }}} "成功"
// @Failure 400 {object} string "请求错误" //@Router /api/admin/{{{ .ModuleName }}}/list [get]
// @Router /api/admin/{{{ .ModuleName }}}/list [get]
func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) List(c *gin.Context) { func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) List(c *gin.Context) {
var page request.PageReq var page request.PageReq
var listReq {{{ title (toCamelCase .EntityName) }}}ListReq var listReq {{{ title (toCamelCase .EntityName) }}}ListReq
@@ -51,14 +50,14 @@ func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) List(c *gin.Context) {
{{{- range .Columns }}} {{{- range .Columns }}}
{{{- if .IsQuery }}} {{{- if .IsQuery }}}
{{{- if eq .HtmlType "datetime" }}} {{{- if eq .HtmlType "datetime" }}}
// @Param {{{ toCamelCase .GoField }}}Start query {{{ .GoType }}} false "{{{ .ColumnComment }}}." // @Param {{{ toCamelCase .GoField }}}Start query {{{ .GoType }}} false "{{{ .ColumnComment }}}"
// @Param {{{ toCamelCase .GoField }}}End query {{{ .GoType }}} false "{{{ .ColumnComment }}}." // @Param {{{ toCamelCase .GoField }}}End query {{{ .GoType }}} false "{{{ .ColumnComment }}}"
{{{- else }}} {{{- else }}}
// @Param {{{ toCamelCase .GoField }}} query {{{ .GoType }}} false "{{{ .ColumnComment }}}." // @Param {{{ toCamelCase .GoField }}} query {{{ .GoType }}} false "{{{ .ColumnComment }}}"
{{{- end }}} {{{- end }}}
{{{- end }}} {{{- end }}}
{{{- end }}} {{{- end }}}
// @Success 200 {object} []{{{ title (toCamelCase .EntityName) }}}Resp "成功" // @Success 200 {object} response.Response{ data=[]{{{ title (toCamelCase .EntityName) }}}Resp} "成功"
// @Router /api/admin/{{{ .ModuleName }}}/listAll [get] // @Router /api/admin/{{{ .ModuleName }}}/listAll [get]
func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) ListAll(c *gin.Context) { func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) ListAll(c *gin.Context) {
var listReq {{{ title (toCamelCase .EntityName) }}}ListReq var listReq {{{ title (toCamelCase .EntityName) }}}ListReq
@@ -75,10 +74,10 @@ func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) ListAll(c *gin.Context
// @Param Token header string true "token" // @Param Token header string true "token"
{{{- range .Columns }}} {{{- range .Columns }}}
{{{- if .IsPk }}} {{{- if .IsPk }}}
// @Param {{{ toCamelCase .GoField }}} query {{{ .GoType }}} false "{{{ .ColumnComment }}}." // @Param {{{ toCamelCase .GoField }}} query {{{ .GoType }}} false "{{{ .ColumnComment }}}"
{{{- end }}} {{{- end }}}
{{{- end }}} {{{- end }}}
// @Success 200 {object} {{{ title (toCamelCase .EntityName) }}}Resp "成功" // @Success 200 {object} response.Response{ data={{{ title (toCamelCase .EntityName) }}}Resp} "成功"
// @Router /api/admin/{{{ .ModuleName }}}/detail [get] // @Router /api/admin/{{{ .ModuleName }}}/detail [get]
func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Detail(c *gin.Context) { func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Detail(c *gin.Context) {
var detailReq {{{ title (toCamelCase .EntityName) }}}DetailReq var detailReq {{{ title (toCamelCase .EntityName) }}}DetailReq
@@ -96,10 +95,10 @@ func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Detail(c *gin.Context)
// @Param Token header string true "token" // @Param Token header string true "token"
{{{- range .Columns }}} {{{- range .Columns }}}
{{{- if .IsInsert }}} {{{- if .IsInsert }}}
// @Param {{{ toCamelCase .GoField }}} body {{{ .GoType }}} false "{{{ .ColumnComment }}}." // @Param {{{ toCamelCase .GoField }}} body {{{ .GoType }}} false "{{{ .ColumnComment }}}"
{{{- end }}} {{{- end }}}
{{{- end }}} {{{- end }}}
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/admin/{{{ .ModuleName }}}/add [post] // @Router /api/admin/{{{ .ModuleName }}}/add [post]
func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Add(c *gin.Context) { func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Add(c *gin.Context) {
var addReq {{{ title (toCamelCase .EntityName) }}}AddReq var addReq {{{ title (toCamelCase .EntityName) }}}AddReq
@@ -114,10 +113,10 @@ func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Add(c *gin.Context) {
// @Param Token header string true "token" // @Param Token header string true "token"
{{{- range .Columns }}} {{{- range .Columns }}}
{{{- if .IsEdit }}} {{{- if .IsEdit }}}
// @Param {{{ toCamelCase .GoField }}} body {{{ .GoType }}} false "{{{ .ColumnComment }}}." // @Param {{{ toCamelCase .GoField }}} body {{{ .GoType }}} false "{{{ .ColumnComment }}}"
{{{- end }}} {{{- end }}}
{{{- end }}} {{{- end }}}
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/admin/{{{ .ModuleName }}}/edit [post] // @Router /api/admin/{{{ .ModuleName }}}/edit [post]
func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Edit(c *gin.Context) { func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Edit(c *gin.Context) {
var editReq {{{ title (toCamelCase .EntityName) }}}EditReq var editReq {{{ title (toCamelCase .EntityName) }}}EditReq
@@ -132,10 +131,10 @@ func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Edit(c *gin.Context) {
// @Param Token header string true "token" // @Param Token header string true "token"
{{{- range .Columns }}} {{{- range .Columns }}}
{{{- if .IsPk }}} {{{- if .IsPk }}}
// @Param {{{ toCamelCase .GoField }}} body {{{ .GoType }}} false "{{{ .ColumnComment }}}." // @Param {{{ toCamelCase .GoField }}} body {{{ .GoType }}} false "{{{ .ColumnComment }}}"
{{{- end }}} {{{- end }}}
{{{- end }}} {{{- end }}}
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/admin/{{{ .ModuleName }}}/del [post] // @Router /api/admin/{{{ .ModuleName }}}/del [post]
func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Del(c *gin.Context) { func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Del(c *gin.Context) {
var delReq {{{ title (toCamelCase .EntityName) }}}DelReq var delReq {{{ title (toCamelCase .EntityName) }}}DelReq
@@ -153,7 +152,12 @@ func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Del(c *gin.Context) {
// @Param Token header string true "token" // @Param Token header string true "token"
{{{- range .Columns }}} {{{- range .Columns }}}
{{{- if .IsQuery }}} {{{- if .IsQuery }}}
// @Param {{{ toCamelCase .GoField }}} query {{{ .GoType }}} false "{{{ .ColumnComment }}}." {{{- if eq .HtmlType "datetime" }}}
// @Param {{{ toCamelCase .GoField }}}Start query {{{ .GoType }}} false "{{{ .ColumnComment }}}"
// @Param {{{ toCamelCase .GoField }}}End query {{{ .GoType }}} false "{{{ .ColumnComment }}}"
{{{- else }}}
// @Param {{{ toCamelCase .GoField }}} query {{{ .GoType }}} false "{{{ .ColumnComment }}}"
{{{- end }}}
{{{- end }}} {{{- end }}}
{{{- end }}} {{{- end }}}
// @Router /api/admin/{{{ .ModuleName }}}/ExportFile [get] // @Router /api/admin/{{{ .ModuleName }}}/ExportFile [get]
@@ -178,6 +182,7 @@ func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) ExportFile(c *gin.Cont
// @Summary {{{ .FunctionName }}}导入 // @Summary {{{ .FunctionName }}}导入
// @Tags {{{ .ModuleName }}}-{{{ .FunctionName }}} // @Tags {{{ .ModuleName }}}-{{{ .FunctionName }}}
// @Produce json // @Produce json
// @Router /api/admin/{{{ .ModuleName }}}/ImportFile [post]
func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) ImportFile(c *gin.Context) { func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) ImportFile(c *gin.Context) {
file, _, err := c.Request.FormFile("file") file, _, err := c.Request.FormFile("file")
if err != nil { if err != nil {

View File

@@ -24,6 +24,7 @@ var TemplateUtil = templateUtil{
"toCamelCase": util.StringUtil.ToCamelCase, "toCamelCase": util.StringUtil.ToCamelCase,
"contains": util.ToolsUtil.Contains, "contains": util.ToolsUtil.Contains,
"goToTsType": util.ToolsUtil.GoToTsType, "goToTsType": util.ToolsUtil.GoToTsType,
"getPageResp": util.ToolsUtil.GetPageResp,
}), }),
} }

View File

@@ -3,37 +3,39 @@ package monitor_client
import ( import (
"net/http" "net/http"
"time" "time"
"github.com/gin-gonic/gin"
"x_admin/core/request" "x_admin/core/request"
"x_admin/core/response" "x_admin/core/response"
"x_admin/util" "x_admin/util"
"x_admin/util/excel" "x_admin/util/excel"
"github.com/gin-gonic/gin"
) )
type MonitorClientHandler struct{}
type MonitorClientHandler struct {}
// @Summary 监控-客户端信息列表 // @Summary 监控-客户端信息列表
// @Tags monitor_client-监控-客户端信息 // @Tags monitor_client-监控-客户端信息
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param PageNo query int true "页码" // @Param PageNo query int true "页码"
// @Param PageSize query int true "每页数量" // @Param PageSize query int true "每页数量"
// @Param projectKey query string false "项目key." // @Param projectKey query string false "项目key."
// @Param clientId query string false "sdk生成的客户端id." // @Param clientId query string false "sdk生成的客户端id."
// @Param userId query string false "用户id." // @Param userId query string false "用户id."
// @Param os query string false "系统." // @Param os query string false "系统."
// @Param browser query string false "浏览器." // @Param browser query string false "浏览器."
// @Param city query string false "城市." // @Param city query string false "城市."
// @Param width query int false "屏幕." // @Param width query int false "屏幕."
// @Param height query int false "屏幕高度." // @Param height query int false "屏幕高度."
// @Param ua query string false "ua记录." // @Param ua query string false "ua记录."
// @Param createTimeStart query core.TsTime false "创建时间." // @Param createTimeStart query core.TsTime false "创建时间."
// @Param createTimeEnd query core.TsTime false "创建时间." // @Param createTimeEnd query core.TsTime false "创建时间."
// @Param clientTimeStart query core.TsTime false "更新时间." // @Param clientTimeStart query core.TsTime false "更新时间."
// @Param clientTimeEnd query core.TsTime false "更新时间." // @Param clientTimeEnd query core.TsTime false "更新时间."
// @Success 200 {object} []MonitorClientResp "成功" //
// @Failure 400 {object} string "请求错误" // @Success 200 {object} response.Response{data=response.PageResp{lists=[]MonitorClientResp}} "成功"
//
// @Failure 400 {object} string "请求错误"
// @Router /api/admin/monitor_client/list [get] // @Router /api/admin/monitor_client/list [get]
func (hd MonitorClientHandler) List(c *gin.Context) { func (hd MonitorClientHandler) List(c *gin.Context) {
var page request.PageReq var page request.PageReq
@@ -50,21 +52,21 @@ func (hd MonitorClientHandler) List(c *gin.Context) {
// @Summary 监控-客户端信息列表-所有 // @Summary 监控-客户端信息列表-所有
// @Tags monitor_client-监控-客户端信息 // @Tags monitor_client-监控-客户端信息
// @Produce json // @Produce json
// @Param projectKey query string false "项目key." // @Param projectKey query string false "项目key."
// @Param clientId query string false "sdk生成的客户端id." // @Param clientId query string false "sdk生成的客户端id."
// @Param userId query string false "用户id." // @Param userId query string false "用户id."
// @Param os query string false "系统." // @Param os query string false "系统."
// @Param browser query string false "浏览器." // @Param browser query string false "浏览器."
// @Param city query string false "城市." // @Param city query string false "城市."
// @Param width query int false "屏幕." // @Param width query int false "屏幕."
// @Param height query int false "屏幕高度." // @Param height query int false "屏幕高度."
// @Param ua query string false "ua记录." // @Param ua query string false "ua记录."
// @Param createTimeStart query core.TsTime false "创建时间." // @Param createTimeStart query core.TsTime false "创建时间."
// @Param createTimeEnd query core.TsTime false "创建时间." // @Param createTimeEnd query core.TsTime false "创建时间."
// @Param clientTimeStart query core.TsTime false "更新时间." // @Param clientTimeStart query core.TsTime false "更新时间."
// @Param clientTimeEnd query core.TsTime false "更新时间." // @Param clientTimeEnd query core.TsTime false "更新时间."
// @Success 200 {object} []MonitorClientResp "成功" // @Success 200 {object} response.Response{data=[]MonitorClientResp} "成功"
// @Router /api/admin/monitor_client/listAll [get] // @Router /api/admin/monitor_client/listAll [get]
func (hd MonitorClientHandler) ListAll(c *gin.Context) { func (hd MonitorClientHandler) ListAll(c *gin.Context) {
var listReq MonitorClientListReq var listReq MonitorClientListReq
@@ -78,9 +80,9 @@ func (hd MonitorClientHandler) ListAll(c *gin.Context) {
// @Summary 监控-客户端信息详情 // @Summary 监控-客户端信息详情
// @Tags monitor_client-监控-客户端信息 // @Tags monitor_client-监控-客户端信息
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param id query int false "uuid." // @Param id query int false "uuid."
// @Success 200 {object} MonitorClientResp "成功" // @Success 200 {object} response.Response{data=MonitorClientResp} "成功"
// @Router /api/admin/monitor_client/detail [get] // @Router /api/admin/monitor_client/detail [get]
func (hd MonitorClientHandler) Detail(c *gin.Context) { func (hd MonitorClientHandler) Detail(c *gin.Context) {
var detailReq MonitorClientDetailReq var detailReq MonitorClientDetailReq
@@ -91,21 +93,20 @@ func (hd MonitorClientHandler) Detail(c *gin.Context) {
response.CheckAndRespWithData(c, res, err) response.CheckAndRespWithData(c, res, err)
} }
// @Summary 监控-客户端信息新增 // @Summary 监控-客户端信息新增
// @Tags monitor_client-监控-客户端信息 // @Tags monitor_client-监控-客户端信息
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param clientId body string false "sdk生成的客户端id." // @Param clientId body string false "sdk生成的客户端id."
// @Param userId body string false "用户id." // @Param userId body string false "用户id."
// @Param os body string false "系统." // @Param os body string false "系统."
// @Param browser body string false "浏览器." // @Param browser body string false "浏览器."
// @Param city body string false "城市." // @Param city body string false "城市."
// @Param width body int false "屏幕." // @Param width body int false "屏幕."
// @Param height body int false "屏幕高度." // @Param height body int false "屏幕高度."
// @Param ua body string false "ua记录." // @Param ua body string false "ua记录."
// @Param clientTime body core.TsTime false "更新时间." // @Param clientTime body core.TsTime false "更新时间."
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/admin/monitor_client/add [post] // @Router /api/admin/monitor_client/add [post]
func (hd MonitorClientHandler) Add(c *gin.Context) { func (hd MonitorClientHandler) Add(c *gin.Context) {
var addReq MonitorClientAddReq var addReq MonitorClientAddReq
@@ -114,20 +115,21 @@ func (hd MonitorClientHandler) Add(c *gin.Context) {
} }
response.CheckAndResp(c, Service.Add(addReq)) response.CheckAndResp(c, Service.Add(addReq))
} }
// @Summary 监控-客户端信息编辑 // @Summary 监控-客户端信息编辑
// @Tags monitor_client-监控-客户端信息 // @Tags monitor_client-监控-客户端信息
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param clientId body string false "sdk生成的客户端id." // @Param clientId body string false "sdk生成的客户端id."
// @Param userId body string false "用户id." // @Param userId body string false "用户id."
// @Param os body string false "系统." // @Param os body string false "系统."
// @Param browser body string false "浏览器." // @Param browser body string false "浏览器."
// @Param city body string false "城市." // @Param city body string false "城市."
// @Param width body int false "屏幕." // @Param width body int false "屏幕."
// @Param height body int false "屏幕高度." // @Param height body int false "屏幕高度."
// @Param ua body string false "ua记录." // @Param ua body string false "ua记录."
// @Param clientTime body core.TsTime false "更新时间." // @Param clientTime body core.TsTime false "更新时间."
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/admin/monitor_client/edit [post] // @Router /api/admin/monitor_client/edit [post]
func (hd MonitorClientHandler) Edit(c *gin.Context) { func (hd MonitorClientHandler) Edit(c *gin.Context) {
var editReq MonitorClientEditReq var editReq MonitorClientEditReq
@@ -136,12 +138,13 @@ func (hd MonitorClientHandler) Edit(c *gin.Context) {
} }
response.CheckAndResp(c, Service.Edit(editReq)) response.CheckAndResp(c, Service.Edit(editReq))
} }
// @Summary 监控-客户端信息删除 // @Summary 监控-客户端信息删除
// @Tags monitor_client-监控-客户端信息 // @Tags monitor_client-监控-客户端信息
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param id body int false "uuid." // @Param id body int false "uuid."
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/admin/monitor_client/del [post] // @Router /api/admin/monitor_client/del [post]
func (hd MonitorClientHandler) Del(c *gin.Context) { func (hd MonitorClientHandler) Del(c *gin.Context) {
var delReq MonitorClientDelReq var delReq MonitorClientDelReq
@@ -151,23 +154,21 @@ func (hd MonitorClientHandler) Del(c *gin.Context) {
response.CheckAndResp(c, Service.Del(delReq.Id)) response.CheckAndResp(c, Service.Del(delReq.Id))
} }
// @Summary 监控-客户端信息导出 // @Summary 监控-客户端信息导出
// @Tags monitor_client-监控-客户端信息 // @Tags monitor_client-监控-客户端信息
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param projectKey query string false "项目key." // @Param projectKey query string false "项目key."
// @Param clientId query string false "sdk生成的客户端id." // @Param clientId query string false "sdk生成的客户端id."
// @Param userId query string false "用户id." // @Param userId query string false "用户id."
// @Param os query string false "系统." // @Param os query string false "系统."
// @Param browser query string false "浏览器." // @Param browser query string false "浏览器."
// @Param city query string false "城市." // @Param city query string false "城市."
// @Param width query int false "屏幕." // @Param width query int false "屏幕."
// @Param height query int false "屏幕高度." // @Param height query int false "屏幕高度."
// @Param ua query string false "ua记录." // @Param ua query string false "ua记录."
// @Param createTime query core.TsTime false "创建时间." // @Param createTime query core.TsTime false "创建时间."
// @Param clientTime query core.TsTime false "更新时间." // @Param clientTime query core.TsTime false "更新时间."
// @Router /api/admin/monitor_client/ExportFile [get] // @Router /api/admin/monitor_client/ExportFile [get]
func (hd MonitorClientHandler) ExportFile(c *gin.Context) { func (hd MonitorClientHandler) ExportFile(c *gin.Context) {
var listReq MonitorClientListReq var listReq MonitorClientListReq
@@ -184,12 +185,12 @@ func (hd MonitorClientHandler) ExportFile(c *gin.Context) {
response.FailWithMsg(c, response.SystemError, "导出失败") response.FailWithMsg(c, response.SystemError, "导出失败")
return return
} }
excel.DownLoadExcel("监控-客户端信息" + time.Now().Format("20060102-150405"), c.Writer, f) excel.DownLoadExcel("监控-客户端信息"+time.Now().Format("20060102-150405"), c.Writer, f)
} }
// @Summary 监控-客户端信息导入 // @Summary 监控-客户端信息导入
// @Tags monitor_client-监控-客户端信息 // @Tags monitor_client-监控-客户端信息
// @Produce json // @Produce json
func (hd MonitorClientHandler) ImportFile(c *gin.Context) { func (hd MonitorClientHandler) ImportFile(c *gin.Context) {
file, _, err := c.Request.FormFile("file") file, _, err := c.Request.FormFile("file")
if err != nil { if err != nil {
@@ -203,9 +204,9 @@ func (hd MonitorClientHandler) ImportFile(c *gin.Context) {
c.String(http.StatusInternalServerError, err.Error()) c.String(http.StatusInternalServerError, err.Error())
return return
} }
// for _, t := range importList { // for _, t := range importList {
// fmt.Printf("%#v", t) // fmt.Printf("%#v", t)
// } // }
err = Service.ImportFile(importList) err = Service.ImportFile(importList)
response.CheckAndResp(c, err) response.CheckAndResp(c, err)
} }

View File

@@ -17,14 +17,14 @@ type MonitorProjectHandler struct{}
// @Summary 错误项目列表 // @Summary 错误项目列表
// @Tags monitor_project-错误项目 // @Tags monitor_project-错误项目
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param PageNo query int true "页码" // @Param PageNo query int true "页码"
// @Param PageSize query int true "每页数量" // @Param PageSize query int true "每页数量"
// @Param projectKey query string false "项目uuid." // @Param projectKey query string false "项目uuid."
// @Param projectName query string false "项目名称." // @Param projectName query string false "项目名称."
// @Param projectType query string false "项目类型go java web node php 等." // @Param projectType query string false "项目类型go java web node php 等."
// @Success 200 {object} []MonitorProjectResp "成功" // @Success 200 {object} response.Response{data=response.PageResp{lists=[]MonitorProjectResp}} "成功"
// @Failure 400 {object} string "请求错误" // @Failure 400 {object} string "请求错误"
// @Router /api/admin/monitor_project/list [get] // @Router /api/admin/monitor_project/list [get]
func (hd MonitorProjectHandler) List(c *gin.Context) { func (hd MonitorProjectHandler) List(c *gin.Context) {
var page request.PageReq var page request.PageReq
@@ -42,7 +42,7 @@ func (hd MonitorProjectHandler) List(c *gin.Context) {
// @Summary 错误项目列表-所有 // @Summary 错误项目列表-所有
// @Tags monitor_project-错误项目 // @Tags monitor_project-错误项目
// @Produce json // @Produce json
// @Success 200 {object} []MonitorProjectResp "成功" // @Success 200 {object} response.Response{data=[]MonitorProjectResp} "成功"
// @Router /api/admin/monitor_project/listAll [get] // @Router /api/admin/monitor_project/listAll [get]
func (hd MonitorProjectHandler) ListAll(c *gin.Context) { func (hd MonitorProjectHandler) ListAll(c *gin.Context) {
res, err := Service.ListAll() res, err := Service.ListAll()
@@ -56,9 +56,9 @@ func (hd MonitorProjectHandler) ListAll(c *gin.Context) {
// @Summary 错误项目详情 // @Summary 错误项目详情
// @Tags monitor_project-错误项目 // @Tags monitor_project-错误项目
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param id query int false "项目id." // @Param id query int false "项目id."
// @Success 200 {object} MonitorProjectResp "成功" // @Success 200 {object} response.Response{data=MonitorProjectResp} "成功"
// @Router /api/admin/monitor_project/detail [get] // @Router /api/admin/monitor_project/detail [get]
func (hd MonitorProjectHandler) Detail(c *gin.Context) { func (hd MonitorProjectHandler) Detail(c *gin.Context) {
var detailReq MonitorProjectDetailReq var detailReq MonitorProjectDetailReq
@@ -76,7 +76,7 @@ func (hd MonitorProjectHandler) Detail(c *gin.Context) {
// @Param projectKey body string false "项目uuid." // @Param projectKey body string false "项目uuid."
// @Param projectName body string false "项目名称." // @Param projectName body string false "项目名称."
// @Param projectType body string false "项目类型go java web node php 等." // @Param projectType body string false "项目类型go java web node php 等."
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/admin/monitor_project/add [post] // @Router /api/admin/monitor_project/add [post]
func (hd MonitorProjectHandler) Add(c *gin.Context) { func (hd MonitorProjectHandler) Add(c *gin.Context) {
var addReq MonitorProjectAddReq var addReq MonitorProjectAddReq
@@ -94,7 +94,7 @@ func (hd MonitorProjectHandler) Add(c *gin.Context) {
// @Param projectKey body string false "项目uuid." // @Param projectKey body string false "项目uuid."
// @Param projectName body string false "项目名称." // @Param projectName body string false "项目名称."
// @Param projectType body string false "项目类型go java web node php 等." // @Param projectType body string false "项目类型go java web node php 等."
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/admin/monitor_project/edit [post] // @Router /api/admin/monitor_project/edit [post]
func (hd MonitorProjectHandler) Edit(c *gin.Context) { func (hd MonitorProjectHandler) Edit(c *gin.Context) {
var editReq MonitorProjectEditReq var editReq MonitorProjectEditReq
@@ -109,7 +109,7 @@ func (hd MonitorProjectHandler) Edit(c *gin.Context) {
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param id body int false "项目id." // @Param id body int false "项目id."
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/admin/monitor_project/del [post] // @Router /api/admin/monitor_project/del [post]
func (hd MonitorProjectHandler) Del(c *gin.Context) { func (hd MonitorProjectHandler) Del(c *gin.Context) {
var delReq MonitorProjectDelReq var delReq MonitorProjectDelReq

View File

@@ -85,7 +85,7 @@ func (hd MonitorWebHandler) Detail(c *gin.Context) {
// @Param message body string false "错误消息." // @Param message body string false "错误消息."
// @Param stack body string false "错误堆栈." // @Param stack body string false "错误堆栈."
// @Param clientTime body int false "客户端时间." // @Param clientTime body int false "客户端时间."
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/admin/monitor_web/add [post] // @Router /api/admin/monitor_web/add [post]
func (hd MonitorWebHandler) Add(c *gin.Context) { func (hd MonitorWebHandler) Add(c *gin.Context) {
var addReq MonitorWebAddReq var addReq MonitorWebAddReq
@@ -107,7 +107,7 @@ func (hd MonitorWebHandler) Add(c *gin.Context) {
// @Param message body string false "错误消息." // @Param message body string false "错误消息."
// @Param stack body string false "错误堆栈." // @Param stack body string false "错误堆栈."
// @Param clientTime body int false "客户端时间." // @Param clientTime body int false "客户端时间."
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/admin/monitor_web/edit [post] // @Router /api/admin/monitor_web/edit [post]
func (hd MonitorWebHandler) Edit(c *gin.Context) { func (hd MonitorWebHandler) Edit(c *gin.Context) {
var editReq MonitorWebEditReq var editReq MonitorWebEditReq
@@ -122,7 +122,7 @@ func (hd MonitorWebHandler) Edit(c *gin.Context) {
// @Produce json // @Produce json
// @Param Token header string true "token" // @Param Token header string true "token"
// @Param id body int false "uuid." // @Param id body int false "uuid."
// @Success 200 {object} response.RespType "成功" // @Success 200 {object} response.Response "成功"
// @Router /api/admin/monitor_web/del [post] // @Router /api/admin/monitor_web/del [post]
func (hd MonitorWebHandler) Del(c *gin.Context) { func (hd MonitorWebHandler) Del(c *gin.Context) {
var delReq MonitorWebDelReq var delReq MonitorWebDelReq

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -97,6 +97,11 @@ func (tu toolsUtil) GoToTsType(s string) string {
return "string" return "string"
} }
// 拼接字符串
func (tu toolsUtil) GetPageResp(s string) string {
return `response.Response{ data=response.PageResp{ lists= []` + s + `Resp}}`
}
// Round float四舍五入 // Round float四舍五入
func (tu toolsUtil) Round(val float64, n int) float64 { func (tu toolsUtil) Round(val float64, n int) float64 {
base := math.Pow(10, float64(n)) base := math.Pow(10, float64(n))