package com.yd.oss.service.utils;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

public class MyBatisPlusCodeGenerator {
    public static void main(String[] args) {
        FastAutoGenerator.create("jdbc:mysql://139.224.145.34:3308/yd_oss?serverTimezone=GMT%2B8", "root", "Zxm7320017")
                .globalConfig(builder -> {
                    builder.author("zxm")
//                            .outputDir("src/main/java/com/yd/oss/service");
                            .outputDir("D:/soft/ideaproject/v2/yd-oss/yd-oss-service/src/main/java");
                })
                .packageConfig(builder -> {
                    builder.parent("com.yd.oss.service")
                            .entity("model")
                            .mapper("dao")
                            .service("service")
                            .serviceImpl("service.impl")
                            .xml("mappers");
                })
                .strategyConfig(builder -> {
                    builder.addInclude(
                            "chunked_upload_context"
                    )
                            .entityBuilder()
                            .enableLombok()
                            .enableTableFieldAnnotation()
                            .controllerBuilder()
                            .enableRestStyle();
                })
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();
    }
}

