gogii

package module
v4.0.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

README

gogii

介绍

gogii 是一个基于 gorm 的代码生成工具,可自动生成 modelservice 等控制器相关代码,帮助开发者提高开发效率,减少重复编码工作。

软件架构

本工具的架构主要分为几个核心模块:

  • 解析模块:负责解析数据库表结构信息。
  • 模板引擎模块:利用预设的模板文件生成相应的代码。
  • 输出模块:将生成的代码保存到指定的文件路径。
安装教程
  1. 确保你已经安装了 Go 语言环境,版本需不低于 Go 1.16
  2. 使用 go get 命令安装 gogii
go get -u github.com/yourusername/gogii
  1. 安装完成后,你可以通过以下命令验证是否安装成功:
gogii --version
配置文件ymal
database:
  host: localhost
  port: 3306
  user: your_username
  password: your_password
  dbname: your_database
  charset: utf8mb4
使用说明
  1. 生成对应文件
  2. 执行下面命令
  gogii generate --config config.yaml --target model

3.若要只生成 service 代码,则使用:

  gogii generate --config config.yaml --target service

4.若要生成所有代码,则使用:

  gogii generate --config config.yaml --target all
参与贡献

1.Fork 本仓库:点击仓库页面的 Fork 按钮,将项目复制到你的个人仓库。 2.新建 Feat_xxx 分支:在你的本地仓库中创建一个新的功能分支,例如 Feat_new_feature

特技
  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Column

func Column(soure string, table string, path string)

Column * *一键生成所有文件

Types

This section is empty.

Directories

Path Synopsis
generator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL