All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nbsaas.boot.generator.command.mybatis.MapperPackageCommand Maven / Gradle / Ivy

There is a newer version: 1.1.10-2024
Show newest version
package com.nbsaas.boot.generator.command.mybatis;

import com.nbsaas.boot.generator.command.common.BaseCommand;
import com.nbsaas.boot.generator.config.Config;
import com.nbsaas.boot.generator.context.InputRequestObject;
import com.nbsaas.boot.rest.response.ResponseObject;

import java.io.File;

public class MapperPackageCommand extends BaseCommand {
    @Override
    public ResponseObject handle(InputRequestObject inputRequestObject) {
        Config config = this.inputRequestObject.getConfig();
        this.makeXmlPackage("." + config.getModuleName() + ".data.mapper");
        return ResponseObject.success();

    }
    protected void makeXmlPackage(String basePackage) {
        String packageTemp = this.inputRequestObject.getConfig().getBasePackage() + basePackage;
        String requestDir = this.outPath() + "\\src\\main\\java\\" + packageTemp.replace(".", "\\");
        File out = new File(requestDir);
        if (!out.exists()) {
            out.mkdirs();
        }

    }
    @Override
    public String outPath() {
        Config config = this.inputRequestObject.getConfig();
        return config.getMultiple() ? config.getOutputPath() + "\\resources\\[[]]-resource".replace("[[]]", config.getProjectName()) : config.getOutputPath();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy