mirror of
https://gitee.com/xiangheng/x_admin.git
synced 2025-12-24 08:12:55 +08:00
去掉AutoImport,Components
This commit is contained in:
@@ -1,4 +1,2 @@
|
||||
NODE_ENV = 'development'
|
||||
|
||||
# 请求域名
|
||||
VITE_APP_BASE_URL='http://127.0.0.1:8001'
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
NODE_ENV = 'production'
|
||||
|
||||
# 请求域名
|
||||
VITE_APP_BASE_URL=''
|
||||
VITE_APP_BASE_URL=''
|
||||
|
||||
@@ -3,13 +3,14 @@ require('@rushstack/eslint-patch/modern-module-resolution')
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
ignorePatterns: ['/auto-imports.d.ts', '/components.d.ts'],
|
||||
// ignorePatterns 忽略特定的文件和目录
|
||||
ignorePatterns: ['/auto-imports.d.ts', '/components.d.ts', 'scripts'],
|
||||
extends: [
|
||||
'plugin:vue/vue3-essential',
|
||||
'eslint:recommended',
|
||||
'@vue/eslint-config-typescript/recommended',
|
||||
'@vue/eslint-config-prettier',
|
||||
'./.eslintrc-auto-import.json'
|
||||
'@vue/eslint-config-prettier'
|
||||
// './.eslintrc-auto-import.json'
|
||||
],
|
||||
rules: {
|
||||
'prettier/prettier': [
|
||||
@@ -29,9 +30,9 @@ module.exports = {
|
||||
'vue/multi-word-component-names': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
'no-undef': 'off',
|
||||
'vue/prefer-import-from-vue': 'off',
|
||||
'no-prototype-builtins': 'off',
|
||||
// 'no-undef': 'off',
|
||||
// 'vue/prefer-import-from-vue': 'off',
|
||||
// 'no-prototype-builtins': 'off',
|
||||
'prefer-spread': 'off',
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
"@highlightjs/vue-plugin": "^2.1.0",
|
||||
"@logicflow/core": "^1.2.28",
|
||||
"@logicflow/extension": "^1.2.28",
|
||||
"@vue/shared": "^3.4.37",
|
||||
"@vueuse/core": "^10.11.0",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||
@@ -27,7 +26,7 @@
|
||||
"css-color-function": "^1.3.3",
|
||||
"dayjs": "^1.11.13",
|
||||
"echarts": "^5.5.1",
|
||||
"element-plus": "^2.8.3",
|
||||
"element-plus": "^2.8.6",
|
||||
"highlight.js": "^11.10.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"nprogress": "^0.2.0",
|
||||
|
||||
@@ -39,11 +39,17 @@ export type type_monitor_project_edit = {
|
||||
|
||||
// 监控项目列表
|
||||
export function monitor_project_list(params?: type_monitor_project_query) {
|
||||
return request.get<Pages<type_monitor_project>>({ url: '/monitor_project/list', params: clearEmpty(params) })
|
||||
return request.get<Pages<type_monitor_project>>({
|
||||
url: '/monitor_project/list',
|
||||
params: clearEmpty(params)
|
||||
})
|
||||
}
|
||||
// 监控项目列表-所有
|
||||
export function monitor_project_list_all(params?: type_monitor_project_query) {
|
||||
return request.get<type_monitor_project[]>({ url: '/monitor_project/listAll', params: clearEmpty(params) })
|
||||
return request.get<type_monitor_project[]>({
|
||||
url: '/monitor_project/listAll',
|
||||
params: clearEmpty(params)
|
||||
})
|
||||
}
|
||||
|
||||
// 监控项目详情
|
||||
@@ -75,5 +81,7 @@ export const monitor_project_import_file = '/monitor_project/ImportFile'
|
||||
|
||||
// 监控项目导出
|
||||
export function monitor_project_export_file(params: any) {
|
||||
return (window.location.href =`${config.baseUrl}${config.urlPrefix}/monitor_project/ExportFile?token=${getToken()}&` + queryString.stringify(clearEmpty(params)))
|
||||
return (window.location.href =
|
||||
`${config.baseUrl}${config.urlPrefix}/monitor_project/ExportFile?token=${getToken()}&` +
|
||||
queryString.stringify(clearEmpty(params)))
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import useTabsStore from '@/stores/modules/multipleTabs'
|
||||
import useSettingStore from '@/stores/modules/setting'
|
||||
import { computed } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
export default function useMultipleTabs() {
|
||||
const router = useRouter()
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { useRoute } from 'vue-router'
|
||||
import { watch } from 'vue'
|
||||
import type { RouteLocationNormalizedLoaded } from 'vue-router'
|
||||
|
||||
export function useWatchRoute(callback: (route: RouteLocationNormalizedLoaded) => void) {
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from 'vue-router'
|
||||
import useMultipleTabs from '@/hooks/useMultipleTabs'
|
||||
import { useWatchRoute } from '@/hooks/useWatchRoute'
|
||||
import useTabsStore, { getRouteParams } from '@/stores/modules/multipleTabs'
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { PropType } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import MenuItem from './menu-item.vue'
|
||||
import type { RouteRecordRaw } from 'vue-router'
|
||||
defineOptions({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import defaultSetting from '@/config/setting'
|
||||
import cache from '@/utils/cache'
|
||||
import { isObject } from '@vue/shared'
|
||||
import { isObject } from '@/utils/util'
|
||||
import { setTheme } from '@/utils/theme'
|
||||
import { SETTING_KEY } from '@/enums/cacheEnums'
|
||||
const storageSetting = cache.get(SETTING_KEY)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { isObject } from '@vue/shared'
|
||||
// import { isObject } from '@vue/shared'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
// import { md5 } from 'js-md5'
|
||||
import MD5 from 'crypto-js/md5'
|
||||
@@ -28,7 +28,12 @@ export const addUnit = (value: string | number, unit = 'px') => {
|
||||
export const isEmpty = (value: any) => {
|
||||
return value === '' || value === null || value === undefined
|
||||
}
|
||||
|
||||
/**
|
||||
* 判读是否为对象
|
||||
*/
|
||||
export const isObject = (val: any): boolean => {
|
||||
return val !== null && typeof val === 'object'
|
||||
}
|
||||
/**
|
||||
* @description 树转数组,队列实现广度优先遍历
|
||||
* @param {Array} data 数据
|
||||
|
||||
@@ -103,6 +103,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted, reactive, shallowRef } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import type { InputInstance, FormInstance } from 'element-plus'
|
||||
import LayoutFooter from '@/layout/components/footer.vue'
|
||||
import useAppStore from '@/stores/modules/app'
|
||||
|
||||
@@ -112,6 +112,8 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { reactive, shallowRef } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import feedback from '@/utils/feedback'
|
||||
import { useDictOptions } from '@/hooks/useDictOptions'
|
||||
|
||||
@@ -84,6 +84,8 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useRoute } from 'vue-router'
|
||||
import { shallowRef, reactive } from 'vue'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import { getUserDetail, userEdit } from '@/api/consumer'
|
||||
import feedback from '@/utils/feedback'
|
||||
|
||||
@@ -290,6 +290,9 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { ref, reactive, shallowRef } from 'vue'
|
||||
|
||||
import { generateEdit, tableDetail } from '@/api/tools/code'
|
||||
import { dictTypeAll } from '@/api/setting/dict'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
|
||||
@@ -57,6 +57,8 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { defineOptions, ref, shallowRef, reactive } from 'vue'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import feedback from '@/utils/feedback'
|
||||
import { noticeDetail, setNoticeConfig } from '@/api/message'
|
||||
|
||||
@@ -206,12 +206,6 @@ const handleAdd = async () => {
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.getDetail(data)
|
||||
}
|
||||
const multipleSelection = ref<type_monitor_client[]>([])
|
||||
const handleSelectionChange = (val: type_monitor_client[]) => {
|
||||
console.log(val)
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
:clickModalClose="true"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="84px" :rules="formRules">
|
||||
<el-form-item label="客户端id" prop="clientId">
|
||||
<el-input v-model="formData.clientId" placeholder="请输入客户端id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户id" prop="userId">
|
||||
<el-input v-model="formData.userId" placeholder="请输入用户id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="系统" prop="os">
|
||||
<el-input v-model="formData.os" placeholder="请输入系统" />
|
||||
</el-form-item>
|
||||
<el-form-item label="浏览器" prop="browser">
|
||||
<el-input v-model="formData.browser" placeholder="请输入浏览器" />
|
||||
</el-form-item>
|
||||
<el-form-item label="城市" prop="city">
|
||||
<el-input v-model="formData.city" placeholder="请输入城市" />
|
||||
</el-form-item>
|
||||
<el-form-item label="屏幕" prop="width">
|
||||
<el-input v-model="formData.width" placeholder="请输入屏幕" />
|
||||
</el-form-item>
|
||||
<el-form-item label="屏幕高度" prop="height">
|
||||
<el-input v-model="formData.height" placeholder="请输入屏幕高度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="ua记录" prop="ua">
|
||||
<el-input v-model="formData.ua" placeholder="请输入ua记录" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="clientTime">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.clientTime"
|
||||
type="datetime"
|
||||
clearable
|
||||
value-format="YYYY-MM-DD hh:mm:ss"
|
||||
placeholder="请选择更新时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import {
|
||||
monitor_client_edit,
|
||||
monitor_client_add,
|
||||
monitor_client_detail
|
||||
} from '@/api/monitor_client'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import feedback from '@/utils/feedback'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑监控-客户端信息' : '新增监控-客户端信息'
|
||||
})
|
||||
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
clientId: '',
|
||||
userId: '',
|
||||
os: '',
|
||||
browser: '',
|
||||
city: '',
|
||||
width: '',
|
||||
height: '',
|
||||
ua: '',
|
||||
clientTime: ''
|
||||
})
|
||||
|
||||
const formRules = {
|
||||
clientId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入客户端id',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
userId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入用户id',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
os: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入系统',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
browser: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入浏览器',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
city: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入城市',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
width: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入屏幕',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
height: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入屏幕高度',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
ua: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入ua记录',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
clientTime: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择更新时间',
|
||||
trigger: ['blur']
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
const handleSubmit = async () => {
|
||||
try {
|
||||
await formRef.value?.validate()
|
||||
const data: any = { ...formData }
|
||||
mode.value == 'edit' ? await monitor_client_edit(data) : await monitor_client_add(data)
|
||||
popupRef.value?.close()
|
||||
feedback.msgSuccess('操作成功')
|
||||
emit('success')
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
const setFormData = async (data: Record<string, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
try {
|
||||
const data = await monitor_client_detail(row.id)
|
||||
setFormData(data)
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
@@ -1,198 +0,0 @@
|
||||
<template>
|
||||
<div class="index-lists">
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
class="mb-[-16px]"
|
||||
:model="queryParams"
|
||||
:inline="true"
|
||||
label-width="70px"
|
||||
label-position="left"
|
||||
>
|
||||
<el-form-item label="项目key" prop="projectKey" class="w-[280px]">
|
||||
<el-select v-model="queryParams.projectKey" clearable>
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="sdk生成的客户端id" prop="clientId" class="w-[280px]">
|
||||
<el-input v-model="queryParams.clientId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户id" prop="userId" class="w-[280px]">
|
||||
<el-input v-model="queryParams.userId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="系统" prop="os" class="w-[280px]">
|
||||
<el-input v-model="queryParams.os" />
|
||||
</el-form-item>
|
||||
<el-form-item label="浏览器" prop="browser" class="w-[280px]">
|
||||
<el-input v-model="queryParams.browser" />
|
||||
</el-form-item>
|
||||
<el-form-item label="城市" prop="city" class="w-[280px]">
|
||||
<el-input v-model="queryParams.city" />
|
||||
</el-form-item>
|
||||
<el-form-item label="屏幕" prop="width" class="w-[280px]">
|
||||
<el-input v-model="queryParams.width" />
|
||||
</el-form-item>
|
||||
<el-form-item label="屏幕高度" prop="height" class="w-[280px]">
|
||||
<el-input v-model="queryParams.height" />
|
||||
</el-form-item>
|
||||
<el-form-item label="ua记录" prop="ua" class="w-[280px]">
|
||||
<el-input v-model="queryParams.ua" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime" class="w-[280px]">
|
||||
<daterange-picker
|
||||
v-model:startTime="queryParams.createTimeStart"
|
||||
v-model:endTime="queryParams.createTimeEnd"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="clientTime" class="w-[280px]">
|
||||
<daterange-picker
|
||||
v-model:startTime="queryParams.clientTimeStart"
|
||||
v-model:endTime="queryParams.clientTimeEnd"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none mt-4" shadow="never">
|
||||
<div>
|
||||
<el-button
|
||||
v-perms="['admin:monitor_client:add']"
|
||||
type="primary"
|
||||
@click="handleAdd()"
|
||||
>
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<upload
|
||||
class="ml-3 mr-3"
|
||||
:url="monitor_client_import_file"
|
||||
:data="{ cid: 0 }"
|
||||
type="file"
|
||||
:show-progress="true"
|
||||
@change="resetPage"
|
||||
>
|
||||
<el-button type="primary">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Upload" />
|
||||
</template>
|
||||
导入
|
||||
</el-button>
|
||||
</upload>
|
||||
<el-button type="primary" @click="exportFile">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Download" />
|
||||
</template>
|
||||
导出
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table class="mt-4" size="large" v-loading="pager.loading" :data="pager.lists">
|
||||
<el-table-column label="项目key" prop="projectKey" min-width="130" />
|
||||
<el-table-column label="sdk生成的客户端id" prop="clientId" min-width="130" />
|
||||
<el-table-column label="用户id" prop="userId" min-width="130" />
|
||||
<el-table-column label="系统" prop="os" min-width="130" />
|
||||
<el-table-column label="浏览器" prop="browser" min-width="130" />
|
||||
<el-table-column label="城市" prop="city" min-width="130" />
|
||||
<el-table-column label="屏幕" prop="width" min-width="130" />
|
||||
<el-table-column label="屏幕高度" prop="height" min-width="130" />
|
||||
<el-table-column label="ua记录" prop="ua" min-width="130" />
|
||||
<el-table-column label="创建时间" prop="createTime" min-width="130" />
|
||||
<el-table-column label="更新时间" prop="clientTime" min-width="130" />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['admin:monitor_client:edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['admin:monitor_client:del']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import {
|
||||
monitor_client_delete,
|
||||
monitor_client_list,
|
||||
monitor_client_import_file,
|
||||
monitor_client_export_file
|
||||
} from '@/api/monitor_client'
|
||||
import type { type_monitor_client, type_monitor_client_query } from '@/api/monitor_client'
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
defineOptions({
|
||||
name: 'monitor_client'
|
||||
})
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
const showEdit = ref(false)
|
||||
const queryParams = reactive<type_monitor_client_query>({
|
||||
projectKey: '',
|
||||
clientId: '',
|
||||
userId: '',
|
||||
os: '',
|
||||
browser: '',
|
||||
city: '',
|
||||
width: null,
|
||||
height: null,
|
||||
ua: '',
|
||||
createTimeStart: '',
|
||||
createTimeEnd: '',
|
||||
clientTimeStart: '',
|
||||
clientTimeEnd: ''
|
||||
})
|
||||
|
||||
const { pager, getLists, resetPage, resetParams } = usePaging<type_monitor_client>({
|
||||
fetchFun: monitor_client_list,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.getDetail(data)
|
||||
}
|
||||
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await monitor_client_delete(id)
|
||||
feedback.msgSuccess('删除成功')
|
||||
getLists()
|
||||
} catch (error) {}
|
||||
}
|
||||
const exportFile = async () => {
|
||||
try {
|
||||
await feedback.confirm('确定要导出?')
|
||||
await monitor_client_export_file(queryParams)
|
||||
} catch (error) {}
|
||||
}
|
||||
getLists()
|
||||
</script>
|
||||
@@ -1,197 +0,0 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
:clickModalClose="true"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="84px" :rules="formRules">
|
||||
<el-form-item label="项目key" prop="projectKey">
|
||||
<el-input v-model="formData.projectKey" placeholder="请输入项目key" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户端id" prop="clientId">
|
||||
<el-input v-model="formData.clientId" placeholder="请输入客户端id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="事件类型" prop="eventType">
|
||||
<!-- <el-select
|
||||
class="flex-1"
|
||||
v-model="formData.eventType"
|
||||
placeholder="请选择事件类型"
|
||||
>
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select> -->
|
||||
<el-input v-model="formData.eventType" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="URL地址" prop="page">
|
||||
<el-input
|
||||
v-model="formData.page"
|
||||
placeholder="请输入URL地址"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4, maxRows: 6 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="错误消息" prop="message">
|
||||
<el-input
|
||||
v-model="formData.message"
|
||||
placeholder="请输入错误消息"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4, maxRows: 6 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="错误堆栈" prop="stack">
|
||||
<el-input
|
||||
v-model="formData.stack"
|
||||
placeholder="请输入错误堆栈"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4, maxRows: 6 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户端时间" prop="clientTime">
|
||||
<el-input v-model="formData.clientTime" placeholder="请输入客户端时间" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import { monitor_web_edit, monitor_web_add, monitor_web_detail } from '@/api/monitor_web'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import feedback from '@/utils/feedback'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑错误收集error' : '新增错误收集error'
|
||||
})
|
||||
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
projectKey: '',
|
||||
clientId: '',
|
||||
eventType: '',
|
||||
page: '',
|
||||
message: '',
|
||||
stack: '',
|
||||
clientTime: ''
|
||||
})
|
||||
|
||||
const formRules = {
|
||||
id: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入uuid',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
projectKey: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入项目key',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
clientId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入客户端id',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
eventType: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择事件类型',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
page: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入URL地址',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
message: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入错误消息',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
stack: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入错误堆栈',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
clientTime: [
|
||||
{
|
||||
required: false,
|
||||
message: '请输入客户端时间',
|
||||
trigger: ['blur']
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
const handleSubmit = async () => {
|
||||
try {
|
||||
await formRef.value?.validate()
|
||||
const data: any = { ...formData }
|
||||
mode.value == 'edit' ? await monitor_web_edit(data) : await monitor_web_add(data)
|
||||
// popupRef.value?.close()
|
||||
feedback.msgSuccess('操作成功')
|
||||
emit('success')
|
||||
} catch (error) {
|
||||
console.log('error', error)
|
||||
|
||||
feedback.msgError(error?.message || error || '操作失败')
|
||||
}
|
||||
}
|
||||
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
const setFormData = async (data: Record<string, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
try {
|
||||
const data = await monitor_web_detail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
@@ -1,177 +0,0 @@
|
||||
<template>
|
||||
<div class="index-lists">
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
class="mb-[-16px]"
|
||||
:model="queryParams"
|
||||
:inline="true"
|
||||
label-width="70px"
|
||||
label-position="left"
|
||||
>
|
||||
<el-form-item label="项目" prop="projectKey" class="w-[280px]">
|
||||
<el-select v-model="queryParams.projectKey" clearable>
|
||||
<el-option
|
||||
:label="project.projectName"
|
||||
:value="project.projectKey"
|
||||
v-for="project of listAllData.monitor_project_list_all"
|
||||
:key="project.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户端id" prop="clientId" class="w-[280px]">
|
||||
<el-input v-model="queryParams.clientId" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="时间" prop="clientTime" class="w-[400px]">
|
||||
<daterange-picker
|
||||
v-model:startTime="queryParams.clientTimeStart"
|
||||
v-model:endTime="queryParams.clientTimeEnd"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="创建时间" prop="createTime" class="w-[400px]">
|
||||
<daterange-picker
|
||||
v-model:startTime="queryParams.createTimeStart"
|
||||
v-model:endTime="queryParams.createTimeEnd"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none mt-4" shadow="never">
|
||||
<div>
|
||||
<el-button v-perms="['admin:monitor_web:add']" type="primary" @click="handleAdd()">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<upload
|
||||
class="ml-3 mr-3"
|
||||
:url="monitor_web_import_file"
|
||||
:data="{ cid: 0 }"
|
||||
type="file"
|
||||
:show-progress="true"
|
||||
@change="resetPage"
|
||||
>
|
||||
<el-button type="primary">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Upload" />
|
||||
</template>
|
||||
导入
|
||||
</el-button>
|
||||
</upload>
|
||||
<el-button type="primary" @click="exportFile">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Download" />
|
||||
</template>
|
||||
导出
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table class="mt-4" size="large" v-loading="pager.loading" :data="pager.lists">
|
||||
<el-table-column type="expand">
|
||||
<template #default="props">
|
||||
<el-alert :title="props.row.stack" type="error" :closable="false" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目key" prop="projectKey" min-width="130" />
|
||||
<el-table-column label="客户端id" prop="clientId" min-width="130" />
|
||||
<el-table-column label="事件类型" prop="eventType" min-width="130" />
|
||||
<el-table-column label="URL地址" prop="page" min-width="130" />
|
||||
<el-table-column label="错误消息" prop="message" min-width="130" />
|
||||
|
||||
<el-table-column label="时间" prop="clientTime" min-width="130" />
|
||||
<!-- <el-table-column label="创建时间" prop="createTime" min-width="130" /> -->
|
||||
<el-table-column label="操作" width="100" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['admin:monitor_web:del']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import {
|
||||
monitor_web_delete,
|
||||
monitor_web_list,
|
||||
monitor_web_import_file,
|
||||
monitor_web_export_file
|
||||
} from '@/api/monitor_web'
|
||||
import { monitor_project_list_all } from '@/api/monitor_project'
|
||||
import { useDictOptions } from '@/hooks/useDictOptions'
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
defineOptions({
|
||||
name: 'monitor_web'
|
||||
})
|
||||
|
||||
const { optionsData: listAllData } = useDictOptions<{
|
||||
monitor_project_list_all: any[]
|
||||
}>({
|
||||
monitor_project_list_all: {
|
||||
api: monitor_project_list_all
|
||||
}
|
||||
})
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
const showEdit = ref(false)
|
||||
const queryParams = reactive({
|
||||
projectKey: route.query?.projectKey as string,
|
||||
clientId: route.query?.clientId as string,
|
||||
eventType: '',
|
||||
page: '',
|
||||
message: '',
|
||||
stack: '',
|
||||
clientTimeStart: '',
|
||||
clientTimeEnd: '',
|
||||
createTimeStart: '',
|
||||
createTimeEnd: ''
|
||||
})
|
||||
|
||||
const { pager, getLists, resetPage, resetParams } = usePaging({
|
||||
fetchFun: monitor_web_list,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await monitor_web_delete({ id })
|
||||
feedback.msgSuccess('删除成功')
|
||||
getLists()
|
||||
} catch (error) {}
|
||||
}
|
||||
const exportFile = async () => {
|
||||
try {
|
||||
await feedback.confirm('确定要导出?')
|
||||
await monitor_web_export_file(queryParams)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
getLists()
|
||||
</script>
|
||||
@@ -3,13 +3,14 @@ import { fileURLToPath, URL } from 'url'
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import vueJsx from '@vitejs/plugin-vue-jsx'
|
||||
import AutoImport from 'unplugin-auto-import/vite'
|
||||
import Components from 'unplugin-vue-components/vite'
|
||||
// import AutoImport from 'unplugin-auto-import/vite'
|
||||
// import Components from 'unplugin-vue-components/vite'
|
||||
|
||||
// import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
||||
// import { createStyleImportPlugin, ElementPlusResolve } from 'vite-plugin-style-import'
|
||||
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
||||
|
||||
import viteCompression from 'vite-plugin-compression'
|
||||
// import viteCompression from 'vite-plugin-compression'
|
||||
import { visualizer } from 'rollup-plugin-visualizer'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
@@ -22,8 +23,8 @@ export default ({ mode }) => {
|
||||
// 依赖预构建,避免开发刷新
|
||||
include: ['@wangeditor/editor-for-vue', 'vuedraggable', 'vue-echarts', 'crypto-js']
|
||||
},
|
||||
base: './',
|
||||
build: {
|
||||
// 打包后文件名
|
||||
sourcemap: true
|
||||
},
|
||||
server: {
|
||||
@@ -41,17 +42,17 @@ export default ({ mode }) => {
|
||||
plugins: [
|
||||
vue(),
|
||||
vueJsx(),
|
||||
AutoImport({
|
||||
imports: ['vue', 'vue-router'],
|
||||
// resolvers: [ElementPlusResolver()],
|
||||
eslintrc: {
|
||||
enabled: true
|
||||
}
|
||||
}),
|
||||
Components({
|
||||
directoryAsNamespace: true
|
||||
// resolvers: [ElementPlusResolver()]
|
||||
}),
|
||||
// AutoImport({
|
||||
// imports: ['vue', 'vue-router'],
|
||||
// // resolvers: [ElementPlusResolver()],
|
||||
// eslintrc: {
|
||||
// enabled: true
|
||||
// }
|
||||
// }),
|
||||
// Components({
|
||||
// directoryAsNamespace: true
|
||||
// // resolvers: [ElementPlusResolver()]
|
||||
// }),
|
||||
// createStyleImportPlugin({
|
||||
// resolves: [ElementPlusResolve()]
|
||||
// }),
|
||||
@@ -60,9 +61,9 @@ export default ({ mode }) => {
|
||||
iconDirs: [fileURLToPath(new URL('./src/assets/icons', import.meta.url))],
|
||||
symbolId: 'local-icon-[dir]-[name]'
|
||||
}),
|
||||
viteCompression({
|
||||
algorithm: 'gzip'
|
||||
}),
|
||||
// viteCompression({
|
||||
// algorithm: 'gzip'
|
||||
// })
|
||||
// viteCompression({
|
||||
// algorithm: 'brotliCompress'
|
||||
// })
|
||||
|
||||
@@ -18,26 +18,26 @@ type MonitorClientHandler struct {
|
||||
requestGroup singleflight.Group
|
||||
}
|
||||
|
||||
// @Summary 监控-客户端信息列表
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param PageNo query int true "页码"
|
||||
// @Param PageSize query int true "每页数量"
|
||||
// @Param ProjectKey query string false "项目key"
|
||||
// @Param ClientId query string false "sdk生成的客户端id"
|
||||
// @Param UserId query string false "用户id"
|
||||
// @Param Os query string false "系统"
|
||||
// @Param Browser query string false "浏览器"
|
||||
// @Param City query string false "城市"
|
||||
// @Param Width query number false "屏幕"
|
||||
// @Param Height query number false "屏幕高度"
|
||||
// @Param Ua query string false "ua记录"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Summary 监控-客户端信息列表
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param PageNo query int true "页码"
|
||||
// @Param PageSize query int true "每页数量"
|
||||
// @Param ProjectKey query string false "项目key"
|
||||
// @Param ClientId query string false "sdk生成的客户端id"
|
||||
// @Param UserId query string false "用户id"
|
||||
// @Param Os query string false "系统"
|
||||
// @Param Browser query string false "浏览器"
|
||||
// @Param City query string false "城市"
|
||||
// @Param Width query number false "屏幕"
|
||||
// @Param Height query number false "屏幕高度"
|
||||
// @Param Ua query string false "ua记录"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
//
|
||||
// @Success 200 {object} response.Response{ data=response.PageResp{ lists=[]MonitorClientResp}} "成功"
|
||||
// @Router /api/admin/monitor_client/list [get]
|
||||
// @Success 200 {object} response.Response{ data=response.PageResp{ lists=[]MonitorClientResp}} "成功"
|
||||
// @Router /api/admin/monitor_client/list [get]
|
||||
func (hd *MonitorClientHandler) List(c *gin.Context) {
|
||||
var page request.PageReq
|
||||
var listReq MonitorClientListReq
|
||||
@@ -51,22 +51,22 @@ func (hd *MonitorClientHandler) List(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
}
|
||||
|
||||
// @Summary 监控-客户端信息列表-所有
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
// @Param ProjectKey query string false "项目key"
|
||||
// @Param ClientId query string false "sdk生成的客户端id"
|
||||
// @Param UserId query string false "用户id"
|
||||
// @Param Os query string false "系统"
|
||||
// @Param Browser query string false "浏览器"
|
||||
// @Param City query string false "城市"
|
||||
// @Param Width query number false "屏幕"
|
||||
// @Param Height query number false "屏幕高度"
|
||||
// @Param Ua query string false "ua记录"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Success 200 {object} response.Response{ data=[]MonitorClientResp} "成功"
|
||||
// @Router /api/admin/monitor_client/listAll [get]
|
||||
// @Summary 监控-客户端信息列表-所有
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
// @Param ProjectKey query string false "项目key"
|
||||
// @Param ClientId query string false "sdk生成的客户端id"
|
||||
// @Param UserId query string false "用户id"
|
||||
// @Param Os query string false "系统"
|
||||
// @Param Browser query string false "浏览器"
|
||||
// @Param City query string false "城市"
|
||||
// @Param Width query number false "屏幕"
|
||||
// @Param Height query number false "屏幕高度"
|
||||
// @Param Ua query string false "ua记录"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Success 200 {object} response.Response{ data=[]MonitorClientResp} "成功"
|
||||
// @Router /api/admin/monitor_client/listAll [get]
|
||||
func (hd *MonitorClientHandler) ListAll(c *gin.Context) {
|
||||
var listReq MonitorClientListReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &listReq)) {
|
||||
@@ -85,13 +85,13 @@ func (hd *MonitorClientHandler) ErrorUsers(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
}
|
||||
|
||||
// @Summary 监控-客户端信息详情
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id query number false "uuid"
|
||||
// @Success 200 {object} response.Response{ data=MonitorClientResp} "成功"
|
||||
// @Router /api/admin/monitor_client/detail [get]
|
||||
// @Summary 监控-客户端信息详情
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id query number false "uuid"
|
||||
// @Success 200 {object} response.Response{ data=MonitorClientResp} "成功"
|
||||
// @Router /api/admin/monitor_client/detail [get]
|
||||
func (hd *MonitorClientHandler) Detail(c *gin.Context) {
|
||||
var detailReq MonitorClientDetailReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &detailReq)) {
|
||||
@@ -105,21 +105,21 @@ func (hd *MonitorClientHandler) Detail(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
}
|
||||
|
||||
// @Summary 监控-客户端信息新增
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param ProjectKey body string false "项目key"
|
||||
// @Param ClientId body string false "sdk生成的客户端id"
|
||||
// @Param UserId body string false "用户id"
|
||||
// @Param Os body string false "系统"
|
||||
// @Param Browser body string false "浏览器"
|
||||
// @Param City body string false "城市"
|
||||
// @Param Width body number false "屏幕"
|
||||
// @Param Height body number false "屏幕高度"
|
||||
// @Param Ua body string false "ua记录"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_client/add [post]
|
||||
// @Summary 监控-客户端信息新增
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param ProjectKey body string false "项目key"
|
||||
// @Param ClientId body string false "sdk生成的客户端id"
|
||||
// @Param UserId body string false "用户id"
|
||||
// @Param Os body string false "系统"
|
||||
// @Param Browser body string false "浏览器"
|
||||
// @Param City body string false "城市"
|
||||
// @Param Width body number false "屏幕"
|
||||
// @Param Height body number false "屏幕高度"
|
||||
// @Param Ua body string false "ua记录"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_client/add [post]
|
||||
func (hd *MonitorClientHandler) Add(c *gin.Context) {
|
||||
var addReq MonitorClientAddReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyJSON(c, &addReq)) {
|
||||
@@ -129,22 +129,22 @@ func (hd *MonitorClientHandler) Add(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, createId, e)
|
||||
}
|
||||
|
||||
// @Summary 监控-客户端信息编辑
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id body number false "uuid"
|
||||
// @Param ProjectKey body string false "项目key"
|
||||
// @Param ClientId body string false "sdk生成的客户端id"
|
||||
// @Param UserId body string false "用户id"
|
||||
// @Param Os body string false "系统"
|
||||
// @Param Browser body string false "浏览器"
|
||||
// @Param City body string false "城市"
|
||||
// @Param Width body number false "屏幕"
|
||||
// @Param Height body number false "屏幕高度"
|
||||
// @Param Ua body string false "ua记录"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_client/edit [post]
|
||||
// @Summary 监控-客户端信息编辑
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id body number false "uuid"
|
||||
// @Param ProjectKey body string false "项目key"
|
||||
// @Param ClientId body string false "sdk生成的客户端id"
|
||||
// @Param UserId body string false "用户id"
|
||||
// @Param Os body string false "系统"
|
||||
// @Param Browser body string false "浏览器"
|
||||
// @Param City body string false "城市"
|
||||
// @Param Width body number false "屏幕"
|
||||
// @Param Height body number false "屏幕高度"
|
||||
// @Param Ua body string false "ua记录"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_client/edit [post]
|
||||
// func (hd *MonitorClientHandler) Edit(c *gin.Context) {
|
||||
// var editReq MonitorClientEditReq
|
||||
// if response.IsFailWithResp(c, util.VerifyUtil.VerifyJSON(c, &editReq)) {
|
||||
@@ -153,13 +153,13 @@ func (hd *MonitorClientHandler) Add(c *gin.Context) {
|
||||
// response.CheckAndRespWithData(c, editReq.Id, MonitorClientService.Edit(editReq))
|
||||
// }
|
||||
|
||||
// @Summary 监控-客户端信息删除
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id body number false "uuid"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_client/del [post]
|
||||
// @Summary 监控-客户端信息删除
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id body number false "uuid"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_client/del [post]
|
||||
func (hd *MonitorClientHandler) Del(c *gin.Context) {
|
||||
var delReq MonitorClientDelReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyJSON(c, &delReq)) {
|
||||
@@ -171,11 +171,11 @@ func (hd *MonitorClientHandler) Del(c *gin.Context) {
|
||||
// @Summary 监控-客户端信息删除-批量
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
//
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Ids body string false "逗号分割的id"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_client/delBatch [post]
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Ids body string false "逗号分割的id"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_client/delBatch [post]
|
||||
func (hd *MonitorClientHandler) DelBatch(c *gin.Context) {
|
||||
var delReq MonitorClientDelBatchReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyJSON(c, &delReq)) {
|
||||
@@ -190,22 +190,22 @@ func (hd *MonitorClientHandler) DelBatch(c *gin.Context) {
|
||||
response.CheckAndResp(c, MonitorClientService.DelBatch(Ids))
|
||||
}
|
||||
|
||||
// @Summary 监控-客户端信息导出
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param ProjectKey query string false "项目key"
|
||||
// @Param ClientId query string false "sdk生成的客户端id"
|
||||
// @Param UserId query string false "用户id"
|
||||
// @Param Os query string false "系统"
|
||||
// @Param Browser query string false "浏览器"
|
||||
// @Param City query string false "城市"
|
||||
// @Param Width query number false "屏幕"
|
||||
// @Param Height query number false "屏幕高度"
|
||||
// @Param Ua query string false "ua记录"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Router /api/admin/monitor_client/ExportFile [get]
|
||||
// @Summary 监控-客户端信息导出
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param ProjectKey query string false "项目key"
|
||||
// @Param ClientId query string false "sdk生成的客户端id"
|
||||
// @Param UserId query string false "用户id"
|
||||
// @Param Os query string false "系统"
|
||||
// @Param Browser query string false "浏览器"
|
||||
// @Param City query string false "城市"
|
||||
// @Param Width query number false "屏幕"
|
||||
// @Param Height query number false "屏幕高度"
|
||||
// @Param Ua query string false "ua记录"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Router /api/admin/monitor_client/ExportFile [get]
|
||||
func (hd *MonitorClientHandler) ExportFile(c *gin.Context) {
|
||||
var listReq MonitorClientListReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &listReq)) {
|
||||
@@ -224,10 +224,10 @@ func (hd *MonitorClientHandler) ExportFile(c *gin.Context) {
|
||||
excel2.DownLoadExcel("监控-客户端信息"+time.Now().Format("20060102-150405"), c.Writer, f)
|
||||
}
|
||||
|
||||
// @Summary 监控-客户端信息导入
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
// @Router /api/admin/monitor_client/ImportFile [post]
|
||||
// @Summary 监控-客户端信息导入
|
||||
// @Tags monitor_client-监控-客户端信息
|
||||
// @Produce json
|
||||
// @Router /api/admin/monitor_client/ImportFile [post]
|
||||
func (hd *MonitorClientHandler) ImportFile(c *gin.Context) {
|
||||
file, _, err := c.Request.FormFile("file")
|
||||
if err != nil {
|
||||
|
||||
@@ -18,23 +18,23 @@ type MonitorErrorHandler struct {
|
||||
requestGroup singleflight.Group
|
||||
}
|
||||
|
||||
// @Summary 监控-错误列列表
|
||||
// @Tags monitor_error-监控-错误列
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param PageNo query int true "页码"
|
||||
// @Param PageSize query int true "每页数量"
|
||||
// @Param ProjectKey query string false "项目key"
|
||||
// @Param EventType query string false "事件类型"
|
||||
// @Param Path query string false "URL地址"
|
||||
// @Param Message query string false "错误消息"
|
||||
// @Param Stack query string false "错误堆栈"
|
||||
// @Param Md5 query string false "md5"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Summary 监控-错误列列表
|
||||
// @Tags monitor_error-监控-错误列
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param PageNo query int true "页码"
|
||||
// @Param PageSize query int true "每页数量"
|
||||
// @Param ProjectKey query string false "项目key"
|
||||
// @Param EventType query string false "事件类型"
|
||||
// @Param Path query string false "URL地址"
|
||||
// @Param Message query string false "错误消息"
|
||||
// @Param Stack query string false "错误堆栈"
|
||||
// @Param Md5 query string false "md5"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
//
|
||||
// @Success 200 {object} response.Response{ data=response.PageResp{ lists=[]MonitorErrorResp}} "成功"
|
||||
// @Router /api/admin/monitor_error/list [get]
|
||||
// @Success 200 {object} response.Response{ data=response.PageResp{ lists=[]MonitorErrorResp}} "成功"
|
||||
// @Router /api/admin/monitor_error/list [get]
|
||||
func (hd *MonitorErrorHandler) List(c *gin.Context) {
|
||||
var page request.PageReq
|
||||
var listReq MonitorErrorListReq
|
||||
@@ -48,19 +48,19 @@ func (hd *MonitorErrorHandler) List(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
}
|
||||
|
||||
// @Summary 监控-错误列列表-所有
|
||||
// @Tags monitor_error-监控-错误列
|
||||
// @Produce json
|
||||
// @Param ProjectKey query string false "项目key"
|
||||
// @Param EventType query string false "事件类型"
|
||||
// @Param Path query string false "URL地址"
|
||||
// @Param Message query string false "错误消息"
|
||||
// @Param Stack query string false "错误堆栈"
|
||||
// @Param Md5 query string false "md5"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Success 200 {object} response.Response{ data=[]MonitorErrorResp} "成功"
|
||||
// @Router /api/admin/monitor_error/listAll [get]
|
||||
// @Summary 监控-错误列列表-所有
|
||||
// @Tags monitor_error-监控-错误列
|
||||
// @Produce json
|
||||
// @Param ProjectKey query string false "项目key"
|
||||
// @Param EventType query string false "事件类型"
|
||||
// @Param Path query string false "URL地址"
|
||||
// @Param Message query string false "错误消息"
|
||||
// @Param Stack query string false "错误堆栈"
|
||||
// @Param Md5 query string false "md5"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Success 200 {object} response.Response{ data=[]MonitorErrorResp} "成功"
|
||||
// @Router /api/admin/monitor_error/listAll [get]
|
||||
func (hd *MonitorErrorHandler) ListAll(c *gin.Context) {
|
||||
var listReq MonitorErrorListReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &listReq)) {
|
||||
@@ -70,13 +70,13 @@ func (hd *MonitorErrorHandler) ListAll(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
}
|
||||
|
||||
// @Summary 监控-错误列详情
|
||||
// @Tags monitor_error-监控-错误列
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id query number false "错误id"
|
||||
// @Success 200 {object} response.Response{ data=MonitorErrorResp} "成功"
|
||||
// @Router /api/admin/monitor_error/detail [get]
|
||||
// @Summary 监控-错误列详情
|
||||
// @Tags monitor_error-监控-错误列
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id query number false "错误id"
|
||||
// @Success 200 {object} response.Response{ data=MonitorErrorResp} "成功"
|
||||
// @Router /api/admin/monitor_error/detail [get]
|
||||
func (hd *MonitorErrorHandler) Detail(c *gin.Context) {
|
||||
var detailReq MonitorErrorDetailReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &detailReq)) {
|
||||
@@ -90,18 +90,18 @@ func (hd *MonitorErrorHandler) Detail(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
}
|
||||
|
||||
// @Summary 监控-错误列新增
|
||||
// @Tags monitor_error-监控-错误列
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param ProjectKey body string false "项目key"
|
||||
// @Param EventType body string false "事件类型"
|
||||
// @Param Path body string false "URL地址"
|
||||
// @Param Message body string false "错误消息"
|
||||
// @Param Stack body string false "错误堆栈"
|
||||
// @Param Md5 body string false "md5"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_error/add [post]
|
||||
// @Summary 监控-错误列新增
|
||||
// @Tags monitor_error-监控-错误列
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param ProjectKey body string false "项目key"
|
||||
// @Param EventType body string false "事件类型"
|
||||
// @Param Path body string false "URL地址"
|
||||
// @Param Message body string false "错误消息"
|
||||
// @Param Stack body string false "错误堆栈"
|
||||
// @Param Md5 body string false "md5"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_error/add [post]
|
||||
func (hd *MonitorErrorHandler) Add(c *gin.Context) {
|
||||
var addReq MonitorErrorAddReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyJSON(c, &addReq)) {
|
||||
@@ -111,13 +111,13 @@ func (hd *MonitorErrorHandler) Add(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, createId, e)
|
||||
}
|
||||
|
||||
// @Summary 监控-错误列删除
|
||||
// @Tags monitor_error-监控-错误列
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id body number false "错误id"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_error/del [post]
|
||||
// @Summary 监控-错误列删除
|
||||
// @Tags monitor_error-监控-错误列
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id body number false "错误id"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_error/del [post]
|
||||
func (hd *MonitorErrorHandler) Del(c *gin.Context) {
|
||||
var delReq MonitorErrorDelReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyJSON(c, &delReq)) {
|
||||
@@ -129,11 +129,11 @@ func (hd *MonitorErrorHandler) Del(c *gin.Context) {
|
||||
// @Summary 监控-错误列删除-批量
|
||||
// @Tags monitor_error-监控-错误列
|
||||
//
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Ids body string false "逗号分割的id"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_error/delBatch [post]
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Ids body string false "逗号分割的id"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_error/delBatch [post]
|
||||
func (hd *MonitorErrorHandler) DelBatch(c *gin.Context) {
|
||||
var delReq MonitorErrorDelBatchReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyJSON(c, &delReq)) {
|
||||
@@ -148,19 +148,19 @@ func (hd *MonitorErrorHandler) DelBatch(c *gin.Context) {
|
||||
response.CheckAndResp(c, MonitorErrorService.DelBatch(Ids))
|
||||
}
|
||||
|
||||
// @Summary 监控-错误列导出
|
||||
// @Tags monitor_error-监控-错误列
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param ProjectKey query string false "项目key"
|
||||
// @Param EventType query string false "事件类型"
|
||||
// @Param Path query string false "URL地址"
|
||||
// @Param Message query string false "错误消息"
|
||||
// @Param Stack query string false "错误堆栈"
|
||||
// @Param Md5 query string false "md5"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Router /api/admin/monitor_error/ExportFile [get]
|
||||
// @Summary 监控-错误列导出
|
||||
// @Tags monitor_error-监控-错误列
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param ProjectKey query string false "项目key"
|
||||
// @Param EventType query string false "事件类型"
|
||||
// @Param Path query string false "URL地址"
|
||||
// @Param Message query string false "错误消息"
|
||||
// @Param Stack query string false "错误堆栈"
|
||||
// @Param Md5 query string false "md5"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Router /api/admin/monitor_error/ExportFile [get]
|
||||
func (hd *MonitorErrorHandler) ExportFile(c *gin.Context) {
|
||||
var listReq MonitorErrorListReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &listReq)) {
|
||||
@@ -179,10 +179,10 @@ func (hd *MonitorErrorHandler) ExportFile(c *gin.Context) {
|
||||
excel2.DownLoadExcel("监控-错误列"+time.Now().Format("20060102-150405"), c.Writer, f)
|
||||
}
|
||||
|
||||
// @Summary 监控-错误列导入
|
||||
// @Tags monitor_error-监控-错误列
|
||||
// @Produce json
|
||||
// @Router /api/admin/monitor_error/ImportFile [post]
|
||||
// @Summary 监控-错误列导入
|
||||
// @Tags monitor_error-监控-错误列
|
||||
// @Produce json
|
||||
// @Router /api/admin/monitor_error/ImportFile [post]
|
||||
func (hd *MonitorErrorHandler) ImportFile(c *gin.Context) {
|
||||
file, _, err := c.Request.FormFile("file")
|
||||
if err != nil {
|
||||
|
||||
@@ -18,23 +18,23 @@ type MonitorProjectHandler struct {
|
||||
requestGroup singleflight.Group
|
||||
}
|
||||
|
||||
// @Summary 监控项目列表
|
||||
// @Tags monitor_project-监控项目
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param PageNo query int true "页码"
|
||||
// @Param PageSize query int true "每页数量"
|
||||
// @Param ProjectKey query string false "项目uuid"
|
||||
// @Param ProjectName query string false "项目名称"
|
||||
// @Param ProjectType query string false "项目类型go java web node php 等"
|
||||
// @Param Status query number false "是否启用: 0=否, 1=是"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Param UpdateTimeStart query string false "更新时间"
|
||||
// @Param UpdateTimeEnd query string false "更新时间"
|
||||
// @Summary 监控项目列表
|
||||
// @Tags monitor_project-监控项目
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param PageNo query int true "页码"
|
||||
// @Param PageSize query int true "每页数量"
|
||||
// @Param ProjectKey query string false "项目uuid"
|
||||
// @Param ProjectName query string false "项目名称"
|
||||
// @Param ProjectType query string false "项目类型go java web node php 等"
|
||||
// @Param Status query number false "是否启用: 0=否, 1=是"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Param UpdateTimeStart query string false "更新时间"
|
||||
// @Param UpdateTimeEnd query string false "更新时间"
|
||||
//
|
||||
// @Success 200 {object} response.Response{ data=response.PageResp{ lists=[]MonitorProjectResp}} "成功"
|
||||
// @Router /api/admin/monitor_project/list [get]
|
||||
// @Success 200 {object} response.Response{ data=response.PageResp{ lists=[]MonitorProjectResp}} "成功"
|
||||
// @Router /api/admin/monitor_project/list [get]
|
||||
func (hd *MonitorProjectHandler) List(c *gin.Context) {
|
||||
var page request.PageReq
|
||||
var listReq MonitorProjectListReq
|
||||
@@ -48,19 +48,19 @@ func (hd *MonitorProjectHandler) List(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
}
|
||||
|
||||
// @Summary 监控项目列表-所有
|
||||
// @Tags monitor_project-监控项目
|
||||
// @Produce json
|
||||
// @Param ProjectKey query string false "项目uuid"
|
||||
// @Param ProjectName query string false "项目名称"
|
||||
// @Param ProjectType query string false "项目类型go java web node php 等"
|
||||
// @Param Status query number false "是否启用: 0=否, 1=是"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Param UpdateTimeStart query string false "更新时间"
|
||||
// @Param UpdateTimeEnd query string false "更新时间"
|
||||
// @Success 200 {object} response.Response{ data=[]MonitorProjectResp} "成功"
|
||||
// @Router /api/admin/monitor_project/listAll [get]
|
||||
// @Summary 监控项目列表-所有
|
||||
// @Tags monitor_project-监控项目
|
||||
// @Produce json
|
||||
// @Param ProjectKey query string false "项目uuid"
|
||||
// @Param ProjectName query string false "项目名称"
|
||||
// @Param ProjectType query string false "项目类型go java web node php 等"
|
||||
// @Param Status query number false "是否启用: 0=否, 1=是"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Param UpdateTimeStart query string false "更新时间"
|
||||
// @Param UpdateTimeEnd query string false "更新时间"
|
||||
// @Success 200 {object} response.Response{ data=[]MonitorProjectResp} "成功"
|
||||
// @Router /api/admin/monitor_project/listAll [get]
|
||||
func (hd *MonitorProjectHandler) ListAll(c *gin.Context) {
|
||||
var listReq MonitorProjectListReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &listReq)) {
|
||||
@@ -70,13 +70,13 @@ func (hd *MonitorProjectHandler) ListAll(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
}
|
||||
|
||||
// @Summary 监控项目详情
|
||||
// @Tags monitor_project-监控项目
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id query number false "项目id"
|
||||
// @Success 200 {object} response.Response{ data=MonitorProjectResp} "成功"
|
||||
// @Router /api/admin/monitor_project/detail [get]
|
||||
// @Summary 监控项目详情
|
||||
// @Tags monitor_project-监控项目
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id query number false "项目id"
|
||||
// @Success 200 {object} response.Response{ data=MonitorProjectResp} "成功"
|
||||
// @Router /api/admin/monitor_project/detail [get]
|
||||
func (hd *MonitorProjectHandler) Detail(c *gin.Context) {
|
||||
var detailReq MonitorProjectDetailReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &detailReq)) {
|
||||
@@ -90,16 +90,16 @@ func (hd *MonitorProjectHandler) Detail(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
}
|
||||
|
||||
// @Summary 监控项目新增
|
||||
// @Tags monitor_project-监控项目
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param ProjectKey body string false "项目uuid"
|
||||
// @Param ProjectName body string false "项目名称"
|
||||
// @Param ProjectType body string false "项目类型go java web node php 等"
|
||||
// @Param Status body number false "是否启用: 0=否, 1=是"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_project/add [post]
|
||||
// @Summary 监控项目新增
|
||||
// @Tags monitor_project-监控项目
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param ProjectKey body string false "项目uuid"
|
||||
// @Param ProjectName body string false "项目名称"
|
||||
// @Param ProjectType body string false "项目类型go java web node php 等"
|
||||
// @Param Status body number false "是否启用: 0=否, 1=是"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_project/add [post]
|
||||
func (hd *MonitorProjectHandler) Add(c *gin.Context) {
|
||||
var addReq MonitorProjectAddReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyJSON(c, &addReq)) {
|
||||
@@ -109,17 +109,17 @@ func (hd *MonitorProjectHandler) Add(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, createId, e)
|
||||
}
|
||||
|
||||
// @Summary 监控项目编辑
|
||||
// @Tags monitor_project-监控项目
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id body number false "项目id"
|
||||
// @Param ProjectKey body string false "项目uuid"
|
||||
// @Param ProjectName body string false "项目名称"
|
||||
// @Param ProjectType body string false "项目类型go java web node php 等"
|
||||
// @Param Status body number false "是否启用: 0=否, 1=是"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_project/edit [post]
|
||||
// @Summary 监控项目编辑
|
||||
// @Tags monitor_project-监控项目
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id body number false "项目id"
|
||||
// @Param ProjectKey body string false "项目uuid"
|
||||
// @Param ProjectName body string false "项目名称"
|
||||
// @Param ProjectType body string false "项目类型go java web node php 等"
|
||||
// @Param Status body number false "是否启用: 0=否, 1=是"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_project/edit [post]
|
||||
func (hd *MonitorProjectHandler) Edit(c *gin.Context) {
|
||||
var editReq MonitorProjectEditReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyJSON(c, &editReq)) {
|
||||
@@ -128,13 +128,13 @@ func (hd *MonitorProjectHandler) Edit(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, editReq.Id, MonitorProjectService.Edit(editReq))
|
||||
}
|
||||
|
||||
// @Summary 监控项目删除
|
||||
// @Tags monitor_project-监控项目
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id body number false "项目id"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_project/del [post]
|
||||
// @Summary 监控项目删除
|
||||
// @Tags monitor_project-监控项目
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id body number false "项目id"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_project/del [post]
|
||||
func (hd *MonitorProjectHandler) Del(c *gin.Context) {
|
||||
var delReq MonitorProjectDelReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyJSON(c, &delReq)) {
|
||||
@@ -146,11 +146,11 @@ func (hd *MonitorProjectHandler) Del(c *gin.Context) {
|
||||
// @Summary 监控项目删除-批量
|
||||
// @Tags monitor_project-监控项目
|
||||
//
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Ids body string false "逗号分割的id"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_project/delBatch [post]
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Ids body string false "逗号分割的id"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/monitor_project/delBatch [post]
|
||||
func (hd *MonitorProjectHandler) DelBatch(c *gin.Context) {
|
||||
var delReq MonitorProjectDelBatchReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyJSON(c, &delReq)) {
|
||||
@@ -165,19 +165,19 @@ func (hd *MonitorProjectHandler) DelBatch(c *gin.Context) {
|
||||
response.CheckAndResp(c, MonitorProjectService.DelBatch(Ids))
|
||||
}
|
||||
|
||||
// @Summary 监控项目导出
|
||||
// @Tags monitor_project-监控项目
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param ProjectKey query string false "项目uuid"
|
||||
// @Param ProjectName query string false "项目名称"
|
||||
// @Param ProjectType query string false "项目类型go java web node php 等"
|
||||
// @Param Status query number false "是否启用: 0=否, 1=是"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Param UpdateTimeStart query string false "更新时间"
|
||||
// @Param UpdateTimeEnd query string false "更新时间"
|
||||
// @Router /api/admin/monitor_project/ExportFile [get]
|
||||
// @Summary 监控项目导出
|
||||
// @Tags monitor_project-监控项目
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param ProjectKey query string false "项目uuid"
|
||||
// @Param ProjectName query string false "项目名称"
|
||||
// @Param ProjectType query string false "项目类型go java web node php 等"
|
||||
// @Param Status query number false "是否启用: 0=否, 1=是"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Param UpdateTimeStart query string false "更新时间"
|
||||
// @Param UpdateTimeEnd query string false "更新时间"
|
||||
// @Router /api/admin/monitor_project/ExportFile [get]
|
||||
func (hd *MonitorProjectHandler) ExportFile(c *gin.Context) {
|
||||
var listReq MonitorProjectListReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &listReq)) {
|
||||
@@ -196,10 +196,10 @@ func (hd *MonitorProjectHandler) ExportFile(c *gin.Context) {
|
||||
excel2.DownLoadExcel("监控项目"+time.Now().Format("20060102-150405"), c.Writer, f)
|
||||
}
|
||||
|
||||
// @Summary 监控项目导入
|
||||
// @Tags monitor_project-监控项目
|
||||
// @Produce json
|
||||
// @Router /api/admin/monitor_project/ImportFile [post]
|
||||
// @Summary 监控项目导入
|
||||
// @Tags monitor_project-监控项目
|
||||
// @Produce json
|
||||
// @Router /api/admin/monitor_project/ImportFile [post]
|
||||
func (hd *MonitorProjectHandler) ImportFile(c *gin.Context) {
|
||||
file, _, err := c.Request.FormFile("file")
|
||||
if err != nil {
|
||||
|
||||
@@ -18,22 +18,22 @@ type UserProtocolHandler struct {
|
||||
requestGroup singleflight.Group
|
||||
}
|
||||
|
||||
// @Summary 用户协议列表
|
||||
// @Tags user_protocol-用户协议
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param PageNo query int true "页码"
|
||||
// @Param PageSize query int true "每页数量"
|
||||
// @Param Title query string false "标题"
|
||||
// @Param Content query string false "协议内容"
|
||||
// @Param Sort query number false "排序"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Param UpdateTimeStart query string false "更新时间"
|
||||
// @Param UpdateTimeEnd query string false "更新时间"
|
||||
// @Summary 用户协议列表
|
||||
// @Tags user_protocol-用户协议
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param PageNo query int true "页码"
|
||||
// @Param PageSize query int true "每页数量"
|
||||
// @Param Title query string false "标题"
|
||||
// @Param Content query string false "协议内容"
|
||||
// @Param Sort query number false "排序"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Param UpdateTimeStart query string false "更新时间"
|
||||
// @Param UpdateTimeEnd query string false "更新时间"
|
||||
//
|
||||
// @Success 200 {object} response.Response{ data=response.PageResp{ lists=[]UserProtocolResp}} "成功"
|
||||
// @Router /api/admin/user_protocol/list [get]
|
||||
// @Success 200 {object} response.Response{ data=response.PageResp{ lists=[]UserProtocolResp}} "成功"
|
||||
// @Router /api/admin/user_protocol/list [get]
|
||||
func (hd *UserProtocolHandler) List(c *gin.Context) {
|
||||
var page request.PageReq
|
||||
var listReq UserProtocolListReq
|
||||
@@ -47,18 +47,18 @@ func (hd *UserProtocolHandler) List(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
}
|
||||
|
||||
// @Summary 用户协议列表-所有
|
||||
// @Tags user_protocol-用户协议
|
||||
// @Produce json
|
||||
// @Param Title query string false "标题"
|
||||
// @Param Content query string false "协议内容"
|
||||
// @Param Sort query number false "排序"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Param UpdateTimeStart query string false "更新时间"
|
||||
// @Param UpdateTimeEnd query string false "更新时间"
|
||||
// @Success 200 {object} response.Response{ data=[]UserProtocolResp} "成功"
|
||||
// @Router /api/admin/user_protocol/listAll [get]
|
||||
// @Summary 用户协议列表-所有
|
||||
// @Tags user_protocol-用户协议
|
||||
// @Produce json
|
||||
// @Param Title query string false "标题"
|
||||
// @Param Content query string false "协议内容"
|
||||
// @Param Sort query number false "排序"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Param UpdateTimeStart query string false "更新时间"
|
||||
// @Param UpdateTimeEnd query string false "更新时间"
|
||||
// @Success 200 {object} response.Response{ data=[]UserProtocolResp} "成功"
|
||||
// @Router /api/admin/user_protocol/listAll [get]
|
||||
func (hd *UserProtocolHandler) ListAll(c *gin.Context) {
|
||||
var listReq UserProtocolListReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &listReq)) {
|
||||
@@ -68,13 +68,13 @@ func (hd *UserProtocolHandler) ListAll(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
}
|
||||
|
||||
// @Summary 用户协议详情
|
||||
// @Tags user_protocol-用户协议
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id query number false ""
|
||||
// @Success 200 {object} response.Response{ data=UserProtocolResp} "成功"
|
||||
// @Router /api/admin/user_protocol/detail [get]
|
||||
// @Summary 用户协议详情
|
||||
// @Tags user_protocol-用户协议
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id query number false ""
|
||||
// @Success 200 {object} response.Response{ data=UserProtocolResp} "成功"
|
||||
// @Router /api/admin/user_protocol/detail [get]
|
||||
func (hd *UserProtocolHandler) Detail(c *gin.Context) {
|
||||
var detailReq UserProtocolDetailReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &detailReq)) {
|
||||
@@ -88,15 +88,15 @@ func (hd *UserProtocolHandler) Detail(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
}
|
||||
|
||||
// @Summary 用户协议新增
|
||||
// @Tags user_protocol-用户协议
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Title body string false "标题"
|
||||
// @Param Content body string false "协议内容"
|
||||
// @Param Sort body number false "排序"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/user_protocol/add [post]
|
||||
// @Summary 用户协议新增
|
||||
// @Tags user_protocol-用户协议
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Title body string false "标题"
|
||||
// @Param Content body string false "协议内容"
|
||||
// @Param Sort body number false "排序"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/user_protocol/add [post]
|
||||
func (hd *UserProtocolHandler) Add(c *gin.Context) {
|
||||
var addReq UserProtocolAddReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyJSON(c, &addReq)) {
|
||||
@@ -106,16 +106,16 @@ func (hd *UserProtocolHandler) Add(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, createId, e)
|
||||
}
|
||||
|
||||
// @Summary 用户协议编辑
|
||||
// @Tags user_protocol-用户协议
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id body number false ""
|
||||
// @Param Title body string false "标题"
|
||||
// @Param Content body string false "协议内容"
|
||||
// @Param Sort body number false "排序"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/user_protocol/edit [post]
|
||||
// @Summary 用户协议编辑
|
||||
// @Tags user_protocol-用户协议
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id body number false ""
|
||||
// @Param Title body string false "标题"
|
||||
// @Param Content body string false "协议内容"
|
||||
// @Param Sort body number false "排序"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/user_protocol/edit [post]
|
||||
func (hd *UserProtocolHandler) Edit(c *gin.Context) {
|
||||
var editReq UserProtocolEditReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyJSON(c, &editReq)) {
|
||||
@@ -124,13 +124,13 @@ func (hd *UserProtocolHandler) Edit(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, editReq.Id, UserProtocolService.Edit(editReq))
|
||||
}
|
||||
|
||||
// @Summary 用户协议删除
|
||||
// @Tags user_protocol-用户协议
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id body number false ""
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/user_protocol/del [post]
|
||||
// @Summary 用户协议删除
|
||||
// @Tags user_protocol-用户协议
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Id body number false ""
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/user_protocol/del [post]
|
||||
func (hd *UserProtocolHandler) Del(c *gin.Context) {
|
||||
var delReq UserProtocolDelReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyJSON(c, &delReq)) {
|
||||
@@ -142,11 +142,11 @@ func (hd *UserProtocolHandler) Del(c *gin.Context) {
|
||||
// @Summary 用户协议删除-批量
|
||||
// @Tags user_protocol-用户协议
|
||||
//
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Ids body string false "逗号分割的id"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/user_protocol/delBatch [post]
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Ids body string false "逗号分割的id"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/user_protocol/delBatch [post]
|
||||
func (hd *UserProtocolHandler) DelBatch(c *gin.Context) {
|
||||
var delReq UserProtocolDelBatchReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyJSON(c, &delReq)) {
|
||||
@@ -161,18 +161,18 @@ func (hd *UserProtocolHandler) DelBatch(c *gin.Context) {
|
||||
response.CheckAndResp(c, UserProtocolService.DelBatch(Ids))
|
||||
}
|
||||
|
||||
// @Summary 用户协议导出
|
||||
// @Tags user_protocol-用户协议
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Title query string false "标题"
|
||||
// @Param Content query string false "协议内容"
|
||||
// @Param Sort query number false "排序"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Param UpdateTimeStart query string false "更新时间"
|
||||
// @Param UpdateTimeEnd query string false "更新时间"
|
||||
// @Router /api/admin/user_protocol/ExportFile [get]
|
||||
// @Summary 用户协议导出
|
||||
// @Tags user_protocol-用户协议
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param Title query string false "标题"
|
||||
// @Param Content query string false "协议内容"
|
||||
// @Param Sort query number false "排序"
|
||||
// @Param CreateTimeStart query string false "创建时间"
|
||||
// @Param CreateTimeEnd query string false "创建时间"
|
||||
// @Param UpdateTimeStart query string false "更新时间"
|
||||
// @Param UpdateTimeEnd query string false "更新时间"
|
||||
// @Router /api/admin/user_protocol/ExportFile [get]
|
||||
func (hd *UserProtocolHandler) ExportFile(c *gin.Context) {
|
||||
var listReq UserProtocolListReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &listReq)) {
|
||||
@@ -191,10 +191,10 @@ func (hd *UserProtocolHandler) ExportFile(c *gin.Context) {
|
||||
excel2.DownLoadExcel("用户协议"+time.Now().Format("20060102-150405"), c.Writer, f)
|
||||
}
|
||||
|
||||
// @Summary 用户协议导入
|
||||
// @Tags user_protocol-用户协议
|
||||
// @Produce json
|
||||
// @Router /api/admin/user_protocol/ImportFile [post]
|
||||
// @Summary 用户协议导入
|
||||
// @Tags user_protocol-用户协议
|
||||
// @Produce json
|
||||
// @Router /api/admin/user_protocol/ImportFile [post]
|
||||
func (hd *UserProtocolHandler) ImportFile(c *gin.Context) {
|
||||
file, _, err := c.Request.FormFile("file")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user