swagger文档优化,数据库文档优化
parent
1874d3ed26
commit
bd22395eaf
@ -1,30 +1,38 @@
|
||||
<?xml version="1.0"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
|
||||
<groupId>com.zyplayer</groupId>
|
||||
<artifactId>zyplayer-doc-core</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<name>zyplayer-doc-core</name>
|
||||
|
||||
|
||||
<url>http://maven.apache.org</url>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis-spring</artifactId>
|
||||
<version>1.3.2</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
<version>3.4.6</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@ -1,67 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zyplayer.doc.db.framework.db.mapper.base.BaseMapper">
|
||||
|
||||
<resultMap id="TableColumnDescDtoMap" type="com.zyplayer.doc.db.framework.db.dto.TableColumnDescDto" >
|
||||
<result column="NAME" property="name" jdbcType="VARCHAR" />
|
||||
<result column="ISIDENITY" property="isidenity" jdbcType="VARCHAR" />
|
||||
<result column="TYPE" property="type" jdbcType="VARCHAR" />
|
||||
<result column="NULLABLE" property="nullable" jdbcType="VARCHAR" />
|
||||
<result column="LENGTH" property="length" jdbcType="VARCHAR" />
|
||||
<result column="ISPRAMARY" property="ispramary" jdbcType="VARCHAR" />
|
||||
<result column="DESCRIPTION" property="description" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="QueryTableColumnDescDtoMap" type="com.zyplayer.doc.db.framework.db.dto.QueryTableColumnDescDto" >
|
||||
<result column="TABLE_NAME" property="tableName" jdbcType="VARCHAR" />
|
||||
<result column="COLUMN_NAME" property="columnName" jdbcType="VARCHAR" />
|
||||
<result column="DESCRIPTION" property="description" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<select id="getDatabaseList" resultType="com.zyplayer.doc.db.framework.db.dto.DatabaseInfoDto">
|
||||
select TABLE_SCHEMA dbName
|
||||
from information_schema.tables
|
||||
group by TABLE_SCHEMA
|
||||
</select>
|
||||
|
||||
<select id="getTableList" resultType="com.zyplayer.doc.db.framework.db.dto.TableInfoDto">
|
||||
select table_name tableName, table_comment as tableComment
|
||||
from information_schema.tables
|
||||
where table_schema=#{dbName}
|
||||
</select>
|
||||
|
||||
<select id="getTableColumnList" resultMap="TableColumnDescDtoMap">
|
||||
SELECT COLUMN_NAME NAME,column_comment DESCRIPTION,column_type TYPE,if(is_nullable='YES',1,0) NULLABLE
|
||||
FROM INFORMATION_SCHEMA.Columns
|
||||
WHERE table_schema=#{dbName} AND table_name=#{tableName}
|
||||
</select>
|
||||
|
||||
<select id="getTableColumnDescList" resultMap="TableColumnDescDtoMap">
|
||||
select 1
|
||||
</select>
|
||||
|
||||
<select id="getTableAndColumnBySearch" resultMap="QueryTableColumnDescDtoMap">
|
||||
SELECT TABLE_NAME, COLUMN_NAME, column_comment DESCRIPTION
|
||||
FROM INFORMATION_SCHEMA.Columns
|
||||
WHERE table_schema=#{dbName} AND (COLUMN_NAME like #{searchText} or column_comment like #{searchText})
|
||||
</select>
|
||||
|
||||
<select id="getTableDescList" resultType="com.zyplayer.doc.db.framework.db.dto.TableDescDto">
|
||||
select table_name tableName, table_comment as description
|
||||
from information_schema.tables
|
||||
<if test="tableName != null">
|
||||
where table_name=#{tableName}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="updateTableDesc">
|
||||
alter table ${dbName}.${tableName} comment #{newDesc}
|
||||
</insert>
|
||||
|
||||
<insert id="updateTableColumnDesc">
|
||||
alter table ${dbName}.${tableName} modify column ${columnName}
|
||||
${columnInfo.columnType} ${columnInfo.isNullable} ${columnInfo.columnDefault} ${columnInfo.extra}
|
||||
comment #{newDesc}
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zyplayer.doc.db.framework.db.mapper.base.BaseMapper">
|
||||
|
||||
<resultMap id="TableColumnDescDtoMap" type="com.zyplayer.doc.db.framework.db.dto.TableColumnDescDto" >
|
||||
<result column="NAME" property="name" jdbcType="VARCHAR" />
|
||||
<result column="ISIDENITY" property="isidenity" jdbcType="VARCHAR" />
|
||||
<result column="TYPE" property="type" jdbcType="VARCHAR" />
|
||||
<result column="NULLABLE" property="nullable" jdbcType="VARCHAR" />
|
||||
<result column="LENGTH" property="length" jdbcType="VARCHAR" />
|
||||
<result column="ISPRAMARY" property="ispramary" jdbcType="VARCHAR" />
|
||||
<result column="DESCRIPTION" property="description" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="QueryTableColumnDescDtoMap" type="com.zyplayer.doc.db.framework.db.dto.QueryTableColumnDescDto" >
|
||||
<result column="TABLE_NAME" property="tableName" jdbcType="VARCHAR" />
|
||||
<result column="COLUMN_NAME" property="columnName" jdbcType="VARCHAR" />
|
||||
<result column="DESCRIPTION" property="description" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<select id="getDatabaseList" resultType="com.zyplayer.doc.db.framework.db.dto.DatabaseInfoDto">
|
||||
select TABLE_SCHEMA dbName
|
||||
from information_schema.tables
|
||||
group by TABLE_SCHEMA
|
||||
</select>
|
||||
|
||||
<select id="getTableList" resultType="com.zyplayer.doc.db.framework.db.dto.TableInfoDto">
|
||||
select table_name tableName, table_comment as tableComment
|
||||
from information_schema.tables
|
||||
where table_schema=#{dbName}
|
||||
</select>
|
||||
|
||||
<select id="getTableColumnList" resultMap="TableColumnDescDtoMap">
|
||||
SELECT COLUMN_NAME NAME,column_comment DESCRIPTION,column_type TYPE,if(is_nullable='YES',1,0) NULLABLE
|
||||
FROM INFORMATION_SCHEMA.Columns
|
||||
WHERE table_schema=#{dbName} AND table_name=#{tableName}
|
||||
ORDER BY ordinal_position
|
||||
</select>
|
||||
|
||||
<select id="getTableColumnDescList" resultMap="TableColumnDescDtoMap">
|
||||
select 1
|
||||
</select>
|
||||
|
||||
<select id="getTableAndColumnBySearch" resultMap="QueryTableColumnDescDtoMap">
|
||||
SELECT TABLE_NAME, COLUMN_NAME, column_comment DESCRIPTION
|
||||
FROM INFORMATION_SCHEMA.Columns
|
||||
WHERE table_schema=#{dbName} AND (COLUMN_NAME like #{searchText} or column_comment like #{searchText})
|
||||
</select>
|
||||
|
||||
<select id="getTableDescList" resultType="com.zyplayer.doc.db.framework.db.dto.TableDescDto">
|
||||
select table_name tableName, table_comment as description
|
||||
from information_schema.tables
|
||||
<if test="tableName != null">
|
||||
where table_name=#{tableName}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="updateTableDesc">
|
||||
alter table ${dbName}.${tableName} comment #{newDesc}
|
||||
</insert>
|
||||
|
||||
<insert id="updateTableColumnDesc">
|
||||
alter table ${dbName}.${tableName} modify column ${columnName}
|
||||
${columnInfo.columnType} ${columnInfo.isNullable} ${columnInfo.columnDefault} ${columnInfo.extra}
|
||||
comment #{newDesc}
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
@ -0,0 +1,40 @@
|
||||
<!doctype html>
|
||||
<html xmlns:v-on="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>操作日志</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../lib/zui/css/zui.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
操作日志,暂未开发
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script src="../../lib/jquery/jquery-3.1.0.min.js"></script>
|
||||
<script src="../../lib/zui/js/zui.min.js"></script>
|
||||
<script src="../../lib/vue/vue.js"></script>
|
||||
<script src="../../lib/mg/js/common.js"></script>
|
||||
<script src="../../lib/mg/js/toast.js"></script>
|
||||
|
||||
<script>
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
},
|
||||
mounted: function(){
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body{padding: 10px;}
|
||||
</style>
|
||||
</html>
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue