package com.eversec.kit.creator.impl;

import com.eversec.kit.creator.ICreator;

import java.io.File;
import java.util.List;
import java.util.Map;

/**
 * Created by liangxianyou@eversec.cn at 2018/5/3 18:29.
 */
public class ServiceKit extends ICreator {

    private String pkg = ICreator.pkg + ".service";

    @Override
    public File getFile(String clazz) {
        return new File(filePath(pkg) + clazz + "Service.java");
    }

    @Override
    public String createStr(String clazz, List<Map> fieldList, Map para) {
        StringBuffer buf = new StringBuffer();

        buf.append(
            "package "+ ICreator.pkg +".service;\n" +
            "\n" +
            "import "+ ICreator.pkg +".domain."+ clazz +";\n" +
            "import com.eversec.common.BaseService;\n" +
            "\n" +
            "/**\n" +
            " * 类名称: "+ clazz +"Service<br>\n" +
            " * 类描述: "+ para.get("remark") +"<br>\n" +
            " * 修改时间: "+ timeStr() +"<br>\n" +
            " * @author "+ author +"\n" +
            " */\n" +
            "public interface "+ clazz +"Service extends BaseService<"+ clazz +"> {\n" +
            "   \n" +
            "}\n"
        );

        return buf.toString();
    }
}
