mirror of
https://gitee.com/xiangheng/x_admin.git
synced 2025-10-07 09:01:18 +08:00
修复生成的文档注释返回结构不正确
This commit is contained in:
@@ -14,7 +14,8 @@ export default defineConfig({
|
||||
nav: [
|
||||
{ text: 'Home', link: '/' },
|
||||
{ text: '后端', link: '/server/准备.md' },
|
||||
{ text: '前端', link: '/admin/准备.md' }
|
||||
{ text: '前端', link: '/admin/准备.md' },
|
||||
{ text: '在线体验', link: 'https://x.adtk.cn/' },
|
||||
],
|
||||
|
||||
sidebar: [
|
||||
|
@@ -40,15 +40,14 @@ pm2 start 打包后的二进制文件名 --name x_admin
|
||||
pm2 startup
|
||||
# 保存
|
||||
pm2 save
|
||||
|
||||
|
||||
|
||||
# 所有任务列表
|
||||
pm2 list
|
||||
|
||||
|
||||
# 停止
|
||||
```bash
|
||||
pm2 stop x_admin
|
||||
# 重启
|
||||
```bash
|
||||
pm2 restart x_admin
|
||||
# 查看日志
|
||||
pm2 log x_admin
|
||||
|
@@ -26,9 +26,8 @@ type FlowApplyHandler struct{}
|
||||
// @Param flowFormData query string false "表单配置"
|
||||
// @Param flowProcessData query string false "流程配置"
|
||||
// @Param status query int false "状态:1待提交,2审批中,3审批完成,4审批失败"
|
||||
// @Success 200 {object} []FlowApplyResp "成功"
|
||||
// @Failure 400 {object} string "请求错误"
|
||||
// @Router /api/flow_apply/list [get]
|
||||
// @Success 200 {object} response.Response{data=response.PageResp{lists=[]FlowApplyResp}} "成功"
|
||||
// @Router /api/admin/flow/flow_apply/list [get]
|
||||
func (hd FlowApplyHandler) List(c *gin.Context) {
|
||||
var page request.PageReq
|
||||
var listReq FlowApplyListReq
|
||||
@@ -47,8 +46,8 @@ func (hd FlowApplyHandler) List(c *gin.Context) {
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param id query int false "申请id"
|
||||
// @Success 200 {object} FlowApplyResp "成功"
|
||||
// @Router /api/flow_apply/detail [get]
|
||||
// @Success 200 {object} response.Response{data=FlowApplyResp} "成功"
|
||||
// @Router /api/admin/flow/flow_apply/detail [get]
|
||||
func (hd FlowApplyHandler) Detail(c *gin.Context) {
|
||||
var detailReq FlowApplyDetailReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &detailReq)) {
|
||||
@@ -71,8 +70,8 @@ func (hd FlowApplyHandler) Detail(c *gin.Context) {
|
||||
// @Param flowFormData body string false "表单配置"
|
||||
// @Param flowProcessData body string false "流程配置"
|
||||
// @Param status body int false "状态:1待提交,2审批中,3审批完成,4审批失败"
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Router /api/flow_apply/add [post]
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/flow/flow_apply/add [post]
|
||||
func (hd FlowApplyHandler) Add(c *gin.Context) {
|
||||
var addReq FlowApplyAddReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &addReq)) {
|
||||
@@ -102,8 +101,8 @@ func (hd FlowApplyHandler) Add(c *gin.Context) {
|
||||
// @Param flowFormData body string false "表单配置"
|
||||
// @Param flowProcessData body string false "流程配置"
|
||||
// @Param status body int false "状态:1待提交,2审批中,3审批完成,4审批失败"
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Router /api/flow_apply/edit [post]
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/flow/flow_apply/edit [post]
|
||||
func (hd FlowApplyHandler) Edit(c *gin.Context) {
|
||||
var editReq FlowApplyEditReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &editReq)) {
|
||||
@@ -117,8 +116,8 @@ func (hd FlowApplyHandler) Edit(c *gin.Context) {
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param id body int false "申请id"
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Router /api/flow_apply/del [post]
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/flow/flow_apply/del [post]
|
||||
func (hd FlowApplyHandler) Del(c *gin.Context) {
|
||||
var delReq FlowApplyDelReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &delReq)) {
|
||||
|
@@ -28,9 +28,8 @@ type FlowHistoryHandler struct {
|
||||
// @Param formValue query string false "表单值"
|
||||
// @Param passStatus query int false "通过状态:0待处理,1通过,2拒绝"
|
||||
// @Param passRemark query string false "通过备注"
|
||||
// @Success 200 {object} []FlowHistoryResp "成功"
|
||||
// @Failure 400 {object} string "请求错误"
|
||||
// @Router /api/flow_history/list [get]
|
||||
// @Success 200 {object} response.Response{data=response.PageResp{lists=[]FlowHistoryResp}} "成功"
|
||||
// @Router /api/admin/flow/flow_history/list [get]
|
||||
func (hd FlowHistoryHandler) List(c *gin.Context) {
|
||||
var page request.PageReq
|
||||
var listReq = FlowHistoryListReq{
|
||||
@@ -49,8 +48,8 @@ func (hd FlowHistoryHandler) List(c *gin.Context) {
|
||||
// @Summary 流程历史列表-所有
|
||||
// @Tags flow_history-流程历史
|
||||
// @Produce json
|
||||
// @Success 200 {object} []FlowHistoryResp "成功"
|
||||
// @Router /api/flow_history/listAll [get]
|
||||
// @Success 200 {object} response.Response{data=FlowHistoryResp} "成功"
|
||||
// @Router /api/admin/flow/flow_history/listAll [get]
|
||||
func (hd FlowHistoryHandler) ListAll(c *gin.Context) {
|
||||
var listReq FlowHistoryListReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &listReq)) {
|
||||
@@ -65,8 +64,8 @@ func (hd FlowHistoryHandler) ListAll(c *gin.Context) {
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param id query int false "历史id"
|
||||
// @Success 200 {object} FlowHistoryResp "成功"
|
||||
// @Router /api/flow_history/detail [get]
|
||||
// @Success 200 {object} response.Response{data=FlowHistoryResp} "成功"
|
||||
// @Router /api/admin/flow/flow_history/detail [get]
|
||||
func (hd FlowHistoryHandler) Detail(c *gin.Context) {
|
||||
var detailReq FlowHistoryDetailReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &detailReq)) {
|
||||
@@ -90,8 +89,8 @@ func (hd FlowHistoryHandler) Detail(c *gin.Context) {
|
||||
// @Param formValue body string false "表单值"
|
||||
// @Param passStatus body int false "通过状态:0待处理,1通过,2拒绝"
|
||||
// @Param passRemark body string false "通过备注"
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Router /api/flow_history/add [post]
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/flow/flow_history/add [post]
|
||||
func (hd FlowHistoryHandler) Add(c *gin.Context) {
|
||||
var addReq FlowHistoryAddReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &addReq)) {
|
||||
@@ -115,8 +114,8 @@ func (hd FlowHistoryHandler) Add(c *gin.Context) {
|
||||
// @Param formValue body string false "表单值"
|
||||
// @Param passStatus body int false "通过状态:0待处理,1通过,2拒绝"
|
||||
// @Param passRemark body string false "通过备注"
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Router /api/flow_history/edit [post]
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/flow/flow_history/edit [post]
|
||||
func (hd FlowHistoryHandler) Edit(c *gin.Context) {
|
||||
var editReq FlowHistoryEditReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &editReq)) {
|
||||
@@ -130,8 +129,8 @@ func (hd FlowHistoryHandler) Edit(c *gin.Context) {
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param id body int false "历史id"
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Router /api/flow_history/del [post]
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/flow/flow_history/del [post]
|
||||
func (hd FlowHistoryHandler) Del(c *gin.Context) {
|
||||
var delReq FlowHistoryDelReq
|
||||
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) {
|
||||
var pass PassReq
|
||||
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) {
|
||||
var back BackReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &back)) {
|
||||
|
@@ -21,9 +21,8 @@ type FlowTemplateHandler struct{}
|
||||
// @Param flowRemark query string false "流程描述"
|
||||
// @Param flowFormData query string false "表单配置"
|
||||
// @Param flowProcessData query string false "流程配置"
|
||||
// @Success 200 {object} []FlowTemplateResp "成功"
|
||||
// @Failure 400 {object} string "请求错误"
|
||||
// @Router /api/flow_template/list [get]
|
||||
// @Success 200 {object} response.Response{data=response.PageResp{lists=[]FlowTemplateResp}} "成功"
|
||||
// @Router /api/admin/flow/flow_template/list [get]
|
||||
func (hd FlowTemplateHandler) List(c *gin.Context) {
|
||||
var page request.PageReq
|
||||
var listReq FlowTemplateListReq
|
||||
@@ -39,7 +38,7 @@ func (hd FlowTemplateHandler) List(c *gin.Context) {
|
||||
|
||||
// @Summary 流程模板列表-所有
|
||||
// @Tags flow_template-流程模板
|
||||
// @Router /api/flow_template/listAll [get]
|
||||
// @Router /api/admin/flow/flow_template/listAll [get]
|
||||
func (hd FlowTemplateHandler) ListAll(c *gin.Context) {
|
||||
res, err := Service.ListAll()
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
@@ -51,7 +50,7 @@ func (hd FlowTemplateHandler) ListAll(c *gin.Context) {
|
||||
// @Param Token header string true "token"
|
||||
// @Param id query int false "历史id"
|
||||
// @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) {
|
||||
var detailReq FlowTemplateDetailReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &detailReq)) {
|
||||
@@ -70,8 +69,8 @@ func (hd FlowTemplateHandler) Detail(c *gin.Context) {
|
||||
// @Param flowRemark body string false "流程描述"
|
||||
// @Param flowFormData body string false "表单配置"
|
||||
// @Param flowProcessData body string false "流程配置"
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Router /api/flow_template/add [post]
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/flow/flow_template/add [post]
|
||||
func (hd FlowTemplateHandler) Add(c *gin.Context) {
|
||||
var addReq FlowTemplateAddReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &addReq)) {
|
||||
@@ -90,8 +89,8 @@ func (hd FlowTemplateHandler) Add(c *gin.Context) {
|
||||
// @Param flowRemark body string false "流程描述"
|
||||
// @Param flowFormData body string false "表单配置"
|
||||
// @Param flowProcessData body string false "流程配置"
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Router /api/flow_template/edit [post]
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/flow/flow_template/edit [post]
|
||||
func (hd FlowTemplateHandler) Edit(c *gin.Context) {
|
||||
var editReq FlowTemplateEditReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &editReq)) {
|
||||
@@ -105,8 +104,8 @@ func (hd FlowTemplateHandler) Edit(c *gin.Context) {
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param id body int false "历史id"
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Router /api/flow_template/del [post]
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/flow/flow_template/del [post]
|
||||
func (hd FlowTemplateHandler) Del(c *gin.Context) {
|
||||
var delReq FlowTemplateDelReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &delReq)) {
|
||||
|
@@ -22,16 +22,15 @@ type {{{ title (toCamelCase .ModuleName) }}}Handler struct {}
|
||||
{{{- range .Columns }}}
|
||||
{{{- if .IsQuery }}}
|
||||
{{{- if eq .HtmlType "datetime" }}}
|
||||
// @Param {{{ toCamelCase .GoField }}}Start query {{{ .GoType }}} false "{{{ .ColumnComment }}}."
|
||||
// @Param {{{ toCamelCase .GoField }}}End query {{{ .GoType }}} false "{{{ .ColumnComment }}}."
|
||||
// @Param {{{ toCamelCase .GoField }}}Start query {{{ .GoType }}} false "{{{ .ColumnComment }}}"
|
||||
// @Param {{{ toCamelCase .GoField }}}End query {{{ .GoType }}} false "{{{ .ColumnComment }}}"
|
||||
{{{- else }}}
|
||||
// @Param {{{ toCamelCase .GoField }}} query {{{ .GoType }}} false "{{{ .ColumnComment }}}."
|
||||
// @Param {{{ toCamelCase .GoField }}} query {{{ .GoType }}} false "{{{ .ColumnComment }}}"
|
||||
{{{- end }}}
|
||||
{{{- end }}}
|
||||
{{{- end }}}
|
||||
// @Success 200 {object} []{{{ title (toCamelCase .EntityName) }}}Resp "成功"
|
||||
// @Failure 400 {object} string "请求错误"
|
||||
// @Router /api/admin/{{{ .ModuleName }}}/list [get]
|
||||
//@Success 200 {object} {{{getPageResp (title (toCamelCase .EntityName)) }}} "成功"
|
||||
//@Router /api/admin/{{{ .ModuleName }}}/list [get]
|
||||
func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) List(c *gin.Context) {
|
||||
var page request.PageReq
|
||||
var listReq {{{ title (toCamelCase .EntityName) }}}ListReq
|
||||
@@ -51,14 +50,14 @@ func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) List(c *gin.Context) {
|
||||
{{{- range .Columns }}}
|
||||
{{{- if .IsQuery }}}
|
||||
{{{- if eq .HtmlType "datetime" }}}
|
||||
// @Param {{{ toCamelCase .GoField }}}Start query {{{ .GoType }}} false "{{{ .ColumnComment }}}."
|
||||
// @Param {{{ toCamelCase .GoField }}}End query {{{ .GoType }}} false "{{{ .ColumnComment }}}."
|
||||
// @Param {{{ toCamelCase .GoField }}}Start query {{{ .GoType }}} false "{{{ .ColumnComment }}}"
|
||||
// @Param {{{ toCamelCase .GoField }}}End query {{{ .GoType }}} false "{{{ .ColumnComment }}}"
|
||||
{{{- else }}}
|
||||
// @Param {{{ toCamelCase .GoField }}} query {{{ .GoType }}} false "{{{ .ColumnComment }}}."
|
||||
// @Param {{{ toCamelCase .GoField }}} query {{{ .GoType }}} false "{{{ .ColumnComment }}}"
|
||||
{{{- 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]
|
||||
func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) ListAll(c *gin.Context) {
|
||||
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"
|
||||
{{{- range .Columns }}}
|
||||
{{{- if .IsPk }}}
|
||||
// @Param {{{ toCamelCase .GoField }}} query {{{ .GoType }}} false "{{{ .ColumnComment }}}."
|
||||
// @Param {{{ toCamelCase .GoField }}} query {{{ .GoType }}} false "{{{ .ColumnComment }}}"
|
||||
{{{- 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]
|
||||
func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Detail(c *gin.Context) {
|
||||
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"
|
||||
{{{- range .Columns }}}
|
||||
{{{- if .IsInsert }}}
|
||||
// @Param {{{ toCamelCase .GoField }}} body {{{ .GoType }}} false "{{{ .ColumnComment }}}."
|
||||
// @Param {{{ toCamelCase .GoField }}} body {{{ .GoType }}} false "{{{ .ColumnComment }}}"
|
||||
{{{- end }}}
|
||||
{{{- end }}}
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/{{{ .ModuleName }}}/add [post]
|
||||
func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Add(c *gin.Context) {
|
||||
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"
|
||||
{{{- range .Columns }}}
|
||||
{{{- if .IsEdit }}}
|
||||
// @Param {{{ toCamelCase .GoField }}} body {{{ .GoType }}} false "{{{ .ColumnComment }}}."
|
||||
// @Param {{{ toCamelCase .GoField }}} body {{{ .GoType }}} false "{{{ .ColumnComment }}}"
|
||||
{{{- end }}}
|
||||
{{{- end }}}
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/{{{ .ModuleName }}}/edit [post]
|
||||
func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Edit(c *gin.Context) {
|
||||
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"
|
||||
{{{- range .Columns }}}
|
||||
{{{- if .IsPk }}}
|
||||
// @Param {{{ toCamelCase .GoField }}} body {{{ .GoType }}} false "{{{ .ColumnComment }}}."
|
||||
// @Param {{{ toCamelCase .GoField }}} body {{{ .GoType }}} false "{{{ .ColumnComment }}}"
|
||||
{{{- end }}}
|
||||
{{{- end }}}
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/{{{ .ModuleName }}}/del [post]
|
||||
func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) Del(c *gin.Context) {
|
||||
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"
|
||||
{{{- range .Columns }}}
|
||||
{{{- 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 }}}
|
||||
// @Router /api/admin/{{{ .ModuleName }}}/ExportFile [get]
|
||||
@@ -178,6 +182,7 @@ func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) ExportFile(c *gin.Cont
|
||||
// @Summary {{{ .FunctionName }}}导入
|
||||
// @Tags {{{ .ModuleName }}}-{{{ .FunctionName }}}
|
||||
// @Produce json
|
||||
// @Router /api/admin/{{{ .ModuleName }}}/ImportFile [post]
|
||||
func (hd {{{ title (toCamelCase .ModuleName) }}}Handler) ImportFile(c *gin.Context) {
|
||||
file, _, err := c.Request.FormFile("file")
|
||||
if err != nil {
|
||||
|
@@ -24,6 +24,7 @@ var TemplateUtil = templateUtil{
|
||||
"toCamelCase": util.StringUtil.ToCamelCase,
|
||||
"contains": util.ToolsUtil.Contains,
|
||||
"goToTsType": util.ToolsUtil.GoToTsType,
|
||||
"getPageResp": util.ToolsUtil.GetPageResp,
|
||||
}),
|
||||
}
|
||||
|
||||
|
@@ -3,15 +3,15 @@ package monitor_client
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
"github.com/gin-gonic/gin"
|
||||
"x_admin/core/request"
|
||||
"x_admin/core/response"
|
||||
"x_admin/util"
|
||||
"x_admin/util/excel"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
type MonitorClientHandler struct {}
|
||||
type MonitorClientHandler struct{}
|
||||
|
||||
// @Summary 监控-客户端信息列表
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
@@ -32,7 +32,9 @@ type MonitorClientHandler struct {}
|
||||
// @Param createTimeEnd query core.TsTime false "创建时间."
|
||||
// @Param clientTimeStart query core.TsTime false "更新时间."
|
||||
// @Param clientTimeEnd query core.TsTime false "更新时间."
|
||||
// @Success 200 {object} []MonitorClientResp "成功"
|
||||
//
|
||||
// @Success 200 {object} response.Response{data=response.PageResp{lists=[]MonitorClientResp}} "成功"
|
||||
//
|
||||
// @Failure 400 {object} string "请求错误"
|
||||
// @Router /api/admin/monitor_client/list [get]
|
||||
func (hd MonitorClientHandler) List(c *gin.Context) {
|
||||
@@ -64,7 +66,7 @@ func (hd MonitorClientHandler) List(c *gin.Context) {
|
||||
// @Param createTimeEnd query core.TsTime false "创建时间."
|
||||
// @Param clientTimeStart 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]
|
||||
func (hd MonitorClientHandler) ListAll(c *gin.Context) {
|
||||
var listReq MonitorClientListReq
|
||||
@@ -80,7 +82,7 @@ func (hd MonitorClientHandler) ListAll(c *gin.Context) {
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param id query int false "uuid."
|
||||
// @Success 200 {object} MonitorClientResp "成功"
|
||||
// @Success 200 {object} response.Response{data=MonitorClientResp} "成功"
|
||||
// @Router /api/admin/monitor_client/detail [get]
|
||||
func (hd MonitorClientHandler) Detail(c *gin.Context) {
|
||||
var detailReq MonitorClientDetailReq
|
||||
@@ -91,7 +93,6 @@ func (hd MonitorClientHandler) Detail(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
}
|
||||
|
||||
|
||||
// @Summary 监控-客户端信息新增
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
@@ -105,7 +106,7 @@ func (hd MonitorClientHandler) Detail(c *gin.Context) {
|
||||
// @Param height body int false "屏幕高度."
|
||||
// @Param ua body string false "ua记录."
|
||||
// @Param clientTime body core.TsTime false "更新时间."
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_client/add [post]
|
||||
func (hd MonitorClientHandler) Add(c *gin.Context) {
|
||||
var addReq MonitorClientAddReq
|
||||
@@ -114,6 +115,7 @@ func (hd MonitorClientHandler) Add(c *gin.Context) {
|
||||
}
|
||||
response.CheckAndResp(c, Service.Add(addReq))
|
||||
}
|
||||
|
||||
// @Summary 监控-客户端信息编辑
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
@@ -127,7 +129,7 @@ func (hd MonitorClientHandler) Add(c *gin.Context) {
|
||||
// @Param height body int false "屏幕高度."
|
||||
// @Param ua body string false "ua记录."
|
||||
// @Param clientTime body core.TsTime false "更新时间."
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_client/edit [post]
|
||||
func (hd MonitorClientHandler) Edit(c *gin.Context) {
|
||||
var editReq MonitorClientEditReq
|
||||
@@ -136,12 +138,13 @@ func (hd MonitorClientHandler) Edit(c *gin.Context) {
|
||||
}
|
||||
response.CheckAndResp(c, Service.Edit(editReq))
|
||||
}
|
||||
|
||||
// @Summary 监控-客户端信息删除
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param id body int false "uuid."
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_client/del [post]
|
||||
func (hd MonitorClientHandler) Del(c *gin.Context) {
|
||||
var delReq MonitorClientDelReq
|
||||
@@ -151,8 +154,6 @@ func (hd MonitorClientHandler) Del(c *gin.Context) {
|
||||
response.CheckAndResp(c, Service.Del(delReq.Id))
|
||||
}
|
||||
|
||||
|
||||
|
||||
// @Summary 监控-客户端信息导出
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
@@ -184,7 +185,7 @@ func (hd MonitorClientHandler) ExportFile(c *gin.Context) {
|
||||
response.FailWithMsg(c, response.SystemError, "导出失败")
|
||||
return
|
||||
}
|
||||
excel.DownLoadExcel("监控-客户端信息" + time.Now().Format("20060102-150405"), c.Writer, f)
|
||||
excel.DownLoadExcel("监控-客户端信息"+time.Now().Format("20060102-150405"), c.Writer, f)
|
||||
}
|
||||
|
||||
// @Summary 监控-客户端信息导入
|
||||
@@ -203,9 +204,9 @@ func (hd MonitorClientHandler) ImportFile(c *gin.Context) {
|
||||
c.String(http.StatusInternalServerError, err.Error())
|
||||
return
|
||||
}
|
||||
// for _, t := range importList {
|
||||
// fmt.Printf("%#v", t)
|
||||
// }
|
||||
// for _, t := range importList {
|
||||
// fmt.Printf("%#v", t)
|
||||
// }
|
||||
err = Service.ImportFile(importList)
|
||||
response.CheckAndResp(c, err)
|
||||
}
|
@@ -23,7 +23,7 @@ type MonitorProjectHandler struct{}
|
||||
// @Param projectKey query string false "项目uuid."
|
||||
// @Param projectName query string false "项目名称."
|
||||
// @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 "请求错误"
|
||||
// @Router /api/admin/monitor_project/list [get]
|
||||
func (hd MonitorProjectHandler) List(c *gin.Context) {
|
||||
@@ -42,7 +42,7 @@ func (hd MonitorProjectHandler) List(c *gin.Context) {
|
||||
// @Summary 错误项目列表-所有
|
||||
// @Tags monitor_project-错误项目
|
||||
// @Produce json
|
||||
// @Success 200 {object} []MonitorProjectResp "成功"
|
||||
// @Success 200 {object} response.Response{data=[]MonitorProjectResp} "成功"
|
||||
// @Router /api/admin/monitor_project/listAll [get]
|
||||
func (hd MonitorProjectHandler) ListAll(c *gin.Context) {
|
||||
res, err := Service.ListAll()
|
||||
@@ -58,7 +58,7 @@ func (hd MonitorProjectHandler) ListAll(c *gin.Context) {
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param id query int false "项目id."
|
||||
// @Success 200 {object} MonitorProjectResp "成功"
|
||||
// @Success 200 {object} response.Response{data=MonitorProjectResp} "成功"
|
||||
// @Router /api/admin/monitor_project/detail [get]
|
||||
func (hd MonitorProjectHandler) Detail(c *gin.Context) {
|
||||
var detailReq MonitorProjectDetailReq
|
||||
@@ -76,7 +76,7 @@ func (hd MonitorProjectHandler) Detail(c *gin.Context) {
|
||||
// @Param projectKey body string false "项目uuid."
|
||||
// @Param projectName body string false "项目名称."
|
||||
// @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]
|
||||
func (hd MonitorProjectHandler) Add(c *gin.Context) {
|
||||
var addReq MonitorProjectAddReq
|
||||
@@ -94,7 +94,7 @@ func (hd MonitorProjectHandler) Add(c *gin.Context) {
|
||||
// @Param projectKey body string false "项目uuid."
|
||||
// @Param projectName body string false "项目名称."
|
||||
// @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]
|
||||
func (hd MonitorProjectHandler) Edit(c *gin.Context) {
|
||||
var editReq MonitorProjectEditReq
|
||||
@@ -109,7 +109,7 @@ func (hd MonitorProjectHandler) Edit(c *gin.Context) {
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param id body int false "项目id."
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_project/del [post]
|
||||
func (hd MonitorProjectHandler) Del(c *gin.Context) {
|
||||
var delReq MonitorProjectDelReq
|
||||
|
@@ -85,7 +85,7 @@ func (hd MonitorWebHandler) Detail(c *gin.Context) {
|
||||
// @Param message body string false "错误消息."
|
||||
// @Param stack body string false "错误堆栈."
|
||||
// @Param clientTime body int false "客户端时间."
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_web/add [post]
|
||||
func (hd MonitorWebHandler) Add(c *gin.Context) {
|
||||
var addReq MonitorWebAddReq
|
||||
@@ -107,7 +107,7 @@ func (hd MonitorWebHandler) Add(c *gin.Context) {
|
||||
// @Param message body string false "错误消息."
|
||||
// @Param stack body string false "错误堆栈."
|
||||
// @Param clientTime body int false "客户端时间."
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_web/edit [post]
|
||||
func (hd MonitorWebHandler) Edit(c *gin.Context) {
|
||||
var editReq MonitorWebEditReq
|
||||
@@ -122,7 +122,7 @@ func (hd MonitorWebHandler) Edit(c *gin.Context) {
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param id body int false "uuid."
|
||||
// @Success 200 {object} response.RespType "成功"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_web/del [post]
|
||||
func (hd MonitorWebHandler) Del(c *gin.Context) {
|
||||
var delReq MonitorWebDelReq
|
||||
|
2582
server/docs/docs.go
2582
server/docs/docs.go
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
@@ -97,6 +97,11 @@ func (tu toolsUtil) GoToTsType(s string) string {
|
||||
return "string"
|
||||
}
|
||||
|
||||
// 拼接字符串
|
||||
func (tu toolsUtil) GetPageResp(s string) string {
|
||||
return `response.Response{ data=response.PageResp{ lists= []` + s + `Resp}}`
|
||||
}
|
||||
|
||||
// Round float四舍五入
|
||||
func (tu toolsUtil) Round(val float64, n int) float64 {
|
||||
base := math.Pow(10, float64(n))
|
||||
|
Reference in New Issue
Block a user