lazy

command module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

README

lazy

code generator

代码生成器

支持数据库 mysql postgresql

新建工程

mkdir project
cd project
mkdir gen
cd gen
lazy save --path ./templates
lazy save --path ./ --t sh
cd ../
sh gen/gen_dao.sh
sh gen/gen_api.sh login UserLogin

常用目录结构

project
├── cmd  # cobra 命令行工具生成
├── gen
│   ├── templates
│   ├── gen_api.sh
│   └── gen_dao.sh
├── init
│   └── init.go
├── pkg # 自定义包
├── app
│   ├── api/v1 请求处理(自动生成)
│   ├── dao # 数据库操作(自动生成)
│   ├── e    # 错误码定义
│   ├── handler 
│   ├── middleware # 自定义中间件
│   ├── model  # 请求/响应 数据模型(自动生成)
│   ├── router # 路由定义
│   ├── service # 逻辑(自动生成),逻辑部分需要自己实现
│   └── utils   # 工具方法
└── main.go  # cobra 命令行工具生成

Documentation

Overview

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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