|
|
@@ -16,7 +16,7 @@ import java.util.stream.Collectors;
|
|
|
/**
|
|
|
* 浏览记录
|
|
|
*/
|
|
|
-@Api(tags = {"一期-浏览记录"})
|
|
|
+@Api(tags = {"2.5期-浏览记录"})
|
|
|
@Slf4j
|
|
|
@CrossOrigin
|
|
|
@RestController
|
|
|
@@ -31,19 +31,17 @@ public class LifeBrowseRecordController {
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "String", paramType = "query"),
|
|
|
@ApiImplicitParam(name = "storeId", value = "门店id", dataType = "String", paramType = "query"),
|
|
|
- @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "String", paramType = "query"),
|
|
|
- @ApiImplicitParam(name = "expertId", value = "达人id", dataType = "String", paramType = "query"),
|
|
|
- @ApiImplicitParam(name = "browseType", value = "浏览类型 1:用户端, 2:商家端", dataType = "Integer", paramType = "query")
|
|
|
+ @ApiImplicitParam(name = "dynamicsId", value = "动态id", dataType = "String", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "couponId", value = "团购id", dataType = "String", paramType = "query")
|
|
|
})
|
|
|
@PostMapping("/save")
|
|
|
- public R<Boolean> save(@RequestParam("userId") String userId, @RequestParam("storeId") String storeId, String orderId, String expertId, Integer browseType) {
|
|
|
- log.info("LifeBrowseRecordController.save?userId={}&storeId={}&browseType={}", userId, storeId, browseType);
|
|
|
+ public R<Boolean> save(@RequestParam(value = "userId",required = false) String userId, @RequestParam(value = "storeId",required = false) String storeId, @RequestParam(value = "dynamicsId",required = false) String dynamicsId,@RequestParam(value = "couponId",required = false) String couponId) {
|
|
|
+ log.info("LifeBrowseRecordController.save?userId={},storeId={},dynamicsId={},couponId={}", userId,storeId, dynamicsId, couponId);
|
|
|
LifeBrowseRecord record = new LifeBrowseRecord();
|
|
|
record.setUserId(userId);
|
|
|
record.setStoreId(storeId);
|
|
|
- record.setBrowseType(browseType);
|
|
|
- record.setOrderId(orderId);
|
|
|
- record.setExpertId(expertId);
|
|
|
+ record.setDynamicsId(dynamicsId);
|
|
|
+ record.setCouponId(couponId);
|
|
|
if (lifeBrowseRecordService.save(record) > 0) {
|
|
|
return R.success("操作成功");
|
|
|
}
|
|
|
@@ -54,12 +52,13 @@ public class LifeBrowseRecordController {
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
@ApiImplicitParams({@ApiImplicitParam(name = "page", value = "分页页数", dataType = "String", paramType = "query", required = true),
|
|
|
@ApiImplicitParam(name = "size", value = "分页条数", dataType = "String", paramType = "query", required = true),
|
|
|
+ @ApiImplicitParam(name = "type", value = "类型 1:商家;2:团购;3:动态", dataType = "String", paramType = "query", required = true),
|
|
|
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "String", paramType = "query")})
|
|
|
@GetMapping("/getBrowseRecord")
|
|
|
- public R<IPage<Map<String, Object>>> getBrowseRecord(@RequestParam("userId") String userId, @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int size) {
|
|
|
- log.info("LifeBrowseRecordController.getBrowseRecord?userId={},page={},size={}", userId, page, size);
|
|
|
+ public R<IPage<Map<String, Object>>> getBrowseRecord(@RequestParam("userId") String userId,@RequestParam("type") String type, @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int size) {
|
|
|
+ log.info("LifeBrowseRecordController.getBrowseRecord?userId={},type={},page={},size={}", userId,type, page, size);
|
|
|
List<Map<String, Object>> dataList = new ArrayList<>();
|
|
|
- Map<String, List<Map<String, Object>>> map = lifeBrowseRecordService.getBrowseRecord(userId);
|
|
|
+ Map<String, List<Map<String, Object>>> map = lifeBrowseRecordService.getBrowseRecord(userId,type);
|
|
|
for (Map.Entry<String, List<Map<String, Object>>> entry : map.entrySet()) {
|
|
|
String year = entry.getKey();
|
|
|
List<Map<String, Object>> records = entry.getValue();
|
|
|
@@ -77,11 +76,13 @@ public class LifeBrowseRecordController {
|
|
|
|
|
|
@ApiOperation("清除浏览记录")
|
|
|
@ApiOperationSupport(order = 3)
|
|
|
- @ApiImplicitParams({@ApiImplicitParam(name = "userId", value = "用户id", dataType = "String", paramType = "query")})
|
|
|
+ @ApiImplicitParams({@ApiImplicitParam(name = "userId", value = "用户id", dataType = "String", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "recordId", value = "浏览记录id", dataType = "String", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "type", value = "类型:1店铺,2团购,3动态", dataType = "String", paramType = "query")})
|
|
|
@PostMapping("/clearBrowseRecord")
|
|
|
- public R<Boolean> clearBrowseRecord(@RequestParam("userId") String userId) {
|
|
|
- log.info("LifeBrowseRecordController.clearBrowseRecord?userId={}", userId);
|
|
|
- int num = lifeBrowseRecordService.clearBrowseRecord(userId);
|
|
|
+ public R<Boolean> clearBrowseRecord(@RequestParam("userId") String userId, @RequestParam(value = "recordId",required = false) String recordId,@RequestParam(value = "type",required = false) String type) {
|
|
|
+ log.info("LifeBrowseRecordController.clearBrowseRecord?userId={}&recordId={}&type={}", userId, recordId,type);
|
|
|
+ int num = lifeBrowseRecordService.clearBrowseRecord(userId, recordId,type);
|
|
|
if (num == 0) {
|
|
|
return R.fail("操作失败");
|
|
|
}
|