diff --git a/design/schema/.gitignore b/design/schema/.gitignore deleted file mode 100644 index d35f24c5..00000000 --- a/design/schema/.gitignore +++ /dev/null @@ -1,37 +0,0 @@ -.vscode -*.swp -*.swo -*.sublime-* -*.pyc -jmeter.log -__pycache__ -tmp/ -package-lock.json -node_modules/ -sftp-config.json -.DS_Store -*.iml -*.ipr -*.iws -*.idea -~$*.xls* -~$*.ppt* -~$*.doc* -nohup.out - -CMakeLists.txt.user -CMakeCache.txt -CMakeFiles -CMakeScripts -Testing -Makefile -build -build-* -cmake_install.cmake -install_manifest.txt -compile_commands.json -CTestTestfile.cmake -_deps -.env -.fid -_build diff --git a/design/schema/README.md b/design/schema/README.md deleted file mode 100644 index 41a876b6..00000000 --- a/design/schema/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# 数据字典 - -生成春松客服数据库数据字典。 - -## Prerequisite - -* Php -* pandoc - -## Generate - -``` -cp sample.env .env -./bin/gen-mysql-table-dicts.sh -``` \ No newline at end of file diff --git a/design/schema/app/generator.php b/design/schema/app/generator.php deleted file mode 100644 index 8f85bc00..00000000 --- a/design/schema/app/generator.php +++ /dev/null @@ -1,123 +0,0 @@ - $v){ - $sql = 'SELECT * FROM '; - $sql .= 'INFORMATION_SCHEMA.TABLES '; - $sql .= 'WHERE '; - $sql .= "table_name = '{$v['TABLE_NAME']}' AND table_schema = '".DB_NAME."'"; - $table_result = mysqli_query($conn, $sql); - while($t = mysqli_fetch_array($table_result)) { - $tables [$k] ['TABLE_COMMENT'] = $t ['TABLE_COMMENT']; - } - - $sql = 'SELECT * FROM '; - $sql .= 'INFORMATION_SCHEMA.COLUMNS '; - $sql .= 'WHERE '; - $sql .= "table_name = '{$v['TABLE_NAME']}' AND table_schema = '".DB_NAME."'"; - - $fields = array(); - $field_result = mysqli_query($conn, $sql); - while($t = mysqli_fetch_array($field_result)) { - $fields [] = $t; - } - $tables [$k] ['COLUMN'] = $fields; -} -mysqli_close($conn); - -$content = ''; -// 循环所有表 -foreach($tables as $k => $v){ - $content .= '

'. $v['TABLE_NAME'] . ' 

'; - $content .= ''; - $content .= ''; - $content .= ' - - '; - $content .= ''; - - foreach($v ['COLUMN'] as $f){ - $content .= ''; - $content .= ''; - $content .= ''; - $content .= ''; - $content .= ''; - $content .= ''; - $content .= ''; - } - $content .= '
' . ' ' . $v ['TABLE_COMMENT'] . '
字段名数据类型默认值允许非空自动递增备注
' . $f ['COLUMN_NAME'] . '' . $f ['COLUMN_TYPE'] . ' ' . $f ['COLUMN_DEFAULT'] . ' ' . $f ['IS_NULLABLE'] . '' . ($f ['EXTRA'] == 'auto_increment' ? '是' : ' ') . ' ' . $f ['COLUMN_COMMENT'] . '

'; -} - -// 输出 -$date = date('Y-m-d'); -$html = << - - -$title - - - -

$title(生成日期: $date)

-

版本:$version,SQL:下载链接,Models PDF:下载链接

-$content - -
-

- 春松客服, https://www.cskefu.com -

