Git Product home page Git Product logo

generatedf's Introduction

生成目录结构及文件的工具

工具运行结果


setting.yaml中定义生成的目录结构

 生成的文件夹及文件:

如何使用


配置setting.yaml:

  1. 要生成的目录结构,目录层级可以无限延伸。
  2. 在哪些目录下生成1所定义的目录。注意要从根目录写起,如果是在windows下则例如:D:\demoDir\testRestful\
  3. 要与2所定义的根目录数量保持一致,如果2要在三个目录下生成,则3也要定义三次。下面以每一个逗号为分隔来介绍。
    *使用的模版文件。
    *后缀名
    *包名。
    *文件名后缀。
  4. 自定义内容,将替换模版内#{}内同名的字符

最后运行main方法就可以了。

模版说明


模版文件在/template包下。 下面举一个例子🌰:

package #{nowPath};

import com.maryun.model.PageData;
import com.maryun.restful.base.BaseRestful;
import #{mapperPackage}.#{importPath}.#{UmapperName}Mapper;
import com.maryun.utils.WebResult;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

/**
 * @Descriptkon
 *
 * @author #{author} #{date}#{secondAu}
 */
@RestController
@RequestMapping("/app/#{restName}eRestful")
public class #{UrestName}Restful extends BaseRestful{
    @Resource
    private #{UmapperName}Mapper homeThreeMapper;

    /**
     *
     * @param pd
     * @return
     **/
    @RequestMapping("")
    public PageData template(@RequestBody PageData pd) {
        return WebResult.requestSuccess();
    }
}

这是testRestful目录下的模版文件,一目了然,#{}及其内部的内容将会被定义在setting.yaml中的文件所替换。
其中有一些特殊的将在下面列举出来,在定义setting.yaml时注意避免与这些规则冲突。

  • #{nowPath}:当前包的位置。
  • #{importPath}:递归的目录的叠加。
  • #{date}:当前日期。
  • 任何的#{}中的第一个字母为大写的"U",替换后的内容首字母会大写。
  • 如果#{}的内容没有在setting.yaml中定义过的话,将会以当前的文件夹的名字替换。

最后说两句


如果使用中有任何问题请联系我[email protected]或者提交issue。

License


MIT

Copyright (c) 2013-present, Rellopn

generatedf's People

Contributors

rellopn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar 赵乾颖 avatar Shoukun Sun avatar  avatar GaoXinyu avatar 初明泽 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar  avatar  avatar

Forkers

xiaolei1004

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.