|
|
|
@ -30,6 +30,7 @@ import org.springblade.core.tool.constant.RoleConstant;
|
|
|
|
|
import org.springblade.core.tool.jackson.JsonUtil; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
|
import org.springblade.develop.constant.DevelopConstant; |
|
|
|
|
import org.springblade.develop.entity.Code; |
|
|
|
|
import org.springblade.develop.entity.Datasource; |
|
|
|
|
import org.springblade.develop.entity.Model; |
|
|
|
@ -144,7 +145,7 @@ public class CodeController extends BladeController {
|
|
|
|
|
List<ModelPrototype> prototypes = modelPrototypeService.prototypeList(model.getId()); |
|
|
|
|
generator.setModel(JsonUtil.readMap(JsonUtil.toJson(model))); |
|
|
|
|
generator.setPrototypes(JsonUtil.readListMap(JsonUtil.toJson(prototypes))); |
|
|
|
|
if (StringUtil.isNotBlank(code.getSubModelId())) { |
|
|
|
|
if (StringUtil.isNotBlank(code.getSubModelId()) && StringUtil.equals(code.getTemplateType(), DevelopConstant.TEMPLATE_SUB)) { |
|
|
|
|
Model subModel = modelService.getById(Func.toLong(code.getSubModelId())); |
|
|
|
|
List<ModelPrototype> subPrototypes = modelPrototypeService.prototypeList(subModel.getId()); |
|
|
|
|
generator.setSubModel(JsonUtil.readMap(JsonUtil.toJson(subModel))); |
|
|
|
|