|
|
@@ -1,9 +1,11 @@
|
|
|
package com.fdkankan.manage.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.fdkankan.common.constant.CommonStatus;
|
|
|
import com.fdkankan.common.constant.TbStatus;
|
|
|
+import com.fdkankan.common.response.Result;
|
|
|
import com.fdkankan.common.response.ResultData;
|
|
|
import com.fdkankan.manage.entity.News;
|
|
|
import com.fdkankan.manage.mapper.INewsMapper;
|
|
|
@@ -15,6 +17,7 @@ import com.fdkankan.manage.vo.NewsPublicParamVO;
|
|
|
import com.fdkankan.manage.vo.NewsPutTopParamVO;
|
|
|
import com.fdkankan.manage.vo.PageNewsParamVO;
|
|
|
import com.fdkankan.manage.vo.PageNewsVO;
|
|
|
+import com.fdkankan.manage.vo.SaveNewsParamVO;
|
|
|
import java.util.Calendar;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -91,4 +94,14 @@ public class NewsServiceImpl extends ServiceImpl<INewsMapper, News> implements I
|
|
|
public News getNewsDetail(BaseParamVO param) {
|
|
|
return this.getById(param.getId());
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResultData addNews(Long userId, SaveNewsParamVO param) {
|
|
|
+ param.setId(null);
|
|
|
+ News news = BeanUtil.copyProperties(param, News.class);
|
|
|
+ news.setCreaterId(userId);
|
|
|
+ news.setPublicTime(Calendar.getInstance().getTime());
|
|
|
+ this.save(news);
|
|
|
+ return ResultData.ok();
|
|
|
+ }
|
|
|
}
|