com.nbsaas.boot.generator.command.mybatis.MapperPackageCommand Maven / Gradle / Ivy
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