摒弃过度封装,代码风格极尽简洁,适合中小项目使用!
架构思路沿袭着若依的以辅助生成重复代码为主,不过度封装,生成的代码可以快速修改适应不同的需求。
host: ${REDIS_HOST:lostvip.com}
本着简单易用的原则,简化工程结构,没有dao层。
main[]()
├── docs // 资料备份
├── main // 系统管理
│ └── app // go源码存放目录
│ └── static // 静态文件目录
│ └── mapper // 类mybatis映射文件存放目录
│ └── template // 模板存放目录
│ └── bootstrap.yml // 项目根配置文件,模仿springboot
│ └── application.ym // 项目配置文件,模仿springboot
│ └── build.sh // 编译脚本,方便打包
│ └── build-cgo.sh // 编译脚本,启用cgo,需要打包sqlite时有用
│ └── build-linux.bat // 编译脚本,windows环境交叉编译用
│ └── data.db // 使用sqlite数据库时有用,只使用mysql可删除
│ └── deploy-swarm-ry.yml // docker swarm 服务编排脚本
│ └── Dockerfile // Docker镜像文件
├── lv_framework // 框架通用模块
│ └── cache // 通用缓存处理
│ └── conf // 通用配置处理
│ └── db // 数据库配置处理
│ └── utils // 通用工具类
│ └── logme // 通用日志处理,统一风格,方便切换第三方日志库
│ └── web // 通用web组件
│
├── go.work // 项目模块配置
├── build-linux.bat // 编译脚本
go run main.go
启动完成后,在控制台会打印出访问地址: http://127.0.0.1:8080
前置条件: cd 到 main 目录,安装热加载框架:
go get github.com/pilu/fresh
go install github.com/pilu/fresh
启动
fresh
账号: admin / admin123
注意,本站未做任何防护,管理员有所有权限,请不要删除任何数据!
web框架 https://github.com/gin-gonic/gin
缓存框架 https://github.com/redis/go-redis
配置文档 https://github.com/BurntSushi/toml
RuoYi框架 https://github.com/yangzongzhuan/RuoYi
tealeg https://github.com/tealeg/xlsx
swaggo https://github.com/swaggo/swag
若依goframe版 https://github.com/guolingege/yjgo
热加载框架 http://github.com/pilu/fresh
sql文件解析: https://github.com/qustavo/dotsql
如有兴趣一起完善,进QQ群 43862272
Gitee https://gitee.com/lostvip_com/ruoyi-go
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。