GithubHelp home page GithubHelp logo

stableship / statictool Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 48 KB

A staticTool which can load all the static info table in mysql and create the toml file

License: MIT License

Python 94.26% HTML 5.74%

statictool's Introduction

staticTool(静态文件生成工具)

基本功能:上传xls的zip压缩文件,通过xls文件与数据库表的映射关系,写入数据库数据,并生成相关的服务端静态文件,客户端静态文件

运行环境

python 2.7 mysql

部署服务端

下载源码

git clone ~~


安装依赖包

进入目录: cd ./staticTool

安装依赖包: pip install -Ur requirements.txt


创建MySql数据库

sql文件路径:./game-server/scripts/mysql.sql

  • 安装MySql数据库(略)
  • 登录MySql: mysql –u用户名 –p密码 (登录成功提示符:mysql>)
  • 创建数据库: mysql> create database static;
  • 选择数据库: mysql> use static;
  • 导入sql文件: mysql> source ./doc/xls_table_map.sql

修改数据库配置

修改服务器配置文件./config/development.conf,内容如下:

[db]
host = localhost(mysql数据库地址)
port = 3306(端口)
name = static(数据库名称)
user = root(用户)
pswd = 123456(密码)


运行

  • python app.py
  • 访问 http://127.0.0.1:3000使用

使用指南:

上传文件

通过访问项目的/,到达操作界面,点击上传文件,选择已经打包好的xls的zip压缩包上传(所有的xls文件放在根目录下,不可以放到子文件夹)(一个zip文件包含所有xls文件)

设置映射关系

修改数据库中的xls_table_map表,设置xls文件数据库表之间的映射关系

设置数据库表结构

设置数据库中的表的相关结构,必须和映射的xls文件数据结构一致

生成静态文件

上传成功后,点击操作界面的插入数据库,生成相关的静态文件

下载静态文件

点击操作界面,下载相应的文件


注意事项

  • xls文件结构必须与数据库表结构相适应

  • 数据库表中必须要有一个id列,作为文件索引

  • 数据库中的列都必须要有自身的注释

  • 数据库字段,匹配很大的数字时使用bigint类型,分数使用double类型,并设置小数点

statictool's People

Contributors

stableship avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.