int timeout, @RequestParam("modelType")
int modelType, @RequestParam(value = "topicid", required = false)
String topicid, @RequestParam("pageNum")
int pageNum, @RequestParam("type")
int type, HttpSession session) {
User user = getUserFromSession(session);
if (user == null) {
return getErrorUrl(UNLOGIN_ERROR_MESSAGE);
}
String url = JCMSConstant.createModelUrl(modelName, suffix);
Model model = new Model();
model.setModelName(modelName);
model.setTitle(title);
model.setExtname(suffix);
model.setKeyword(keyword);
model.setContent(content);
model.setStatus(status);
model.setTopicid(topicid);
model.setRate(refresh);
model.setType(modelType);
Date now = new Date();
Date timeoutDate = DateUtils.addDays(now, timeout);
model.setTimeout(DateFormatUtils.ISO_DATETIME_FORMAT.format(timeoutDate));
model.setAddTime(JCMSConstant.getDateString(now));
model.setLastModify(JCMSConstant.getDateString(now));
model.setModifyUser(user.getUserName());
model.setUrl(url);
int insertModel =modelService.addModel(model);
int insertPushRecord =pushRecordService.addBlankDoc(title, null, url, topicid, 60, user.getUserName(), null);
if(insertModel<=0){
logger.error("插入模板失败:" + ToStringBuilder.reflectionToString(model));
return getErrorUrl("插入模板失败");
}
if(insertPushRecord<=0){