|
|
|
@ -1,8 +1,6 @@
@@ -1,8 +1,6 @@
|
|
|
|
|
package com.cloud.kicc.commonbiz.controller; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.map.MapUtil; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
@ -16,7 +14,6 @@ import com.cloud.kicc.system.api.entity.User;
@@ -16,7 +14,6 @@ import com.cloud.kicc.system.api.entity.User;
|
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.springframework.data.repository.query.Param; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
import javax.validation.Valid; |
|
|
|
@ -58,7 +55,6 @@ public class PushConcernFanController {
@@ -58,7 +55,6 @@ public class PushConcernFanController {
|
|
|
|
|
@ApiOperation("分页查询好友列表") |
|
|
|
|
@GetMapping("/listFriend") |
|
|
|
|
public R removeById(Page page, @RequestParam Map map) { |
|
|
|
|
map.put("createById", SecurityUtils.getUser().getId()); |
|
|
|
|
IPage<Map<String, Object>> list = iPushConcernFanService.selectPushFriendList(page, map); |
|
|
|
|
return R.ok(list.getRecords(), list.getTotal()); |
|
|
|
|
} |
|
|
|
@ -72,9 +68,13 @@ public class PushConcernFanController {
@@ -72,9 +68,13 @@ public class PushConcernFanController {
|
|
|
|
|
@ApiOperation("保存") |
|
|
|
|
@PostMapping("/save") |
|
|
|
|
public R save(@Valid @RequestBody PushConcernFan pushConcernFan) { |
|
|
|
|
// 关注可以重复申请,后者信息覆盖前者信息需先删除前者的关注数据
|
|
|
|
|
iPushConcernFanService.remove(Wrappers.<PushConcernFan>lambdaQuery() |
|
|
|
|
.eq(PushConcernFan::getFanUserId, pushConcernFan.getFanUserId()) |
|
|
|
|
.eq(PushConcernFan::getConcernUserId, pushConcernFan.getConcernUserId())); |
|
|
|
|
iPushConcernFanService.save(pushConcernFan); |
|
|
|
|
// 同步推送类型
|
|
|
|
|
if (StrUtil.equals(pushConcernFan.getStatus(), "1")) { |
|
|
|
|
if (pushConcernFan.getStatus() == 1) { |
|
|
|
|
List<PushType> pushTypes = iPushTypeService.list(Wrappers.<PushType>lambdaQuery().eq(PushType::getCreateById, pushConcernFan.getConcernUserId())); |
|
|
|
|
List<PushConcernFanType> pushConcernFanTypes = pushTypes.stream().map(item -> new PushConcernFanType() |
|
|
|
|
.setName(item.getName()) |
|
|
|
@ -113,37 +113,51 @@ public class PushConcernFanController {
@@ -113,37 +113,51 @@ public class PushConcernFanController {
|
|
|
|
|
pushConcernFan.setFanUserId(item.getId()); |
|
|
|
|
pushConcernFan.setConcernUserId(innerEnterpriseUserId); |
|
|
|
|
pushConcernFan.setType("1"); |
|
|
|
|
pushConcernFan.setStatus("1"); |
|
|
|
|
pushConcernFan.setStatus(1); |
|
|
|
|
iPushConcernFanService.save(pushConcernFan); |
|
|
|
|
}); |
|
|
|
|
return R.ok(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ApiOperation("审核") |
|
|
|
|
@GetMapping("/audit") |
|
|
|
|
public R audit(String id) { |
|
|
|
|
iPushConcernFanService.update(Wrappers.<PushConcernFan>lambdaUpdate().set(PushConcernFan::getStatus, "1").in(PushConcernFan::getId, id)); |
|
|
|
|
PushConcernFan pushConcernFan = iPushConcernFanService.getById(id); |
|
|
|
|
@ApiOperation("更新审核状态") |
|
|
|
|
@PutMapping("/updateAuditStatus") |
|
|
|
|
public R updateAuditStatus(@RequestParam String id, @RequestParam Integer status) { |
|
|
|
|
iPushConcernFanService.update(Wrappers.<PushConcernFan>lambdaUpdate() |
|
|
|
|
.set(PushConcernFan::getStatus, status) |
|
|
|
|
.eq(PushConcernFan::getId, id)); |
|
|
|
|
// 同步推送类型
|
|
|
|
|
List<PushType> pushTypes = iPushTypeService.list(Wrappers.<PushType>lambdaQuery().eq(PushType::getCreateById, pushConcernFan.getConcernUserId())); |
|
|
|
|
List<PushConcernFanType> pushConcernFanTypes = pushTypes.stream().map(item -> new PushConcernFanType() |
|
|
|
|
.setName(item.getName()) |
|
|
|
|
.setConcernFanId(pushConcernFan.getId()) |
|
|
|
|
.setConcernUserId(pushConcernFan.getConcernUserId()) |
|
|
|
|
.setFanUserId(pushConcernFan.getFanUserId()) |
|
|
|
|
.setTypeId(item.getId()) |
|
|
|
|
.setDefaultType(item.getDefaultType()) |
|
|
|
|
.setPlaySound(item.getPlaySound()) |
|
|
|
|
.setPlayVibrate(item.getPlayVibrate()) |
|
|
|
|
.setPlayLights(item.getPlayLights()) |
|
|
|
|
.setPlayToText(item.getPlayToText()) |
|
|
|
|
.setOnlineRingtone(item.getOnlineRingtone()) |
|
|
|
|
.setOfflineRingtone(item.getOfflineRingtone()) |
|
|
|
|
if (status == 1) { |
|
|
|
|
PushConcernFan pushConcernFan = iPushConcernFanService.getById(id); |
|
|
|
|
List<PushType> pushTypes = iPushTypeService.list(Wrappers.<PushType>lambdaQuery() |
|
|
|
|
.eq(PushType::getCreateById, pushConcernFan.getConcernUserId())); |
|
|
|
|
List<PushConcernFanType> pushConcernFanTypes = pushTypes.stream().map(item -> new PushConcernFanType() |
|
|
|
|
.setName(item.getName()) |
|
|
|
|
.setConcernFanId(pushConcernFan.getId()) |
|
|
|
|
.setConcernUserId(pushConcernFan.getConcernUserId()) |
|
|
|
|
.setFanUserId(pushConcernFan.getFanUserId()) |
|
|
|
|
.setTypeId(item.getId()) |
|
|
|
|
.setDefaultType(item.getDefaultType()) |
|
|
|
|
.setPlaySound(item.getPlaySound()) |
|
|
|
|
.setPlayVibrate(item.getPlayVibrate()) |
|
|
|
|
.setPlayLights(item.getPlayLights()) |
|
|
|
|
.setPlayToText(item.getPlayToText()) |
|
|
|
|
.setOnlineRingtone(item.getOnlineRingtone()) |
|
|
|
|
.setOfflineRingtone(item.getOfflineRingtone()) |
|
|
|
|
).collect(Collectors.toList()); |
|
|
|
|
iPushConcernFanTypeService.saveBatch(pushConcernFanTypes); |
|
|
|
|
iPushConcernFanTypeService.saveBatch(pushConcernFanTypes); |
|
|
|
|
} |
|
|
|
|
return R.ok(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ApiOperation("驳回关注粉丝审核") |
|
|
|
|
@PutMapping("/rejectAuth/{ids:[\\w,]+}") |
|
|
|
|
public R<Boolean> rejectAuth(@PathVariable String[] ids) { |
|
|
|
|
iPushConcernFanService.update(Wrappers.<PushConcernFan>lambdaUpdate() |
|
|
|
|
.set(PushConcernFan::getStatus, -1) |
|
|
|
|
.in(PushConcernFan::getId, ids)); |
|
|
|
|
return R.ok(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ApiOperation("删除") |
|
|
|
|
@DeleteMapping("/remove/{ids:[\\w,]+}") |
|
|
|
|
public R<Boolean> removeById(@PathVariable String[] ids) { |
|
|
|
|