- - -EOT; -file_put_contents('index.html', $html); -echo 'success!'; -?> \ No newline at end of file diff --git a/design/schema/assets/standalone.html b/design/schema/assets/standalone.html deleted file mode 100644 index 1349cd7c..00000000 --- a/design/schema/assets/standalone.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - $if(title)$$title$$endif$ - - - -$if(template_css)$ - -$else$ - -$endif$ - - - - - - - - - $for(author-meta)$ - - $endfor$ - $if(date-meta)$ - - $endif$ - $if(title-prefix)$$title-prefix$ - $endif$$pagetitle$ - - $if(quotes)$ - - $endif$ - $if(highlighting-css)$ - - $endif$ - $for(css)$ - - $endfor$ - $if(math)$ - $math$ - $endif$ - $for(header-includes)$ - $header-includes$ - $endfor$ - - - - -
- - $if(title)$ -
-
-

$title$

- $if(date)$ -

$date$

- $endif$ - $for(author)$ -

$author$

- $endfor$ -
-
- $endif$ - -
-
-
- -
-
- -
-$body$ -
-
-
- - diff --git a/design/schema/bin/gen-mysql-table-dicts.sh b/design/schema/bin/gen-mysql-table-dicts.sh deleted file mode 100644 index ae2fcb7f..00000000 --- a/design/schema/bin/gen-mysql-table-dicts.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/bash -########################################### -# -########################################### - -# constants -baseDir=$(cd `dirname "$0"`;pwd) -cwdDir=$PWD -export PYTHONUNBUFFERED=1 -export PATH=/opt/miniconda3/envs/venv-py3/bin:$PATH -export TS=$(date +%Y%m%d%H%M%S) -export DATE=`date "+%Y%m%d"` -export DATE_WITH_TIME=`date "+%Y%m%d-%H%M%S"` #add %3N as we want millisecond too -php=/c/devel/php/php.exe - -# functions - -# main -[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return -cd $baseDir/.. - -if [ ! -f .env ]; then - echo "Copy sample.env to .env, modify it at first." - exit 1 -fi - -source .env - -# generate index.html -rm -rf tmp -mkdir tmp -cd tmp - -$php ../app/generator.php -H$DB_HOST \ - -P$DB_PORT \ - -d$DATABASE \ - -u$DB_USER \ - -p$DB_PASS \ - -v$PRODUCT_VERSION \ - -s$DOWNLOAD_SQL \ - -m$DOWNLOAD_MODEL_PDF - -# generate beautiful html -rm -rf docs -mkdir docs -cd docs - -pandoc ../index.html \ - -o index.html \ - -f html \ - --template ../../assets/standalone.html \ - --toc --toc-depth=2 - -cp index.html $baseDir/../../../docs/mysql-dicts.html - -echo "Generated doc index.html in" `pwd` - -# compress files -cd .. -DATABASE_DICTS_ZIP=$DATABASE.dicts.$TS.zip -if [ -f $DATABASE_DICTS_ZIP ]; then - rm -rf $DATABASE_DICTS_ZIP -fi - -zip $DATABASE_DICTS_ZIP -r docs -echo "Compress with zip file" `pwd`/$DATABASE_DICTS_ZIP \ No newline at end of file diff --git a/design/schema/sample.env b/design/schema/sample.env deleted file mode 100644 index 3a3e604c..00000000 --- a/design/schema/sample.env +++ /dev/null @@ -1,8 +0,0 @@ -DB_HOST=127.0.0.1 -DB_PORT=3306 -DB_USER=root -DB_PASS=123456 -DATABASE=cskefu_v8_design -PRODUCT_VERSION=v8 -DOWNLOAD_SQL=https://github.com/cskefu/cskefu -DOWNLOAD_MODEL_PDF=https://github.com/cskefu/cskefu \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index f7cd3242..35b90b36 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,8 +6,11 @@

本站点仅用来托管以下内容

-

数据字典

- 参考链接:mysql-dicts.html +

数据字典

+ 参考链接:mysql-dicts.html + +

数据思维导图

+ 参考链接:mysql-mindmap.xmind

官网

更多内容访问官方网站:https://www.cskefu.com diff --git a/docs/mysql-dicts.html b/docs/mysql-dicts.html index eb7a2ff8..c32547ec 100644 --- a/docs/mysql-dicts.html +++ b/docs/mysql-dicts.html @@ -39,10 +39,10 @@