提交 ac6b056c authored 作者: liupengfei's avatar liupengfei

--no commit message

上级 192ae8ae
......@@ -43,9 +43,21 @@ public class AdspaceController {
private AdspaceService adspaceService;
@ApiOperation(value = "新增" , notes ="新增")
@PostMapping(value = "/save")
public CallBack<?> saveAdspace(@RequestBody Adspace adspace){
public CallBack<?> saveAdspace(@RequestBody AdspaceForm form){
Adspace adspace = new Adspace();
BeanUtils.copyProperties(form, adspace);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date endTime = null;
try {
if(form.getEndTime() != null) {
endTime = simpleDateFormat.parse(form.getEndTime());
}
} catch (ParseException e) {
e.printStackTrace();
}
adspace.setEndTime(endTime);
adspace.setCreateTime(new Date());
if(!adspaceService.insert(adspace)){
if(!adspaceService.insertSelective(adspace)){
throw new BaseException("操作失败");
}
return CallBack.success();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论