Giter Club home page Giter Club logo

code_generate's Introduction

springboot + mybatis plus 生成 controller service serviceImpl model dao mapper.xml

#如何生成代码

  1. 运行generate/utils/CodeGenerator
  2. 输入模块名
  3. 输入数据表名,需要带前缀
  4. 回车生成代码

#注意事项

  1. 带模块复制到项目内
  2. 需要把mapper中的.xml文件copy到 resources下相同模块名下。例如你创建的是user模块,那么需要复制到resources/user下。
  3. controller文件里导入红色代码块需要的包即可
  4. service接口文件里创建分页列表方法getList,并且返回值为返回类型为 List<model名>
  5. service实现文件里建分页列表方法getList,具体参考user模块即可
  6. 模块目录下新建request文件夹,复制model文件2份到request 重命名为(UserRequest和UserSearchRequest),删除主键属性即可(不删除的话,在插入的时候要使用 saveOrUpdate方法,意味着如果id有值则更新,没有则插入)

#联系方式 qq 419641032 微信 shmilylez

code_generate's People

Contributors

changanzhang avatar

Watchers

James Cloos 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.