From bc4f6a761602fddb70307720a08caddf1f270ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E6=98=8E=E9=94=8B?= Date: Wed, 14 Apr 2021 13:27:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0Readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OSharp.CodeGenerator.sln | 1 + README.en.md | 36 --------------------- README.md | 70 ++++++++++++++++++++++++++-------------- 3 files changed, 46 insertions(+), 61 deletions(-) delete mode 100644 README.en.md diff --git a/OSharp.CodeGenerator.sln b/OSharp.CodeGenerator.sln index 1ecd621..918871f 100644 --- a/OSharp.CodeGenerator.sln +++ b/OSharp.CodeGenerator.sln @@ -8,6 +8,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{CE0E16CA .editorconfig = .editorconfig build\build.ps1 = build\build.ps1 build\public.props = build\public.props + README.md = README.md build\version.props = build\version.props EndProjectSection EndProject diff --git a/README.en.md b/README.en.md deleted file mode 100644 index d6256c1..0000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# OSharp.CodeGenerator - -#### Description -OSharp代码生成器 - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md index 2d65a8b..c4a3da4 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,57 @@ -# OSharp.CodeGenerator +# OSharp代码生成器 -#### 介绍 -OSharp代码生成器 +## 介绍 -#### 软件架构 -软件架构说明 +OSharp代码生成器,管理 **项目 -> 模块 -> 实体 -> 实体属性** 的结构数据,生成各个模块的实体类,DTO类,业务Service类,API控制器类等各层次的代码 +## 生成器使用流程 -#### 安装教程 +1. 配置代码生成的需要的项目信息,项目的各个模块信息,模块的各个实体信息,实体的各个属性信息,保存为配置文件 +2. 基于项目配置信息和内置的已编译Razor模板,使用Razor引擎`RazorEngine`生成 实体类,实体配置类,InputDto,OutputDto,业务层接口,业务层实现,MVC控制器代码 等项目各个层次的代码 +3. 将生成的代码整合进项目工程中,通过类继承和partial分部类对生成代码进行扩展,实现实际的业务需求 -1. xxxx -2. xxxx -3. xxxx +## 代码生成流程 -#### 使用说明 +### 1. 创建项目,加载项目 -1. xxxx -2. xxxx -3. xxxx +![image-20210414132119855](https://gitee.com/i66soft/blog-media/raw/master/osharp/image-20210414132119855.png) -#### 参与贡献 +![image-20210414131234889](https://gitee.com/i66soft/blog-media/raw/master/osharp/image-20210414131234889.png) -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request -#### 码云特技 +### 2. 添加 模块-实体-实体属性 层级数据 -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 -5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +#### 2.1 在项目下添加模块信息 + +![image-20210414131635727](https://gitee.com/i66soft/blog-media/raw/master/osharp/image-20210414131635727.png) + +#### 2.2 在模块下添加实体信息 + +![image-20210414131733607](https://gitee.com/i66soft/blog-media/raw/master/osharp/image-20210414131733607.png) + +#### 2.3 在实体下添加属性信息 + +![image-20210414131812823](https://gitee.com/i66soft/blog-media/raw/master/osharp/image-20210414131812823.png) + +#### 2.4 在实体中配置外键信息 + +![image-20210414131856270](https://gitee.com/i66soft/blog-media/raw/master/osharp/image-20210414131856270.png) + +### 3. 生成代码 + +#### 3.1 全局模板管理,可以添加自定义模板 + +![image-20210414132255249](https://gitee.com/i66soft/blog-media/raw/master/osharp/image-20210414132255249.png) + +#### 3.2 项目模板管理,给项目选择要用到的模板 + +![image-20210414132339423](https://gitee.com/i66soft/blog-media/raw/master/osharp/image-20210414132339423.png) + +#### 3.3 生成代码 + +![image-20210414132414305](https://gitee.com/i66soft/blog-media/raw/master/osharp/image-20210414132414305.png) + +#### 3.4 生成的代码 + +![image-20210414132629986](https://gitee.com/i66soft/blog-media/raw/master/osharp/image-20210414132629986.png) -- Gitee