package cc.smtweb.system.bpm.web.design.db;

import cc.smtweb.framework.core.annotation.SwService;
import cc.smtweb.framework.core.db.vo.ModelCatalog;
import cc.smtweb.framework.core.db.vo.ModelDatabase;
import cc.smtweb.framework.core.mvc.service.*;

/**
 * Created by Akmm at 2022/3/22 9:12
 */
@SwService
public class ModelDatabaseService extends AbstractCompService {
    @Override
    protected AbstractHandler createHandler(String type) {
        switch (type) {
            case TYPE_LOAD:
                return new DefaultLoadHandler<ModelCatalog>(ModelDatabase.ENTITY_NAME);
            case TYPE_SAVE:
                return new DefaultSaveHandler<>(ModelDatabase.ENTITY_NAME);
            case TYPE_DEL:
                return new DefaultDelHandler<>(ModelDatabase.ENTITY_NAME);
            case TYPE_LIST:
                return new DefaultListHandler<>(ModelDatabase.ENTITY_NAME);
            case TYPE_COMBO:
                return new ModelDatabaseComboHandler();

        }
        return null;
    }
}
