package com.xy;

import com.baomidou.mybatisplus.annotation.IdType;
import com.xy.utils.MybatisGenerator2;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 自动生成代码
 */
@Slf4j
@Component
public class GenCode {

    public static void main(String[] args) {

//        MybatisGenerator.Generator.builder().build().create();
        gen2();

    }

    public static void gen2() {
        MybatisGenerator2.Generator.builder()
                .author("谭斌")
                .commPath("D:\\xy_workspace\\xy-new\\xy-device")
                .dtoModule("device-api")
                .dtoPackage("com.xy")
                .serviceModule("device-api")
                .servicePackage("com.xy")
                .implModule("device-api-service")
                .implPackage("com.xy")
                .mapperModule("device-api-service")
                .mapperPackage("com.xy")
                .feignModule("device-api-cloud")
                .feignPackage("com.xy")
                .entityModule("device-api-service")
                .entityPackage("com.xy")
                .idType(IdType.ASSIGN_ID)
                .autoFill(true)
//                .deleteFieldName("deleted")
                .build().create();
    }
}
