use of com.rebuild.core.metadata.impl.CopyEntity in project rebuild by getrebuild.
the class MetaEntityController method entityCopy.
@PostMapping("entity/entity-copy")
public RespBody entityCopy(HttpServletRequest request) {
final JSONObject reqJson = (JSONObject) ServletUtils.getRequestJson(request);
Entity sourceEntity = MetadataHelper.getEntity(reqJson.getString("sourceEntity"));
String entityName = reqJson.getString("entityName");
String detailEntityName = reqJson.getString("detailEntityName");
try {
entityName = new CopyEntity(sourceEntity).copy(entityName, detailEntityName);
return RespBody.ok(entityName);
} catch (Exception ex) {
log.error("entity-copy", ex);
return RespBody.error(ex.getLocalizedMessage());
}
}
Aggregations