|
@@ -5,7 +5,9 @@ import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
import com.cyksj.model.entity.GoodsDonQa;
|
|
import com.cyksj.model.entity.GoodsDonQa;
|
|
|
import com.cyksj.model.views.GoodsDonQaView;
|
|
import com.cyksj.model.views.GoodsDonQaView;
|
|
|
|
|
+import com.cyksj.redis.RedisService;
|
|
|
import com.cyksj.service.mange.GoodsDonQaService;
|
|
import com.cyksj.service.mange.GoodsDonQaService;
|
|
|
|
|
+import com.cyksj.service.mange.RefreshCacheService;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
import com.ejlchina.searcher.SearchResult;
|
|
import com.ejlchina.searcher.SearchResult;
|
|
|
import com.ejlchina.searcher.util.MapUtils;
|
|
import com.ejlchina.searcher.util.MapUtils;
|
|
@@ -32,10 +34,15 @@ public class GoodsDonQuestionController {
|
|
|
|
|
|
|
|
private final HttpServletRequest request;
|
|
private final HttpServletRequest request;
|
|
|
|
|
|
|
|
|
|
+ private final RedisService redisService;
|
|
|
|
|
+
|
|
|
|
|
+ private final RefreshCacheService refreshCacheService;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@PostMapping("/post")
|
|
@PostMapping("/post")
|
|
|
public Result<String> post(@RequestBody GoodsDonQa goodsDonQa) {
|
|
public Result<String> post(@RequestBody GoodsDonQa goodsDonQa) {
|
|
|
goodsDonQaService.saveOrdUpdateQa(goodsDonQa);
|
|
goodsDonQaService.saveOrdUpdateQa(goodsDonQa);
|
|
|
|
|
+ refreshCacheService.goodsQuestionCache();
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -46,6 +53,7 @@ public class GoodsDonQuestionController {
|
|
|
if (byId != null && byId.getDeleted()) {
|
|
if (byId != null && byId.getDeleted()) {
|
|
|
byId.setDeleted(false);
|
|
byId.setDeleted(false);
|
|
|
goodsDonQaService.updateById(byId);
|
|
goodsDonQaService.updateById(byId);
|
|
|
|
|
+ refreshCacheService.goodsQuestionCache();
|
|
|
}
|
|
}
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
}
|
|
@@ -53,6 +61,7 @@ public class GoodsDonQuestionController {
|
|
|
@PutMapping("/update")
|
|
@PutMapping("/update")
|
|
|
public Result<String> update(@RequestBody GoodsDonQa goodsDonQa) {
|
|
public Result<String> update(@RequestBody GoodsDonQa goodsDonQa) {
|
|
|
goodsDonQaService.saveOrdUpdateQa(goodsDonQa);
|
|
goodsDonQaService.saveOrdUpdateQa(goodsDonQa);
|
|
|
|
|
+ refreshCacheService.goodsQuestionCache();
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -66,6 +75,7 @@ public class GoodsDonQuestionController {
|
|
|
if (byId != null) {
|
|
if (byId != null) {
|
|
|
byId.setStatus(!byId.getStatus());
|
|
byId.setStatus(!byId.getStatus());
|
|
|
goodsDonQaService.updateById(byId);
|
|
goodsDonQaService.updateById(byId);
|
|
|
|
|
+ refreshCacheService.goodsQuestionCache();
|
|
|
}
|
|
}
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
}
|
|
@@ -80,6 +90,7 @@ public class GoodsDonQuestionController {
|
|
|
.ne(GoodsDonQa::getStatus, status)
|
|
.ne(GoodsDonQa::getStatus, status)
|
|
|
.in(GoodsDonQa::getId, ids)
|
|
.in(GoodsDonQa::getId, ids)
|
|
|
.eq(GoodsDonQa::getDeleted, 1));
|
|
.eq(GoodsDonQa::getDeleted, 1));
|
|
|
|
|
+ refreshCacheService.goodsQuestionCache();
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
}
|
|
|
|
|
|