Coder Social home page Coder Social logo

Comments (4)

lihengming avatar lihengming commented on May 22, 2024

@anchuang HI,最近比较忙,没来的及答复,不好意思。这个问题刚才我已经解决,并加到CodeGenerator上了,可以自己指定 Model 的名称了,请更新代码。

public static void main(String[] args) {
    genCode("输入表名","输入自定义Model名称");
}

/**
 * 通过数据表名称,和自定义的 Model 名称生成代码
 * 如输入表名称 "t_user_detail" 和自定义的 Model 名称 "User" 将生成 User、UserMapper、UserService ...
 * @param tableName 数据表名称
 * @param modelName 自定义的 Model 名称
 */
public static void genCode(String tableName, String modelName) {
    genModelAndMapper(tableName, modelName);
    genService(tableName, modelName);
    genController(tableName, modelName);
}

from spring-boot-api-project-seed.

anchuang avatar anchuang commented on May 22, 2024

谢谢,测试了下,这个问题已经得到了解决。能否把生成mapper.xml和生成model的模板也放在template目录下下,这样方便根据本身的项目需要修改。

from spring-boot-api-project-seed.

lihengming avatar lihengming commented on May 22, 2024

@anchuang HI,Model 和 Mapper 是用 MyBatis Generator 生成的,相关配置可以查看官方文档:http://www.mybatis.org/generator/

from spring-boot-api-project-seed.

anchuang avatar anchuang commented on May 22, 2024

收到,谢谢

from spring-boot-api-project-seed.

Related Issues (20)

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.