Giter Site home page Giter Site logo

gocli's Introduction

                      _  _ 
   __ _   ___    ___ | |(_)
  / _` | / _ \  / __|| || |
 | (_| || (_) || (__ | || |
  \__, | \___/  \___||_||_|
  |___/                                     

gocli 脚手架工具

gocli 脚手架工具 这是一款自动生成项目模板的工具,它能根据用户的选择和需求,创建项目的目录结构、文件、依赖项等。使用这个脚手架工具可以节省手动创建和配置项目的时间和精力,从而让开发者更专注于业务逻辑的开发

安装 gocli 工具

使用以下命令安装 gocli 工具:

go get -u github.com/nelsonkti/gocli

配置环境变量

对于 Windows 用户,如果希望全局使用 gocli 命令,请将其可执行文件路径 (${GOPATH}/src/bin/gocli.exe) 添加到系统的环境变量中。

使用示例

创建 Model

使用 gocli 创建 Model:

gocli make:model -d="root:root+@tcp(127.0.0.1:3306)/demo?charset=utf8mb4&parseTime=True&loc=Local" -n=测试 -f=code_user_from_ma,v3_order -p=order 

创建 Repository

使用 gocli 创建 Repository:

gocli make:repository -n=测试 -f=code_user_from_ma,v3_order -p=order 

创建 Service

使用 gocli 创建 Service:

gocli make:service -n=测试 -f=code_user_from_ma,v3_order -p=order 

一键创建 Model、Repository 和 Service

使用 gocli 一键创建 Model、Repository 和 Service:

gocli make:mrs -d="root:root+@tcp(127.0.0.1:3306)/demo?charset=utf8mb4&parseTime=True&loc=Local" -f=code_user_from_ma,v3_order -p=order/test 

创建 RPC

使用 gocli 创建 RPC:

gocli make:rpc -p=./proto/demo

环境要求

  • Go 版本需 >= 1.20

gocli's People

Contributors

fuzengyao avatar

Watchers

 avatar Fu Zeng Yao 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.