|
@@ -1,14 +1,19 @@
|
|
package com.sky.ioc.service.notice.impl;
|
|
package com.sky.ioc.service.notice.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
-import com.sky.ioc.entity.domain.notice.FeedBack;
|
|
|
|
|
|
+import com.sky.ioc.entity.domain.notice.Feedback;
|
|
import com.sky.ioc.entity.params.notice.NoticeParam;
|
|
import com.sky.ioc.entity.params.notice.NoticeParam;
|
|
|
|
+import com.sky.ioc.entity.result.system.LoginUserVo;
|
|
import com.sky.ioc.mapper.notice.FeedBackMapper;
|
|
import com.sky.ioc.mapper.notice.FeedBackMapper;
|
|
import com.sky.ioc.service.notice.FeedBackService;
|
|
import com.sky.ioc.service.notice.FeedBackService;
|
|
|
|
+import com.sky.ioc.tool.JwtUtil;
|
|
|
|
+import com.sky.ioc.tool.RedisUtil;
|
|
import com.sky.ioc.tool.ReturnMsg;
|
|
import com.sky.ioc.tool.ReturnMsg;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
+import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
@@ -19,6 +24,9 @@ public class FeedBackServiceImpl implements FeedBackService {
|
|
@Autowired
|
|
@Autowired
|
|
FeedBackMapper feedBackMapper;
|
|
FeedBackMapper feedBackMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private RedisUtil redisUtil;
|
|
|
|
+
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public ReturnMsg listPage(NoticeParam noticeParam) {
|
|
public ReturnMsg listPage(NoticeParam noticeParam) {
|
|
@@ -45,14 +53,29 @@ public class FeedBackServiceImpl implements FeedBackService {
|
|
if(ids.size()==0||ids==null){
|
|
if(ids.size()==0||ids==null){
|
|
return ReturnMsg.fail("参数错误");
|
|
return ReturnMsg.fail("参数错误");
|
|
}else{
|
|
}else{
|
|
- feedBackMapper.updateStatusByIds(ids);
|
|
|
|
|
|
+ feedBackMapper.delByIds(ids);
|
|
return ReturnMsg.ok();
|
|
return ReturnMsg.ok();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public ReturnMsg getFeedBack(Integer id) {
|
|
public ReturnMsg getFeedBack(Integer id) {
|
|
- FeedBack feedBack = feedBackMapper.selectById(id);
|
|
|
|
|
|
+ Feedback feedBack = feedBackMapper.selectById(id);
|
|
return ReturnMsg.ok(feedBack);
|
|
return ReturnMsg.ok(feedBack);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public ReturnMsg addFeedBack(Feedback feedback,String token) {
|
|
|
|
+ if (StringUtils.hasText(token)) {
|
|
|
|
+ String username = JwtUtil.parseJWT(token) ;
|
|
|
|
+ Object o = redisUtil.get("login:" + username);
|
|
|
|
+ if (!Objects.isNull(o)) {
|
|
|
|
+ feedback.setCreator(((LoginUserVo) o).getUserName());
|
|
|
|
+ //return joinPoint.proceed(joinPoint.getArgs());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ feedback.setCreateTime(new Date()+"");
|
|
|
|
+ feedBackMapper.insert(feedback);
|
|
|
|
+ return ReturnMsg.ok();
|
|
|
|
+ }
|
|
}
|
|
}
|