Code Monkey home page Code Monkey logo

source-parent's Introduction

最佳实践

一 mybatis-plus 定制化代码生成

二 smart-doc 零代码侵入文档生成

使用方法

  1. 引入smart-doc 的maven插件
<plugin>
    <groupId>com.github.shalousun</groupId>
    <artifactId>smart-doc-maven-plugin</artifactId>
    <version>2.2.1</version>
    <configuration>
        <!--指定生成文档使用的配置文件-->
        <configFile>./src/main/resources/smart-doc.json</configFile>
        <!--指定分析的依赖模块(避免分析所有依赖,导致生成文档变慢,循环依赖导致生成失败等问题)-->
        <includes>
            <!--格式为:groupId:artifactId;参考如下-->
            <include>com.alibaba:fastjson</include>

        </includes>
    </configuration>
    <executions>
        <execution>
            <!--不需要在编译项目时自动生成文档可注释phase-->
            <phase>compile</phase>
            <goals>
                <goal>html</goal>
            </goals>
        </execution>
    </executions>
</plugin>

maven sources 目录下新建 smart-doc.json

配置服务地址(页面请求展示) 配置生成文档路径

{
  "serverUrl": "http://127.0.0.1:8080",
  "isStrict": false,
  "allInOne": true,
  "outPath": "src/main/resources/static/doc",
  "createDebugPage": true,
  "projectName": "smart-doc"
}

使用插件

  • smart-doc:html 普通 springboot 项目
  • smart-doc:rpc-html dubbo 项目

三 项目结构

1. source-parent

统一化依赖版本

2. mybatis-plus

  1. 代码生成工具,生成的代码直接在 springboot mybatis项目中使用
  2. 需要引入 tk 相关依赖 & 需要复制 com/wdg/mybatisplus/base 下面相关类到项目中
  3. 执行 com.wdg.mybatisplus.Generator#main

3. service-api

为dubbo api

4. dubbo-doc

为 dubbo provider

5. dubbo-doc-consumer

为 dubbo-consumer

source-parent's People

Contributors

wudg avatar

Watchers

 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.