Compare commits

...

18 Commits

Author SHA1 Message Date
yang 5eb778c21c Merge branch 'refs/heads/preview' into feature/community-center 2025-04-22 17:07:35 +08:00
yang 43b79969ee feat(communityCenter): 新增社区通知功能并调整收益信息相关代码 2025-04-22 17:07:15 +08:00
Diyu0904 8dca878499 Merge branch 'master' into preview 2025-04-22 16:25:17 +08:00
Diyu0904 4e09f1055e 更改正式环境配置文件 2025-04-22 13:31:03 +08:00
Diyu0904 5d3857506d 更改正式环境配置文件 2025-04-22 11:54:43 +08:00
yang e3a27c5199 Merge remote-tracking branch 'origin/feature/community-center' into feature/community-center
# Conflicts:
#	mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/domain/vo/PublishVo.java
#	mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/PublishServiceImpl.java
2025-04-21 16:22:35 +08:00
yang 9c7e6ea4a1 feat(communityCenter): 增加是否点赞 2025-04-21 16:21:30 +08:00
yang c3d1fba84a feat(communityCenter): 社区详情、编辑社区、社区文件下载 2025-04-21 15:35:55 +08:00
yang 906a56c431 feat(community): 发布收藏 2025-04-16 13:46:13 +08:00
Diyu0904 74ac63338a 更改正式环境配置文件 支付宝回调 2025-04-15 15:58:54 +08:00
Diyu0904 d71f75bfe7 更改正式环境配置文件 2025-04-15 13:36:18 +08:00
yang 70d3d32bc5 feat(communityCenter): 社区收益功能、用户拉黑 2025-04-15 10:57:53 +08:00
Diyu0904 81cfc52881 更改正式环境配置文件 2025-04-14 15:58:47 +08:00
Diyu0904 23c8fb7410 更改正式环境配置文件 2025-04-14 15:40:49 +08:00
Diyu0904 4b5187f5dc 更改测试环境文件 2025-04-14 15:37:23 +08:00
yang 8734ca0502 Merge branch 'refs/heads/feature/community-center' into preview
# Conflicts:
#	mcwl-admin/src/main/resources/application-druid.yml
2025-04-14 15:33:36 +08:00
yang 67d1f6cc19 refactor(mcwl): 调整 2025-04-14 15:31:37 +08:00
yang 1f85f77ca3 refactor(mcwl): 重构代码并添加新功能
- 修改了 AddBenefitNameDto 和 EditBenefitNameDto 中的注解- 添加了 AdviceConstant 类用于定义通知类型常量
- 在 BenefitController 中添加了根据权益名称 ID 查询权益的接口
- 在 CommunityServiceImpl 中实现了社区通知的发送- 移除了与 MQTT 相关的代码和接口
2025-04-14 15:30:45 +08:00
138 changed files with 3133 additions and 1492 deletions

BIN
blob

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 MiB

After

Width:  |  Height:  |  Size: 1008 KiB

View File

@ -0,0 +1,43 @@
package com.mcwl.web.controller.communityCenter;
import com.mcwl.common.core.domain.R;
import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.communityCenter.domain.dto.*;
import com.mcwl.communityCenter.domain.vo.CommunityDetailVo;
import com.mcwl.communityCenter.service.CommunityAdviceService;
import com.mcwl.communityCenter.service.CommunityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
/**
*
*/
@Api(tags = "社区通知")
@RestController
@RequestMapping("communityAdvice")
@RequiredArgsConstructor
public class CommunityAdviceController {
private final CommunityAdviceService communityAdviceService;
/**
*
*/
@ApiOperation(value = "获取通知列表")
@PostMapping("adviceList")
public TableDataInfo getCommunityAdviceList(@RequestBody CommunityAdvicePageRes communityAdvicePageRes) {
return communityAdviceService.getCommunityAdviceList(communityAdvicePageRes);
}
}

View File

@ -1,18 +1,13 @@
package com.mcwl.web.controller.communityCenter; package com.mcwl.web.controller.communityCenter;
import com.mcwl.common.constant.HttpStatus;
import com.mcwl.common.core.domain.R; import com.mcwl.common.core.domain.R;
import com.mcwl.common.core.page.PageDomain;
import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.communityCenter.domain.Community; import com.mcwl.communityCenter.domain.dto.*;
import com.mcwl.communityCenter.domain.dto.CommunityListPageRes; import com.mcwl.communityCenter.domain.vo.CommunityDetailVo;
import com.mcwl.communityCenter.domain.dto.CommunityRes;
import com.mcwl.communityCenter.domain.dto.JoinCommunityListPageRes;
import com.mcwl.communityCenter.domain.dto.JoinCommunityRes;
import com.mcwl.communityCenter.service.CommunityService; import com.mcwl.communityCenter.service.CommunityService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -20,7 +15,6 @@ import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Objects;
/** /**
* *
@ -45,6 +39,28 @@ public class CommunityController {
return communityService.listByPage(communityListPageRes); return communityService.listByPage(communityListPageRes);
} }
@ApiOperation(value = "社区详情")
@GetMapping("detail")
public R<CommunityDetailVo> getCommunityDetail(@Valid
@ApiParam(value = "社区id", required = true)
@NotNull(message = "社区id不能为空")
Long communityId) {
CommunityDetailVo communityDetailVo = communityService.getCommunityDetail(communityId);
return R.ok(communityDetailVo);
}
/**
*
*/
@ApiOperation(value = "编辑社区")
@PostMapping("edit")
public R<Object> editCommunity(@RequestBody @Valid EditCommunityRes editCommunityRes) {
communityService.editCommunity(editCommunityRes);
return R.ok("编辑成功");
}
/** /**
* *
@ -59,15 +75,12 @@ public class CommunityController {
/** /**
* *
*
* @param communityRes
* @return
*/ */
@ApiOperation(value = "添加社区") @ApiOperation(value = "添加社区")
@PostMapping("add") @PostMapping("addCommunity")
public R<Object> addCommunity(@RequestBody @Valid CommunityRes communityRes) { public R<Object> addCommunity(@RequestBody @Valid AddCommunityRes addCommunityRes) {
communityService.addCommunity(communityRes); communityService.addCommunity(addCommunityRes);
return R.ok(); return R.ok("社区添加成功");
} }
/** /**
@ -85,37 +98,32 @@ public class CommunityController {
*/ */
@ApiOperation(value = "退出社区") @ApiOperation(value = "退出社区")
@PostMapping("quit") @PostMapping("quit")
public R<Object> quitCommunity(@ApiParam(value = "租户id", required = true) public R<Object> quitCommunity(@RequestBody @Valid QuitCommunityRes quitCommunityRes) {
@NotNull(message = "租户id不能为空") Long tenantId = quitCommunityRes.getTenantId();
@Valid Long communityId = quitCommunityRes.getCommunityId();
Long tenantId,
@ApiParam(value = "社区id", required = true)
@NotNull(message = "社区id不能为空")
@Valid
Long communityId) {
return communityService.quitCommunity(tenantId, communityId); return communityService.quitCommunity(tenantId, communityId);
} }
//
/** // /**
* // * 删除社区
* // *
* @param id id // * @param id 社区id
* @return // * @return 删除结果
*/ // */
@ApiOperation(value = "删除社区") // @ApiOperation(value = "删除社区")
@GetMapping("delete") // @GetMapping("delete")
public R<Object> deleteCommunity(@NotNull(message = "id不能为空") // public R<Object> deleteCommunity(@NotNull(message = "id不能为空")
@ApiParam(value = "id", required = true) // @ApiParam(value = "id", required = true)
@Valid // @Valid
Long id) { // Long id) {
Community community = communityService.getById(id); // Community community = communityService.getById(id);
if (Objects.isNull(community)) { // if (Objects.isNull(community)) {
return R.fail(HttpStatus.SHOW_ERROR_MSG, "该社区不存在"); // return R.fail(HttpStatus.SHOW_ERROR_MSG, "该社区不存在");
} // }
communityService.removeById(id); // communityService.removeById(id);
return R.ok(); // return R.ok();
} // }
/** /**
* *

View File

@ -11,8 +11,10 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotNull;
/** /**
* *
@ -27,16 +29,6 @@ public class CommunityFileController {
private final CommunityFileLogService communityFileLogService; private final CommunityFileLogService communityFileLogService;
/**
*
*/
@ApiOperation(value = "社区文件上传")
@PostMapping("/upload")
public R<Object> upload(@RequestBody @Valid CommunityUploadFileRes communityUploadFileRes) {
communityFileService.upload(communityUploadFileRes);
return R.ok();
}
/** /**
* *
*/ */
@ -47,5 +39,23 @@ public class CommunityFileController {
} }
/**
*
*/
@ApiOperation(value = "社区文件上传")
@PostMapping("/upload")
public R<String> upload(@RequestBody @Valid CommunityUploadFileRes communityUploadFileRes) {
return communityFileService.upload(communityUploadFileRes);
}
/**
*
*/
@ApiOperation(value = "社区文件下载")
@PostMapping("/download")
public R<String> download(@RequestBody @Valid CommunityDownloadFileRes communityDownloadFileRes) {
return communityFileService.download(communityDownloadFileRes);
}
} }

View File

@ -50,5 +50,25 @@ public class CommunityUserController {
return communityUserService.black(blackListRes); return communityUserService.black(blackListRes);
} }
/**
*
*/
@ApiOperation(value = "取消拉黑")
@PostMapping("unBlack")
public R<Object> unBlack(@RequestBody @Valid UnBlackListRes unBlackListRes) {
return communityUserService.unBlack(unBlackListRes);
}
/**
* /
*/
@ApiOperation(value = "管理/取消管理")
@PostMapping("manage")
public R<Object> manage(@RequestBody @Valid CommunityUserManageRes communityUserManageRes) {
return communityUserService.manage(communityUserManageRes);
}
} }

View File

@ -0,0 +1,52 @@
package com.mcwl.web.controller.communityCenter;
import com.mcwl.common.core.domain.R;
import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.communityCenter.domain.IncomeInfo;
import com.mcwl.communityCenter.domain.dto.*;
import com.mcwl.communityCenter.domain.vo.IncomeInfoVo;
import com.mcwl.communityCenter.service.IncomeInfoService;
import com.mcwl.communityCenter.service.PublishCollectService;
import com.mcwl.communityCenter.service.PublishService;
import com.mcwl.communityCenter.service.QuestionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
*
*/
@Api(tags = "收益明细")
@RestController
@RequiredArgsConstructor
@RequestMapping("incomeInfo")
public class IncomeInfoController {
private final IncomeInfoService incomeInfoService;
/**
*
*/
@ApiOperation(value = "明细列表")
@PostMapping("incomeList")
public TableDataInfo incomeList(@Valid @RequestBody IncomeInfoListPageRes incomeInfoListPageRes) {
return incomeInfoService.incomeList(incomeInfoListPageRes);
}
/**
*
*/
@ApiOperation(value = "社区收益")
@GetMapping("communityIncome")
public R<IncomeInfoVo> communityIncome() {
return incomeInfoService.communityIncome();
}
}

View File

@ -0,0 +1,46 @@
package com.mcwl.web.controller.communityCenter;
import com.mcwl.common.core.domain.R;
import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.communityCenter.domain.dto.MyPublishCollectPageRes;
import com.mcwl.communityCenter.domain.dto.MyPublishPageRes;
import com.mcwl.communityCenter.domain.dto.PersonHomePageRes;
import com.mcwl.communityCenter.domain.dto.QuestionPageRes;
import com.mcwl.communityCenter.service.PublishCollectService;
import com.mcwl.communityCenter.service.PublishService;
import com.mcwl.communityCenter.service.QuestionService;
import com.mcwl.communityCenter.service.impl.PublishCommentLikeServiceImpl;
import com.mcwl.communityCenter.service.impl.PublishServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
/**
*
*/
@Api(tags = "个人主页")
@RestController
@RequiredArgsConstructor
@RequestMapping("personHome")
public class PersonHomeController {
private final PublishService publishService;
/**
*
*/
@PostMapping("getPersonHomeList")
@ApiOperation(value = "个人主页列表")
public TableDataInfo getPersonHomeList(@RequestBody @Valid PersonHomePageRes personHomePageRes) {
return publishService.getPersonHomeList(personHomePageRes);
}
}

View File

@ -6,6 +6,7 @@ import com.mcwl.common.core.domain.R;
import com.mcwl.communityCenter.domain.dto.CommentDelRes; import com.mcwl.communityCenter.domain.dto.CommentDelRes;
import com.mcwl.communityCenter.domain.dto.CommentDetailRes; import com.mcwl.communityCenter.domain.dto.CommentDetailRes;
import com.mcwl.communityCenter.domain.dto.CommentRes; import com.mcwl.communityCenter.domain.dto.CommentRes;
import com.mcwl.communityCenter.domain.vo.CommentVo;
import com.mcwl.communityCenter.service.PublishCommentService; import com.mcwl.communityCenter.service.PublishCommentService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.List;
/** /**
* *
@ -31,12 +33,12 @@ public class PublishCommentController extends BaseController {
/** /**
* *
* *
* @param commentRes * @param commentRes
* @return * @return
*/ */
@ApiOperation(value = "添加评论") @ApiOperation(value = "添加发布评论")
@PostMapping("/save") @PostMapping("/save")
public R<Object> save(@RequestBody @Valid CommentRes commentRes) { public R<Object> save(@RequestBody @Valid CommentRes commentRes) {
@ -52,7 +54,7 @@ public class PublishCommentController extends BaseController {
*/ */
@ApiOperation(value = "获取评论详情") @ApiOperation(value = "获取评论详情")
@PostMapping("/detail") @PostMapping("/detail")
public R<Object> getComment(@RequestBody @Valid CommentDetailRes commentDetailRes) { public R<List<CommentVo>> getComment(@RequestBody @Valid CommentDetailRes commentDetailRes) {
return publishCommentService.getComment(commentDetailRes); return publishCommentService.getComment(commentDetailRes);
} }

View File

@ -1,28 +0,0 @@
package com.mcwl.web.controller.communityCenter;
import com.mcwl.common.core.controller.BaseController;
import com.mcwl.communityCenter.service.PublishCommentLikeService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @AuthorChenYan
* @Projectmcwl-ai
* @Packagecom.mcwl.web.controller.communityCenter
* @FilenamePublishCommissionLikeController
* @Description TODO
* @Date2025/1/17 14:21
*/
@Api(tags = "社群评论区点赞")
@RestController
@RequestMapping("PublishCommissionLike")
public class PublishCommentLikeController extends BaseController {
@Autowired
private PublishCommentLikeService publishCommentLikeService;
}

View File

@ -5,9 +5,7 @@ import com.mcwl.common.constant.HttpStatus;
import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.common.core.domain.R; import com.mcwl.common.core.domain.R;
import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.communityCenter.domain.dto.PublishDetailRes; import com.mcwl.communityCenter.domain.dto.*;
import com.mcwl.communityCenter.domain.dto.PublishPageRes;
import com.mcwl.communityCenter.domain.dto.PublishRes;
import com.mcwl.communityCenter.domain.vo.PublishVo; import com.mcwl.communityCenter.domain.vo.PublishVo;
import com.mcwl.communityCenter.service.PublishService; import com.mcwl.communityCenter.service.PublishService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -106,4 +104,14 @@ public class PublishController {
return R.ok(); return R.ok();
} }
/**
* /
*/
@ApiOperation(value = "收藏/取消收藏")
@PostMapping("collect")
public R<Object> collectPublish(@RequestBody @Valid PublishCollectRes publishCollectRes) {
publishService.collectPublish(publishCollectRes);
return R.ok();
}
} }

View File

@ -0,0 +1,42 @@
package com.mcwl.web.controller.communityCenter;
import com.mcwl.common.core.controller.BaseController;
import com.mcwl.common.core.domain.R;
import com.mcwl.communityCenter.domain.dto.PublishCommentLikeRes;
import com.mcwl.communityCenter.domain.dto.PublishLikeRes;
import com.mcwl.communityCenter.service.PublishCommentLikeService;
import com.mcwl.communityCenter.service.PublishLikeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
/**
*
*/
@Api(tags = "社群发布点赞")
@RestController
@RequiredArgsConstructor
@RequestMapping("PublishLike")
public class PublishLikeController extends BaseController {
private final PublishLikeService publishLikeService;
/**
* /
*/
@PostMapping("/like")
@ApiOperation(value = "点赞/取消点赞")
public R<Object> like(@RequestBody @Valid PublishLikeRes publishLikeRes) {
publishLikeService.like(publishLikeRes);
return R.ok();
}
}

View File

@ -57,6 +57,12 @@ public class QuestionController {
// 付费类型为1时判断钱包余额是否充足 // 付费类型为1时判断钱包余额是否充足
if (Objects.equals(type, 1)) { if (Objects.equals(type, 1)) {
if (amount < 10) {
return R.fail(HttpStatus.SHOW_ERROR_MSG,"付费金额不能小于10");
}
if (amount > 1000) {
return R.fail(HttpStatus.SHOW_ERROR_MSG,"付费金额不能大于1000");
}
Long userId = SecurityUtils.getUserId(); Long userId = SecurityUtils.getUserId();
SysUser sysUser = sysUserService.selectUserById(userId); SysUser sysUser = sysUserService.selectUserById(userId);
Double wallet = sysUser.getWallet(); Double wallet = sysUser.getWallet();

View File

@ -6,6 +6,7 @@ import com.mcwl.memberCenter.domain.Benefit;
import com.mcwl.memberCenter.domain.dto.AddBenefitDto; import com.mcwl.memberCenter.domain.dto.AddBenefitDto;
import com.mcwl.memberCenter.domain.dto.EditBenefitDto; import com.mcwl.memberCenter.domain.dto.EditBenefitDto;
import com.mcwl.memberCenter.domain.vo.BenefitVo; import com.mcwl.memberCenter.domain.vo.BenefitVo;
import com.mcwl.memberCenter.enums.MemberBenefitTypeEnum;
import com.mcwl.memberCenter.service.BenefitService; import com.mcwl.memberCenter.service.BenefitService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -52,6 +53,19 @@ public class BenefitController {
return R.ok(); return R.ok();
} }
/**
* id
*/
@ApiOperation(value = "根据权益名称id查询权益")
@GetMapping("getBenefitByBenefitId")
public R<List<Benefit>> getBenefitByBenefitId(@NotNull(message = "权益名称id不能为空") Long benefitNameId) {
List<Benefit> benefitList = benefitService.lambdaQuery()
.eq(Benefit::getBenefitNameId, benefitNameId)
.list();
return R.ok(benefitList);
}
/** /**
* *
*/ */

View File

@ -1,26 +0,0 @@
package com.mcwl.web.controller.mqtt;
import com.mcwl.common.core.domain.R;
import com.mcwl.myInvitation.domain.vo.CommissionRatioVo;
import com.mcwl.resource.util.MqttTemplate;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController()
@RequiredArgsConstructor
@RequestMapping("/mqtt")
public class MqttController {
private final MqttTemplate mqttTemplate;
@GetMapping("/send")
public void list(String topic, String msg) {
mqttTemplate.publish(topic, msg);
}
}

View File

@ -167,13 +167,6 @@ huawei:
upload: upload:
endPoint: obs.cn-south-1.myhuaweicloud.com endPoint: obs.cn-south-1.myhuaweicloud.com
mqtt:
broker-url: tcp://113.45.190.154:1883
client-id-prefix: emqx-client
connection-timeout: 30
keep-alive-interval: 60
max-reconnect-attempts: 5
clean-session: true
#用户头像与背景 #用户头像与背景
mcwl: mcwl:

View File

@ -108,14 +108,14 @@ token:
# 令牌密钥 # 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期默认30分钟 # 令牌有效期默认30分钟
expireTime: 30 expireTime: 43200
# 公众号配置 # 公众号配置
wechat: wechat:
# 应用ID # 应用ID
appid: wx82d4c3c96f0ffa5b appid: wx0a72f196ec9c3a70
# 应用密钥 # 应用密钥
secret: abbabcf1da711a3bbd95387ec83edcac secret: 11218568b79e2c5eb10459ef8c0374bd
# yml版(application.yml) # yml版(application.yml)
aliyun: aliyun:
@ -137,23 +137,23 @@ mall:
appId: 2021005119630093 appId: 2021005119630093
# 线上应用私钥 # 线上应用私钥
privateKey: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCQuhRU5iHoabfzJS40A+moMKzb5rmi5XbL59K98CW65Oq/rnzQnj6sCYggIXOLCLKUykZ1XIVa+4V7bGFkMDF0236ncPumnVY/tfCSebLyKl+up1mGeH4mAR6ily7nXAhRnXL+A0015bpCa5FCg2ReN68MEmquB/mHfeLqJfRupwzDWnIWxYSKkFCJ0i47KTFYhM93LHHQ8GrZNNaeiJ6q59MruQI83z0HCxN/DzK4Z2rBWGilwPuYcSEa0STPXYhz8XMXUX/Mlp7dd5zyWeNaxkNRWlhKHvhLVPGvteaEcchs476DIWLCRVXEC1372wMKNrKblzRp7Wi5+l+W14k5AgMBAAECggEAHahkPjmivTPc5FC8NSCQI01GPxH6/Ky1OXfaMd4ifTgn+vvQzBeBlFOnt53jRZyUq/T/l1FMaqacZfyBwLw3hlDslXeLuksHv6qTEBEsYH/ad7oHmIzcnQEhvAPrMrIjakYvqGoYynC3SKEudUjjqoMSthCYF+2+bsuXUpBQlNQLqcJ03U+YhfLswwVVujKvAujoLRqDAWeaa0k0y/1Ua4fr5GJq5M+P8TTBRgZlSK5A7Ee6yxMUncZ9W3lTqZtyG0OQLbz9gkr0c63KPisigaOx9eKlCPWFWUWo+zGvQMVijHDTeoJ3dqNmsPtiIE3rDt8anx4a1R7YK6MQ520hAQKBgQDPFMNl4fRmLSOLNShJm/0mBMoIjPmS3+tPBtCiG4oH9F8vYMJWDA1Im0FdgRa2HlCv6hpiVvvQt824RaUYa7XR6aefXKVEWddHvl3utnghMohjK8o8fTmIxADtU5Q2OlWmPdp1v7yDg8yE5P1GlY+AZ3oggxXOIRVtQrNeL7E3iQKBgQCy6nEaUQUCDDts4o7Pn+N402g3/T9Vz/5JtKmDI01EndK5l/yE8CdgGwdiwN1k3la/Nv8P5kaaX2qVcCGoOIQmMNGOxuNfkKCi+bJKdxmFOI4E3iVYT2H6x27QJwNB6bik1i6b2OWT7ckxeB6xMjefNp1u8Qif+vab60OQZSqoMQKBgESRF3Hwsz/xykcZvtFAuT2RcGQMacbcJcnw87v5ambf33SMkUx0iSF1ZttTFvYOa6ET3tCZBKBDe/Z7+QJxB68NstbtkjtjlAjJW8ji2jwDw20y3q/QtvA2Fih++CBMiHeXG3LJnd3eEiYevE5Wz0ExAhspzFqIUdPvtfyFxiQhAoGBAKgc+iGMN3RxIfVx/FbDGe6SVr8lSrnLMlj3VMBQD26GDVcupKwVLCp1uz7jkiQRdtk9R/UcnwK23WOFdVqnoCRygrXx0/wb3ZTFou2tc2Fmfqu8QML19E67zjfwMHNitYjNaAYwi6ewKvg8sjo1wWXs34k7GquYGNjw+w9Wv/pBAoGAUlVHfZ4RncAiiH/x3EDgqmmVikFpLoM2xXxM16nplrjdBE6IzkpgWb/x2ZI6JCMDyoV2kvF6owW2+QEQ81MrHQMtBRpAvd8nI03gXA5VF3uwp4UjfGpoIAGDBrqQv9DM8vx6C6VJNTT5esZWZSw/+PZ4D19l0/n7gICGx3ugw0Q= privateKey: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCQuhRU5iHoabfzJS40A+moMKzb5rmi5XbL59K98CW65Oq/rnzQnj6sCYggIXOLCLKUykZ1XIVa+4V7bGFkMDF0236ncPumnVY/tfCSebLyKl+up1mGeH4mAR6ily7nXAhRnXL+A0015bpCa5FCg2ReN68MEmquB/mHfeLqJfRupwzDWnIWxYSKkFCJ0i47KTFYhM93LHHQ8GrZNNaeiJ6q59MruQI83z0HCxN/DzK4Z2rBWGilwPuYcSEa0STPXYhz8XMXUX/Mlp7dd5zyWeNaxkNRWlhKHvhLVPGvteaEcchs476DIWLCRVXEC1372wMKNrKblzRp7Wi5+l+W14k5AgMBAAECggEAHahkPjmivTPc5FC8NSCQI01GPxH6/Ky1OXfaMd4ifTgn+vvQzBeBlFOnt53jRZyUq/T/l1FMaqacZfyBwLw3hlDslXeLuksHv6qTEBEsYH/ad7oHmIzcnQEhvAPrMrIjakYvqGoYynC3SKEudUjjqoMSthCYF+2+bsuXUpBQlNQLqcJ03U+YhfLswwVVujKvAujoLRqDAWeaa0k0y/1Ua4fr5GJq5M+P8TTBRgZlSK5A7Ee6yxMUncZ9W3lTqZtyG0OQLbz9gkr0c63KPisigaOx9eKlCPWFWUWo+zGvQMVijHDTeoJ3dqNmsPtiIE3rDt8anx4a1R7YK6MQ520hAQKBgQDPFMNl4fRmLSOLNShJm/0mBMoIjPmS3+tPBtCiG4oH9F8vYMJWDA1Im0FdgRa2HlCv6hpiVvvQt824RaUYa7XR6aefXKVEWddHvl3utnghMohjK8o8fTmIxADtU5Q2OlWmPdp1v7yDg8yE5P1GlY+AZ3oggxXOIRVtQrNeL7E3iQKBgQCy6nEaUQUCDDts4o7Pn+N402g3/T9Vz/5JtKmDI01EndK5l/yE8CdgGwdiwN1k3la/Nv8P5kaaX2qVcCGoOIQmMNGOxuNfkKCi+bJKdxmFOI4E3iVYT2H6x27QJwNB6bik1i6b2OWT7ckxeB6xMjefNp1u8Qif+vab60OQZSqoMQKBgESRF3Hwsz/xykcZvtFAuT2RcGQMacbcJcnw87v5ambf33SMkUx0iSF1ZttTFvYOa6ET3tCZBKBDe/Z7+QJxB68NstbtkjtjlAjJW8ji2jwDw20y3q/QtvA2Fih++CBMiHeXG3LJnd3eEiYevE5Wz0ExAhspzFqIUdPvtfyFxiQhAoGBAKgc+iGMN3RxIfVx/FbDGe6SVr8lSrnLMlj3VMBQD26GDVcupKwVLCp1uz7jkiQRdtk9R/UcnwK23WOFdVqnoCRygrXx0/wb3ZTFou2tc2Fmfqu8QML19E67zjfwMHNitYjNaAYwi6ewKvg8sjo1wWXs34k7GquYGNjw+w9Wv/pBAoGAUlVHfZ4RncAiiH/x3EDgqmmVikFpLoM2xXxM16nplrjdBE6IzkpgWb/x2ZI6JCMDyoV2kvF6owW2+QEQ81MrHQMtBRpAvd8nI03gXA5VF3uwp4UjfGpoIAGDBrqQv9DM8vx6C6VJNTT5esZWZSw/+PZ4D19l0/n7gICGx3ugw0Q=
# # 线上应用公钥证书 # 线上应用公钥证书
# appCertPath: /opt/cert/pro/appCertPublicKey_2021005119630093.crt appCertPath: /opt/cert/pro/appCertPublicKey_2021005119630093.crt
# # 线上支付宝公钥证书路径 # 线上支付宝公钥证书路径
# alipayCertPath: /opt/cert/pro/alipayCertPublicKey_RSA2.crt alipayCertPath: /opt/cert/pro/alipayCertPublicKey_RSA2.crt
# # 线上支付宝根证书路径 # 线上支付宝根证书路径
# alipayRootCertPath: /opt/cert/pro/alipayRootCert.crt alipayRootCertPath: /opt/cert/pro/alipayRootCert.crt
# 沙箱应用公钥证书 # # 沙箱应用公钥证书
appCertPath: D:\workspace\mochuang\mcwl-ai\mcwl-admin\src\main\resources\cert\dev\alipayPublicCert.crt # appCertPath: D:\workspace\mochuang\mcwl-ai\mcwl-admin\src\main\resources\cert\dev\alipayPublicCert.crt
# 沙箱支付宝公钥证书路径 # # 沙箱支付宝公钥证书路径
alipayCertPath: D:\workspace\mochuang\mcwl-ai\mcwl-admin\src\main\resources\cert\dev\alipayPublicCert.crt # alipayCertPath: D:\workspace\mochuang\mcwl-ai\mcwl-admin\src\main\resources\cert\dev\alipayPublicCert.crt
# 沙箱支付宝根证书路径 # # 沙箱支付宝根证书路径
alipayRootCertPath: D:\workspace\mochuang\mcwl-ai\mcwl-admin\src\main\resources\cert\dev\alipayRootCert.crt # alipayRootCertPath: D:\workspace\mochuang\mcwl-ai\mcwl-admin\src\main\resources\cert\dev\alipayRootCert.crt
notifyUrl: https://36072a51.r27.cpolar.top/ali/pay/notify notifyUrl: http://113.45.9.111:8080/ali/pay/notify
# 线上支付宝网关 # 线上支付宝网关
gatewayUrl: https://openapi.alipay.com/gateway.do gatewayUrl: https://openapi.alipay.com/gateway.do
# 绑定回调 # 绑定回调
bindUrl: https://36072a51.r27.cpolar.top/ali/pay/callback bindUrl: http://113.45.9.111:8080/ali/pay/callback
# 参与方的标识类型,目前支持如下类型: 1、ALIPAY_USER_ID 支付宝的会员ID 2、ALIPAY_LOGON_ID支付宝登录号支持邮箱和手机号格式 3、ALIPAY_OPEN_ID支付宝openid # 参与方的标识类型,目前支持如下类型: 1、ALIPAY_USER_ID 支付宝的会员ID 2、ALIPAY_LOGON_ID支付宝登录号支持邮箱和手机号格式 3、ALIPAY_OPEN_ID支付宝openid
identityType: ALIPAY_OPEN_ID identityType: ALIPAY_OPEN_ID
# 授权url # 授权url
@ -166,15 +166,6 @@ huawei:
bucketName: mcwl bucketName: mcwl
upload: upload:
endPoint: obs.cn-south-1.myhuaweicloud.com endPoint: obs.cn-south-1.myhuaweicloud.com
mqtt:
broker-url: tcp://192.168.136.128:1883
client-id-prefix: emqx-client
connection-timeout: 30
keep-alive-interval: 60
max-reconnect-attempts: 5
clean-session: true
#用户头像与背景 #用户头像与背景
mcwl: mcwl:
encryptUrl: http://113.45.9.111:9090/encryptAndUpload encryptUrl: http://113.45.9.111:9090/encryptAndUpload

View File

@ -84,7 +84,7 @@ mybatis-plus:
# NONE不启用 PARTIAL只对非嵌套 resultMap 自动映射 FULL对所有 resultMap 自动映射 # NONE不启用 PARTIAL只对非嵌套 resultMap 自动映射 FULL对所有 resultMap 自动映射
autoMappingBehavior: PARTIAL autoMappingBehavior: PARTIAL
# MyBatis 自动映射时未知列或未知属性处理策 # MyBatis 自动映射时未知列或未知属性处理策
# NONE不做处理 WARNING打印相关警告 FAILING抛出异常和详细信息 # NONE不做处理 WARNING打印相关警告 FAILING抛出异常和详细信息.
autoMappingUnknownColumnBehavior: NONE autoMappingUnknownColumnBehavior: NONE
# 更详细的日志输出 会有性能损耗 org.apache.ibatis.logging.stdout.StdOutImpl # 更详细的日志输出 会有性能损耗 org.apache.ibatis.logging.stdout.StdOutImpl
# 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl # 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl

View File

@ -178,7 +178,8 @@ public class Constants
public static final String[] JOB_WHITELIST_STR = { public static final String[] JOB_WHITELIST_STR = {
"com.mcwl.quartz.task", "com.mcwl.quartz.task",
"com.mcwl.memberCenter.task", "com.mcwl.memberCenter.task",
"com.mcwl.pay.task" "com.mcwl.pay.task",
"com.mcwl.communityCenter.task"
}; };
/** /**

View File

@ -51,6 +51,7 @@ public class ObsUtils {
map.put("path",putObjectResult.getObjectUrl()); map.put("path",putObjectResult.getObjectUrl());
map.put("objectKey",putObjectResult.getObjectKey()); map.put("objectKey",putObjectResult.getObjectKey());
map.put("size",multipartFile.getSize()+""); map.put("size",multipartFile.getSize()+"");
map.put("fileName",multipartFile.getOriginalFilename());
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }

View File

@ -0,0 +1,29 @@
package com.mcwl.communityCenter.constant;
/**
*
*/
public class AdviceConstant {
/**
*
*/
public static final int COMMUNITY_NOTICE = 0;
/**
*
*/
public static final int REPLY_ME = 1;
/**
*
*/
public static final int WAIT_ME_ANSWER = 2;
/**
*
*/
public static final int LIKE = 3;
}

View File

@ -28,6 +28,14 @@ public class CommunityAdvice extends BaseEntity {
* id * id
*/ */
private Long communityId; private Long communityId;
/**
*
*/
private Long sendUserId;
/**
* 0 1 2 3
*/
private Integer adviceType;
/** /**
* *
*/ */

View File

@ -7,9 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.mcwl.common.core.domain.BaseEntity; import com.mcwl.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Builder; import lombok.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
/** /**
* *
@ -17,7 +15,8 @@ import lombok.EqualsAndHashCode;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@TableName("cc_community_file") @TableName("cc_community_file")
@Builder @NoArgsConstructor
@AllArgsConstructor
public class CommunityFile extends BaseEntity { public class CommunityFile extends BaseEntity {
@TableId @TableId

View File

@ -43,7 +43,7 @@ public class CommunityUser extends BaseEntity {
private Long userId; private Long userId;
/** /**
* 0 1 * 0 1 2
*/ */
private Integer userType; private Integer userType;
@ -70,7 +70,7 @@ public class CommunityUser extends BaseEntity {
/** /**
* 0 1 * 0 1
*/ */
private String isBlank; private String isBlack;
/** /**
* *
@ -80,6 +80,6 @@ public class CommunityUser extends BaseEntity {
/** /**
* *
*/ */
private Date blankEndTime; private Date blackEndTime;
} }

View File

@ -0,0 +1,44 @@
package com.mcwl.communityCenter.domain;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mcwl.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("cc_income_info")
public class IncomeInfo extends BaseEntity {
@TableId
private Long id;
/**
* id
*/
@TableField(fill = FieldFill.INSERT)
private Long tenantId;
/**
* id
*/
private Long communityId;
/**
* 0 1
*/
private Integer type;
/**
*
*/
private Double amount;
}

View File

@ -46,10 +46,15 @@ public class Publish extends BaseEntity {
private String imageUrl; private String imageUrl;
/** /**
* * url
*/ */
private String fileUrl; private String fileUrl;
/**
*
*/
private String fileName;
/** /**
* *
*/ */

View File

@ -0,0 +1,44 @@
package com.mcwl.communityCenter.domain;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mcwl.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("cc_publish_collect")
public class PublishCollect extends BaseEntity {
@TableId
private Long id;
/**
* id
*/
@TableField(fill = FieldFill.INSERT)
private Long tenantId;
/**
* id
*/
private Long communityId;
/**
* id
*/
private Long publishId;
/**
* id
*/
private Long userId;
}

View File

@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode;
@ApiModel(description = "评论区评论") @ApiModel(description = "评论区评论")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@TableName("cc_comment") @TableName("cc_publish_comment")
public class PublishComment extends BaseEntity { public class PublishComment extends BaseEntity {
/** /**
* id * id
@ -32,10 +32,10 @@ public class PublishComment extends BaseEntity {
@ApiModelProperty(value = "社区id") @ApiModelProperty(value = "社区id")
private Long communityId; private Long communityId;
/** /**
* id * id
*/ */
@ApiModelProperty(value = "运营id") @ApiModelProperty(value = "发布id")
private Long operatorId; private Long publishId;
/** /**
* id * id
*/ */

View File

@ -19,7 +19,7 @@ import lombok.EqualsAndHashCode;
@ApiModel(description = "评论点赞") @ApiModel(description = "评论点赞")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@TableName("cc_comment_like") @TableName("cc_publish_comment_like")
public class PublishCommentLike extends BaseEntity { public class PublishCommentLike extends BaseEntity {
/** /**
@ -29,18 +29,29 @@ public class PublishCommentLike extends BaseEntity {
@ApiModelProperty(value = "评论点赞id") @ApiModelProperty(value = "评论点赞id")
private Long id; private Long id;
/** /**
* id * id
*/ */
@ApiModelProperty(value = "户id") @ApiModelProperty(value = "户id")
private Long userId; private Long tenantId;
/** /**
* id * id
*/ */
@ApiModelProperty(value = "社群id") @ApiModelProperty(value = "社群id")
private Long communityId; private Long communityId;
/**
* id
*/
@ApiModelProperty(value = "发布id")
private Long publishId;
/** /**
* id * id
*/ */
@ApiModelProperty(value = "评论id") @ApiModelProperty(value = "评论id")
private Long publishCommentId; private Long publishCommentId;
/**
* id
*/
@ApiModelProperty(value = "用户id")
private Long userId;
} }

View File

@ -0,0 +1,49 @@
package com.mcwl.communityCenter.domain;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mcwl.common.core.domain.BaseEntity;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
*
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Builder
@TableName("cc_publish_like")
public class PublishLike extends BaseEntity {
@TableId
private Long id;
/**
* id - id
*/
@TableField(fill = FieldFill.INSERT)
private Long tenantId;
/**
* id
*/
private Long communityId;
/**
* id
*/
private Long publishId;
/**
* id
*/
private Long userId;
}

View File

@ -53,18 +53,6 @@ public class Question extends BaseEntity {
*/ */
private String questionUrl; private String questionUrl;
// /**
// * 回复内容
// */
// @ApiModelProperty(value = "答复内容")
// private String reply;
//
// /**
// * 回复时间
// */
// @ApiModelProperty(value = "答复时间")
// private Date replyTime;
/** /**
* *
*/ */

View File

@ -1,6 +1,5 @@
package com.mcwl.communityCenter.domain.dto; package com.mcwl.communityCenter.domain.dto;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -13,7 +12,7 @@ import javax.validation.constraints.NotNull;
*/ */
@Data @Data
@ApiModel(value = "社区请求参数") @ApiModel(value = "社区请求参数")
public class CommunityRes { public class AddCommunityRes {
/** /**
@ -57,6 +56,12 @@ public class CommunityRes {
@NotNull(message = "有效期天数") @NotNull(message = "有效期天数")
private Integer validityDay; private Integer validityDay;
/**
*
*/
@ApiModelProperty(value = "描述")
private String description;
} }

View File

@ -14,6 +14,12 @@ import javax.validation.constraints.NotNull;
@Data @Data
@ApiModel(value = "拉黑请求参数") @ApiModel(value = "拉黑请求参数")
public class BlackListRes { public class BlackListRes {
/**
* id
*/
@ApiModelProperty(value = "租户id", required = true)
@NotNull(message = "租户id不能为空")
private Long tenantId;
/** /**
* id * id

View File

@ -0,0 +1,24 @@
package com.mcwl.communityCenter.domain.dto;
import com.mcwl.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "社区通知列表分页请求参数")
public class CommunityAdvicePageRes extends PageDomain {
/**
* 0 1 2 3
*/
@ApiModelProperty(value = "通知类型 0社区通知 1回复我的 2待我回复 3点赞")
private Integer adviceType;
}

View File

@ -0,0 +1,33 @@
package com.mcwl.communityCenter.domain.dto;
import com.mcwl.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotNull;
/**
*
*/
@Data
@ApiModel(value = "社区详情请求参数")
public class CommunityDetailRes {
/**
* id
*/
@ApiModelProperty(value = "租户id", required = true)
@NotNull(message = "租户id不能为空")
private Long tenantId;
/**
* id
*/
@ApiModelProperty(value = "社区id", required = true)
@NotNull(message = "社区id不能为空")
private Long communityId;
}

View File

@ -0,0 +1,41 @@
package com.mcwl.communityCenter.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
*
*/
@Data
@ApiModel(value = "社区文件下载请求参数")
public class CommunityDownloadFileRes {
/**
* id
*/
@ApiModelProperty(value = "租户id", required = true)
@NotNull(message = "租户id不能为空")
private Long tenantId;
/**
* id
*/
@ApiModelProperty(value = "社区id", required = true)
@NotNull(message = "社区id不能为空")
private Long communityId;
/**
* id
*/
@ApiModelProperty(value = "文件id", required = true)
@NotNull(message = "文件id不能为空")
private Long fileId;
}

View File

@ -10,10 +10,10 @@ import org.springframework.web.multipart.MultipartFile;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
/** /**
* *
*/ */
@Data @Data
@ApiModel(value = "社区请求参数") @ApiModel(value = "社区文件列表请求参数")
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class CommunityFilePageListRes extends PageDomain { public class CommunityFilePageListRes extends PageDomain {

View File

@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
/** /**
@ -29,11 +30,32 @@ public class CommunityUploadFileRes {
private Long communityId; private Long communityId;
/** /**
* * url
*/ */
@ApiModelProperty(value = "文件", required = true) @ApiModelProperty(value = "文件url", required = true)
@NotNull(message = "文件不能为空") @NotBlank(message = "文件url不能为空")
private MultipartFile file; private String fileUrl;
/**
* key
*/
@ApiModelProperty(value = "文件对象key", required = true)
@NotBlank(message = "文件对象key不能为空")
private String objectKey;
/**
*
*/
@ApiModelProperty(value = "文件名", required = true)
@NotBlank(message = "文件名不能为空")
private String fileName;
/**
*
*/
@ApiModelProperty(value = "文件大小", required = true)
@NotNull(message = "文件大小不能为空")
private Long fileSize;

View File

@ -15,6 +15,12 @@ import javax.validation.constraints.NotNull;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value = "社区用户列表分页请求参数") @ApiModel(value = "社区用户列表分页请求参数")
public class CommunityUserListPageRes extends PageDomain { public class CommunityUserListPageRes extends PageDomain {
/**
* id
*/
@ApiModelProperty(value = "租户id", required = true)
@NotNull(message = "租户id不能为空")
private Long tenantId;
/** /**
* id * id

View File

@ -0,0 +1,35 @@
package com.mcwl.communityCenter.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* /
*/
@Data
@ApiModel(value = "管理/取消管理请求参数")
public class CommunityUserManageRes {
/**
* id
*/
@ApiModelProperty(value = "租户id", required = true)
@NotNull(message = "租户id不能为空")
private Long tenantId;
/**
* id
*/
@ApiModelProperty(value = "社区id", required = true)
@NotNull(message = "社区id不能为空")
private Long communityId;
/**
* id
*/
@ApiModelProperty(value = "用户id", required = true)
@NotNull(message = "用户id不能为空")
private Long userId;
}

View File

@ -0,0 +1,74 @@
package com.mcwl.communityCenter.domain.dto;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.mcwl.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
*
*/
@Data
@ApiModel(value = "编辑社区参数")
public class EditCommunityRes {
@ApiModelProperty(value = "社区id", required = true)
@NotNull(message = "社区id不能为空")
private Long id;
/**
*
*/
@ApiModelProperty(value = "社区图片")
private String imageUrl;
/**
*
*/
@ApiModelProperty(value = "社区名称", required = true)
@NotBlank(message = "社区名称不能为空")
private String communityName;
/**
*
*/
@ApiModelProperty(value = "描述")
private String description;
/**
* id
*/
@ApiModelProperty(value = "社区标签", required = true)
@NotNull(message = "社区标签不能为空")
private Integer communityTag;
/**
* 0 1
*/
@ApiModelProperty(value = "社区类型", required = true)
@NotNull(message = "社区类型不能为空")
private Integer type;
/**
*
*/
@ApiModelProperty(value = "价格", required = true)
@NotNull(message = "价格不能为空")
private Double price;
/**
*
*/
@ApiModelProperty(value = "有效期天数", required = true)
@NotNull(message = "有效期天数")
private Integer validityDay;
}

View File

@ -0,0 +1,32 @@
package com.mcwl.communityCenter.domain.dto;
import com.mcwl.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotNull;
/**
*
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "收益明细请求参数")
public class IncomeInfoListPageRes extends PageDomain {
/**
*
*/
@ApiModelProperty(value = "搜索内容")
private String searchContent;
/**
*
*/
@ApiModelProperty(value = "收益类型")
private Integer type;
}

View File

@ -0,0 +1,27 @@
package com.mcwl.communityCenter.domain.dto;
import com.mcwl.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotNull;
/**
*
*/
@Data
@ApiModel(value = "收益明细请求参数")
public class IncomeInfoRes {
@NotNull(message = "社区id不能为空")
@ApiModelProperty(value = "社区id", required = true)
private Long communityId;
@NotNull(message = "租户id不能为空")
@ApiModelProperty(value = "租户id", required = true)
private Long tenantId;
}

View File

@ -14,6 +14,12 @@ import lombok.EqualsAndHashCode;
@ApiModel(value = "社区列表分页请求参数") @ApiModel(value = "社区列表分页请求参数")
public class JoinCommunityListPageRes extends PageDomain { public class JoinCommunityListPageRes extends PageDomain {
/**
* 0 1
*/
@ApiModelProperty(value = "是否包含我创建的社区 0否 1是 默认0")
private Integer isMyCreate = 0;
/** /**
* *
*/ */

View File

@ -0,0 +1,40 @@
package com.mcwl.communityCenter.domain.dto;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mcwl.common.core.domain.BaseEntity;
import com.mcwl.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotNull;
/**
*
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "我的发布分页请求参数")
public class MyPublishCollectPageRes extends PageDomain {
/**
* id
*/
@NotNull(message = "租户id不能为空")
@ApiModelProperty(value = "租户id", required = true)
private Long tenantId;
/**
* id
*/
@NotNull(message = "社区id不能为空")
@ApiModelProperty(value = "社区id", required = true)
private Long communityId;
}

View File

@ -0,0 +1,28 @@
package com.mcwl.communityCenter.domain.dto;
import com.mcwl.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotNull;
/**
*
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "我的发布分页请求参数")
public class MyPublishPageRes extends PageDomain {
@NotNull(message = "社区id不能为空")
@ApiModelProperty(value = "社区id", required = true)
private Long communityId;
@NotNull(message = "租户id不能为空")
@ApiModelProperty(value = "租户id", required = true)
private Long tenantId;
}

View File

@ -0,0 +1,41 @@
package com.mcwl.communityCenter.domain.dto;
import com.mcwl.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotNull;
/**
*
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "个人主页分页请求参数")
public class PersonHomePageRes extends PageDomain {
/**
* id
*/
@NotNull(message = "租户id不能为空")
@ApiModelProperty(value = "租户id", required = true)
private Long tenantId;
/**
* id
*/
@NotNull(message = "社区id不能为空")
@ApiModelProperty(value = "社区id", required = true)
private Long communityId;
/**
* 0 1 2
*/
@NotNull(message = "类型不能为空")
@ApiModelProperty(value = "类型 0 我的发布 1 我的问答 2 我的收藏", required = true)
private Integer type;
}

View File

@ -0,0 +1,40 @@
package com.mcwl.communityCenter.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
/**
* /
*/
@Data
@ApiModel(value = "收藏/取消收藏请求参数")
@NoArgsConstructor
@AllArgsConstructor
public class PublishCollectRes {
/**
* id
*/
@ApiModelProperty(value = "用户id", required = true)
@NotNull(message = "用户id不能为空")
private Long tenantId;
/**
* id
*/
@ApiModelProperty(value = "社区id", required = true)
@NotNull(message = "社区id不能为空")
private Long communityId;
/**
* id
*/
@ApiModelProperty(value = "发布id", required = true)
@NotNull(message = "发布id不能为空")
private Long publishId;
}

View File

@ -0,0 +1,44 @@
package com.mcwl.communityCenter.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* /
*/
@Data
@ApiModel(value = "点赞/取消点赞请求参数")
public class PublishCommentLikeRes {
/**
* id
*/
@ApiModelProperty(value = "用户id", required = true)
@NotNull(message = "用户id不能为空")
private Long tenantId;
/**
* id
*/
@ApiModelProperty(value = "社区id", required = true)
@NotNull(message = "社区id不能为空")
private Long communityId;
/**
* id
*/
@ApiModelProperty(value = "发布id", required = true)
@NotNull(message = "发布id不能为空")
private Long publishId;
/**
* id
*/
@ApiModelProperty(value = "评论id", required = true)
@NotNull(message = "评论id不能为空")
private Long commentId;
}

View File

@ -2,25 +2,29 @@ package com.mcwl.communityCenter.domain.dto;
import com.mcwl.common.core.page.PageDomain; import com.mcwl.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
/**
*
*/
@Data @Data
@ApiModel(value = "发布详情请求参数") @ApiModel(value = "发布详情请求参数")
public class PublishDetailRes { public class PublishDetailRes {
@ApiParam(value = "发布id", required = true) @ApiModelProperty(value = "发布id", required = true)
@NotNull(message = "发布id不能为空") @NotNull(message = "发布id不能为空")
private Long id; private Long publishId;
@ApiParam(value = "租户id", required = true) @ApiModelProperty(value = "租户id", required = true)
@NotNull(message = "租户id不能为空") @NotNull(message = "租户id不能为空")
private Long tenantId; private Long tenantId;
@ApiParam(value = "社区id", required = true) @ApiModelProperty(value = "社区id", required = true)
@NotNull(message = "社区id不能为空") @NotNull(message = "社区id不能为空")
private Long communityId; private Long communityId;

View File

@ -0,0 +1,40 @@
package com.mcwl.communityCenter.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
/**
* /
*/
@Data
@ApiModel(value = "点赞/取消点赞请求参数")
@NoArgsConstructor
@AllArgsConstructor
public class PublishLikeRes {
/**
* id
*/
@ApiModelProperty(value = "用户id", required = true)
@NotNull(message = "用户id不能为空")
private Long tenantId;
/**
* id
*/
@ApiModelProperty(value = "社区id", required = true)
@NotNull(message = "社区id不能为空")
private Long communityId;
/**
* id
*/
@ApiModelProperty(value = "发布id", required = true)
@NotNull(message = "发布id不能为空")
private Long publishId;
}

View File

@ -15,15 +15,14 @@ import javax.validation.constraints.NotNull;
public class PublishPageRes extends PageDomain { public class PublishPageRes extends PageDomain {
@NotNull(message = "社区id不能为空") @NotNull(message = "社区id不能为空")
@ApiParam(value = "社区id", required = true) @ApiModelProperty(value = "社区id", required = true)
private Long communityId; private Long communityId;
@NotNull(message = "租户id不能为空") @NotNull(message = "租户id不能为空")
@ApiParam(value = "租户id", required = true) @ApiModelProperty(value = "租户id", required = true)
private Long tenantId; private Long tenantId;
@NotNull(message = "类型不能为空") @ApiModelProperty(value = "类型 0只看星主 1精选", required = true)
@ApiParam(value = "类型 0只看星主 1精选 2问答", required = true)
private Integer type; private Integer type;
} }

View File

@ -39,11 +39,17 @@ public class PublishRes {
private String imageUrl; private String imageUrl;
/** /**
* * url
*/ */
@ApiModelProperty(value = "发布文件") @ApiModelProperty(value = "文件url")
private String fileUrl; private String fileUrl;
/**
*
*/
@ApiModelProperty(value = "文件名")
private String fileName;
/** /**
* - * -
*/ */

View File

@ -29,6 +29,13 @@ public class QuestionRes {
@ApiModelProperty(value = "社区ID", required = true, position = 1) @ApiModelProperty(value = "社区ID", required = true, position = 1)
private Long communityId; private Long communityId;
/**
*
*/
@NotNull(message = "提问用户id不能为空")
@ApiModelProperty(value = "提问用户id", required = true, position = 2)
private Long questionUserId;
/** /**
* *
*/ */

View File

@ -0,0 +1,29 @@
package com.mcwl.communityCenter.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* 退
*/
@Data
@ApiModel(value = "退出社区请求参数")
public class QuitCommunityRes {
@ApiModelProperty(value = "租户id", required = true)
@NotNull(message = "租户id不能为空")
private Long tenantId;
@ApiModelProperty(value = "社区id", required = true)
@NotNull(message = "社区id不能为空")
private Long communityId;
}

View File

@ -0,0 +1,36 @@
package com.mcwl.communityCenter.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
*
*/
@Data
@ApiModel(value = "取消拉黑请求参数")
public class UnBlackListRes {
/**
* id
*/
@ApiModelProperty(value = "租户id", required = true)
@NotNull(message = "租户id不能为空")
private Long tenantId;
/**
* id
*/
@ApiModelProperty(value = "社区id", required = true)
@NotNull(message = "社区id不能为空")
private Long communityId;
/**
* id
*/
@ApiModelProperty(value = "拉黑用户id", required = true)
@NotNull(message = "拉黑用户id不能为空")
private Long userId;
}

View File

@ -27,6 +27,18 @@ public class CommentVo {
@ApiModelProperty(value = "评论id") @ApiModelProperty(value = "评论id")
private Long id; private Long id;
/**
* id
*/
@ApiModelProperty(value = "租户id")
private Long tenantId;
/**
* id
*/
@ApiModelProperty(value = "社区id")
private Long communityId;
/** /**
* id * id
*/ */
@ -45,6 +57,12 @@ public class CommentVo {
@ApiModelProperty(value = "用户头像") @ApiModelProperty(value = "用户头像")
private String userAvatar; private String userAvatar;
/**
* id
*/
@ApiModelProperty(value = "父评论id")
private Long parentId;
/** /**
* *
*/ */

View File

@ -0,0 +1,74 @@
package com.mcwl.communityCenter.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
*
*/
@Data
@ApiModel(value = "社区通知返回数据")
public class CommunityAdviceVo {
/**
* id
*/
@ApiModelProperty(value = "社区id")
private Long id;
/**
* id
*/
@ApiModelProperty(value = "租户id")
private Long tenantId;
/**
*
*/
@ApiModelProperty(value = "发送人")
private Long sendUserId;
/**
*
*/
@ApiModelProperty(value = "发送人名称")
private String sendUserName;
/**
*
*/
@ApiModelProperty(value = "发送人头像")
private String sendUserAvatar;
/**
*
*/
@ApiModelProperty(value = "标题")
private String title;
/**
*
*/
@ApiModelProperty(value = "内容")
private String content;
/**
*
*/
@ApiModelProperty(value = "是否已读")
private Integer isRead;
/**
*
*/
@ApiModelProperty(value = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
}

View File

@ -5,13 +5,65 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/** /**
* *
*/ */
@Data @Data
@ApiModel(value = "社区详情返回数据") @ApiModel(value = "社区详情返回数据")
public class CommunityDetailVo { public class CommunityDetailVo {
/**
* id
*/
@ApiModelProperty(value = "社区id")
private Long id;
/**
*
*/
@ApiModelProperty(value = "社区图片")
private String imageUrl;
/**
*
*/
@ApiModelProperty(value = "社区名称")
private String communityName;
/**
* id
*/
@ApiModelProperty(value = "社区标签")
@NotNull(message = "社区标签不能为空")
private Integer communityTag;
/**
*
*/
@ApiModelProperty(value = "社区类型 0免费 1付费")
@NotNull(message = "社区类型不能为空")
private Integer type;
/**
*
*/
@ApiModelProperty(value = "价格")
@NotNull(message = "价格不能为空")
private Double price;
/**
*
*/
@ApiModelProperty(value = "有效期天数")
@NotNull(message = "有效期天数")
private Integer validityDay;
/**
*
*/
@ApiModelProperty(value = "描述")
private String description;
} }

View File

@ -34,12 +34,6 @@ public class CommunityFileVo {
@ApiModelProperty(value = "社区id") @ApiModelProperty(value = "社区id")
private Long communityId; private Long communityId;
/**
*
*/
@ApiModelProperty(value = "文件路径")
private String fileUrl;
/** /**
* *
*/ */

View File

@ -39,6 +39,12 @@ public class CommunityUserVo {
@ApiModelProperty(value = "用户id") @ApiModelProperty(value = "用户id")
private Long userId; private Long userId;
/**
* 0 1 2
*/
@ApiModelProperty(value = "用户类型 0成员 1管理员 2群主")
private Integer userType;
/** /**
* *
*/ */
@ -51,6 +57,12 @@ public class CommunityUserVo {
@ApiModelProperty(value = "用户昵称") @ApiModelProperty(value = "用户昵称")
private String nickName; private String nickName;
/**
*
*/
@ApiModelProperty(value = "是否拉黑")
private String isBlack;
/** /**
* *
@ -65,13 +77,6 @@ public class CommunityUserVo {
@ApiModelProperty(value = "首次加入时间") @ApiModelProperty(value = "首次加入时间")
private Date startTime; private Date startTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@ApiModelProperty(value = "最后活动时间")
private Date loginDate;
/** /**
* *
*/ */

View File

@ -21,6 +21,18 @@ public class CommunityVo {
@ApiModelProperty(value = "社区id") @ApiModelProperty(value = "社区id")
private Long id; private Long id;
/**
* id
*/
@ApiModelProperty(value = "租户id")
private Long tenantId;
/**
*
*/
@ApiModelProperty(value = "用户类型")
private Integer userType;
/** /**
* *
*/ */

View File

@ -0,0 +1,28 @@
package com.mcwl.communityCenter.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* vo
*/
@Data
@ApiModel(description = "收益金额")
public class IncomeAmountVo {
/**
*
*/
@ApiModelProperty(value = "今日收益")
private Double todayIncome;
/**
*
*/
@ApiModelProperty(value = "昨日收益")
private Double yesterdayIncome;
}

View File

@ -0,0 +1,58 @@
package com.mcwl.communityCenter.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import java.util.Date;
/**
* vo
*/
@Data
@Builder
@ApiModel(description = "收益列表vo")
public class IncomeInfoListVo {
/**
*
*/
@ApiModelProperty(value = "用户名称")
private String userName;
/**
*
*/
@ApiModelProperty(value = "用户头像")
private String avatar;
/**
*
*/
@ApiModelProperty(value = "社区名称")
private String communityName;
/**
*
*/
@ApiModelProperty(value = "收益类型")
private Integer type;
/**
*
*/
@ApiModelProperty(value = "收益金额")
private Double amount;
/**
*
*/
@ApiModelProperty(value = "收益时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
}

View File

@ -0,0 +1,38 @@
package com.mcwl.communityCenter.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import java.util.Date;
/**
* vo
*/
@Data
@Builder
@ApiModel(description = "收益vo")
public class IncomeInfoVo {
/**
*
*/
@ApiModelProperty(value = "社区收益")
private IncomeAmountVo communityIncome;
/**
*
*/
@ApiModelProperty(value = "问答收益")
private IncomeAmountVo questionIncome;
/**
*
*/
@ApiModelProperty(value = "累计收益")
private Double totalIncome;
}

View File

@ -0,0 +1,92 @@
package com.mcwl.communityCenter.domain.vo;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mcwl.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.List;
/**
* vo
*/
@Data
@ApiModel(description = "个人中心vo")
public class PersonHomeVo {
@ApiModelProperty(value = "id")
private Long id;
/**
* id
*/
@ApiModelProperty(value = "租户id")
private Long tenantId;
/**
* id
*/
@ApiModelProperty(value = "社区id")
private Long communityId;
/**
*
*/
@ApiModelProperty(value = "内容")
private String content;
/**
* url
*/
@ApiModelProperty(value = "文件url")
private String fileUrl;
/**
*
*/
@ApiModelProperty(value = "文件名")
private String fileName;
/**
* url
*/
@ApiModelProperty(value = "图片url")
private String imageUrl;
/**
*
*/
@ApiModelProperty(value = "点赞数")
private Integer likeNum;
/**
*
*/
@ApiModelProperty(value = "是否收藏")
private Integer isCollect;
/**
*
*/
@ApiModelProperty(value = "评论")
private List<CommentVo> commentList;
/**
*
*/
@ApiModelProperty(value = "创建时间")
private Date createTime;
}

View File

@ -1,5 +1,6 @@
package com.mcwl.communityCenter.domain.vo; package com.mcwl.communityCenter.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -63,16 +64,22 @@ public class PublishVo {
private String imageUrl; private String imageUrl;
/** /**
* * url
*/ */
@ApiModelProperty(value = "发布文件") @ApiModelProperty(value = "文件url")
private String fileUrl; private String fileUrl;
/** /**
* - *
*/ */
@ApiModelProperty(value = "发布时间 - 定时发布") @ApiModelProperty(value = "文件名")
private Date publishTime; private String fileName;
/**
*
*/
@ApiModelProperty(value = "是否点赞")
private Integer isLike;
/** /**
* *
@ -92,6 +99,16 @@ public class PublishVo {
@ApiModelProperty(value = "精选") @ApiModelProperty(value = "精选")
private Integer isElite; private Integer isElite;
/**
*
*/
@ApiModelProperty(value = "收藏")
private Integer isCollect;
@ApiModelProperty(value = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
} }

View File

@ -21,20 +21,36 @@ public class CustomTenantHandler implements TenantLineHandler {
* . * .
*/ */
static { static {
// 通知表
tables.add("cc_advice");
// 发布评论表 // 发布评论表
tables.add("cc_comment"); tables.add("cc_comment");
// 评论点赞表
tables.add("cc_comment_like");
// 社区表 // 社区表
tables.add("cc_community"); tables.add("cc_community");
// 社区文件表
tables.add("cc_community_file");
// 社区文件下载记录表
tables.add("cc_community_file_log");
// 社区用户表
tables.add("cc_community_user");
// 收益明细
tables.add("cc_income_info");
// 邀请表 // 邀请表
tables.add("cc_invite"); tables.add("cc_invite");
// 发布表 // 发布表
tables.add("cc_publish"); tables.add("cc_publish");
// 收藏表
tables.add("cc_publish_collect");
// 发布点赞表
tables.add("cc_publish_like");
// 提问表 // 提问表
tables.add("cc_question"); tables.add("cc_question");
// 提问评论表 // 提问评论表
tables.add("cc_question_comment"); tables.add("cc_question_comment");
// 社区用户表
tables.add("cc_community_user");
// 输出表名 // 输出表名
log.info("多租户表:{}", tables); log.info("多租户表:{}", tables);

View File

@ -1,10 +1,20 @@
package com.mcwl.communityCenter.mapper; package com.mcwl.communityCenter.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.communityCenter.domain.Community; import com.mcwl.communityCenter.domain.Community;
import com.mcwl.communityCenter.domain.CommunityAdvice; import com.mcwl.communityCenter.domain.CommunityAdvice;
import com.mcwl.communityCenter.domain.dto.CommunityAdvicePageRes;
import com.mcwl.communityCenter.domain.vo.CommunityAdviceVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper @Mapper
public interface CommunityAdviceMapper extends BaseMapper<CommunityAdvice> { public interface CommunityAdviceMapper extends BaseMapper<CommunityAdvice> {
List<CommunityAdviceVo> getCommunityAdviceList(Page<CommunityAdvice> page,
@Param("communityAdvicePageRes") CommunityAdvicePageRes communityAdvicePageRes);
} }

View File

@ -21,5 +21,10 @@ public interface CommunityFileLogMapper extends BaseMapper<CommunityFileLog> {
Long communityFileId); Long communityFileId);
@InterceptorIgnore(tenantLine = "true") @InterceptorIgnore(tenantLine = "true")
Integer getDownloadCount(Long tenantId, Long communityId, Long communityFileId); Integer getDownloadCount(@Param("tenantId") Long tenantId,
@Param("communityId") Long communityId,
@Param("communityFileId") Long communityFileId);
@InterceptorIgnore(tenantLine = "true")
void saveCommunityFileLog(@Param("communityFileLog") CommunityFileLog communityFileLog);
} }

View File

@ -20,4 +20,9 @@ public interface CommunityFileMapper extends BaseMapper<CommunityFile> {
@InterceptorIgnore(tenantLine = "true") @InterceptorIgnore(tenantLine = "true")
List<CommunityFileVo> getCommunityFileList(Page<CommunityFile> page, @Param("communityFilePageListRes") CommunityFilePageListRes communityFilePageListRes); List<CommunityFileVo> getCommunityFileList(Page<CommunityFile> page, @Param("communityFilePageListRes") CommunityFilePageListRes communityFilePageListRes);
@InterceptorIgnore(tenantLine = "true")
CommunityFile selectCommunityFile(@Param("tenantId") Long tenantId,
@Param("communityId") Long communityId,
@Param("fileId") Long fileId);
} }

View File

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.communityCenter.domain.Community; import com.mcwl.communityCenter.domain.Community;
import com.mcwl.communityCenter.domain.dto.EditCommunityRes;
import com.mcwl.communityCenter.domain.dto.JoinCommunityListPageRes;
import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -53,12 +55,14 @@ public interface CommunityMapper extends BaseMapper<Community> {
Page<Community> page, Page<Community> page,
@Param("userId") @Param("userId")
Long userId, Long userId,
@Param("searchContent") @Param("joinCommunityListPageRes")
String searchContent); JoinCommunityListPageRes joinCommunityListPageRes);
@InterceptorIgnore(tenantLine = "true") @InterceptorIgnore(tenantLine = "true")
void quitCommunity(Long tenantId, Long communityId, Long userId); void quitCommunity(@Param("tenantId") Long tenantId,
@Param("communityId") Long communityId,
@Param("userId") Long userId);
@InterceptorIgnore(tenantLine = "true") @InterceptorIgnore(tenantLine = "true")
void deleteCommunity(Long tenantId, Long communityId); void deleteCommunity(@Param("tenantId") Long tenantId, @Param("communityId") Long communityId);
} }

View File

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.communityCenter.domain.Community; import com.mcwl.communityCenter.domain.Community;
import com.mcwl.communityCenter.domain.CommunityUser; import com.mcwl.communityCenter.domain.CommunityUser;
import com.mcwl.communityCenter.domain.dto.CommunityUserListPageRes; import com.mcwl.communityCenter.domain.dto.CommunityUserListPageRes;
import com.mcwl.communityCenter.domain.dto.UnBlackListRes;
import com.mcwl.communityCenter.domain.vo.CommunityUserVo; import com.mcwl.communityCenter.domain.vo.CommunityUserVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -23,7 +24,7 @@ public interface CommunityUserMapper extends BaseMapper<CommunityUser> {
@Param("userId") Long userId); @Param("userId") Long userId);
@InterceptorIgnore(tenantLine = "true") @InterceptorIgnore(tenantLine = "true")
Integer getJoinNum(Long tenantId, Long communityId); Integer getJoinNum(@Param("tenantId") Long tenantId, @Param("communityId") Long communityId);
@InterceptorIgnore(tenantLine = "true") @InterceptorIgnore(tenantLine = "true")
int isJoinCommunity(@Param("tenantId") int isJoinCommunity(@Param("tenantId")
@ -37,4 +38,17 @@ public interface CommunityUserMapper extends BaseMapper<CommunityUser> {
List<CommunityUserVo> getCommunityUserList(Page<CommunityUser> page, List<CommunityUserVo> getCommunityUserList(Page<CommunityUser> page,
@Param("communityUserListPageRes") @Param("communityUserListPageRes")
CommunityUserListPageRes communityUserListPageRes); CommunityUserListPageRes communityUserListPageRes);
@InterceptorIgnore(tenantLine = "true")
CommunityUser selectCommunityUser(@Param("tenantId") Long tenantId,
@Param("communityId") Long communityId,
@Param("userId") Long userId);
@InterceptorIgnore(tenantLine = "true")
void updateBlackCommunityUser(@Param("blackCommunityUser") CommunityUser blackCommunityUser);
@InterceptorIgnore(tenantLine = "true")
List<CommunityUser> getAllCommunityUser();
void updateManageCommunityUser(@Param("manageCommunityUser") CommunityUser manageCommunityUser);
} }

View File

@ -0,0 +1,34 @@
package com.mcwl.communityCenter.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.communityCenter.domain.IncomeInfo;
import com.mcwl.communityCenter.domain.PublishCollect;
import com.mcwl.communityCenter.domain.dto.IncomeInfoListPageRes;
import com.mcwl.communityCenter.domain.dto.IncomeInfoRes;
import com.mcwl.communityCenter.domain.dto.MyPublishCollectPageRes;
import com.mcwl.communityCenter.domain.vo.IncomeAmountVo;
import com.mcwl.communityCenter.domain.vo.IncomeInfoListVo;
import com.mcwl.communityCenter.domain.vo.PublishVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface IncomeInfoMapper extends BaseMapper<IncomeInfo> {
@InterceptorIgnore(tenantLine = "true")
IncomeAmountVo communityIncome(@Param("userId") Long userId);
@InterceptorIgnore(tenantLine = "true")
IncomeAmountVo questionIncome(@Param("userId") Long userId);
Double totalIncome();
@InterceptorIgnore(tenantLine = "true")
List<IncomeInfoListVo> incomeList(Page<IncomeInfo> page,
@Param("incomeInfoListPageRes") IncomeInfoListPageRes incomeInfoListPageRes,
@Param("userId") Long userId);
}

View File

@ -38,5 +38,7 @@ public interface InviteMapper extends BaseMapper<Invite> {
* @return * @return
*/ */
@InterceptorIgnore(tenantLine = "true") @InterceptorIgnore(tenantLine = "true")
Invite selectByTenantIdAndCommunityIdAndInviteeUserId(Long tenantId, Long communityId, Long inviteeUserId); Invite selectByTenantIdAndCommunityIdAndInviteeUserId(@Param("tenantId") Long tenantId,
@Param("communityId") Long communityId,
@Param("inviteeUserId") Long inviteeUserId);
} }

View File

@ -0,0 +1,35 @@
package com.mcwl.communityCenter.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.communityCenter.domain.Publish;
import com.mcwl.communityCenter.domain.PublishCollect;
import com.mcwl.communityCenter.domain.dto.MyPublishCollectPageRes;
import com.mcwl.communityCenter.domain.dto.PublishCollectRes;
import com.mcwl.communityCenter.domain.dto.PublishPageRes;
import com.mcwl.communityCenter.domain.vo.PublishVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface PublishCollectMapper extends BaseMapper<PublishCollect> {
@InterceptorIgnore(tenantLine = "true")
List<PublishVo> myCollectList(Page<PublishCollect> page,
@Param("myPublishCollectPageRes") MyPublishCollectPageRes myPublishCollectPageRes,
@Param("userId") Long userId);
@InterceptorIgnore(tenantLine = "true")
void savePublishCollect(@Param("publishCollect") PublishCollect publishCollect);
@InterceptorIgnore(tenantLine = "true")
PublishCollect getPublishCollect(@Param("publishCollectRes") PublishCollectRes publishCollectRes,
@Param("userId") Long userId);
@InterceptorIgnore(tenantLine = "true")
void updatePublishCollect(@Param("publishCollect") PublishCollect publishCollect);
}

View File

@ -1,8 +1,13 @@
package com.mcwl.communityCenter.mapper; package com.mcwl.communityCenter.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mcwl.communityCenter.domain.PublishCommentLike; import com.mcwl.communityCenter.domain.PublishCommentLike;
import com.mcwl.communityCenter.domain.dto.PublishCommentLikeRes;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import javax.validation.constraints.NotNull;
/** /**
* @AuthorChenYan * @AuthorChenYan
@ -14,4 +19,16 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface PublishCommentLikeMapper extends BaseMapper<PublishCommentLike> { public interface PublishCommentLikeMapper extends BaseMapper<PublishCommentLike> {
@InterceptorIgnore(tenantLine = "true")
PublishCommentLike selectByTenantIdAndCommunityIdAndCommentId(@Param("tenantId") Long tenantId,
@Param("communityId") Long communityId,
@Param("commentId") Long commentId);
@InterceptorIgnore(tenantLine = "true")
void updateDelFlagById(@Param("publishCommentLike") PublishCommentLike publishCommentLike);
@InterceptorIgnore(tenantLine = "true")
PublishCommentLike selectLike(@Param("publishCommentLikeRes") PublishCommentLikeRes publishCommentLikeRes,
@Param("userId") Long userId);
} }

View File

@ -0,0 +1,24 @@
package com.mcwl.communityCenter.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mcwl.communityCenter.domain.PublishCommentLike;
import com.mcwl.communityCenter.domain.PublishLike;
import com.mcwl.communityCenter.domain.dto.PublishCommentLikeRes;
import com.mcwl.communityCenter.domain.dto.PublishLikeRes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
*
*/
@Mapper
public interface PublishLikeMapper extends BaseMapper<PublishLike> {
@InterceptorIgnore(tenantLine = "true")
PublishLike selectPublishLike(@Param("publishLikeRes") PublishLikeRes publishLikeRes,
@Param("userId") Long userId);
@InterceptorIgnore(tenantLine = "true")
void updateDelFlagById(@Param("publishLike") PublishLike publishLike);
}

View File

@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.communityCenter.domain.Publish; import com.mcwl.communityCenter.domain.Publish;
import com.mcwl.communityCenter.domain.dto.MyPublishPageRes;
import com.mcwl.communityCenter.domain.dto.PublishPageRes; import com.mcwl.communityCenter.domain.dto.PublishPageRes;
import com.mcwl.communityCenter.domain.vo.PublishVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P; import org.springframework.security.core.parameters.P;
@ -44,5 +46,13 @@ public interface PublishMapper extends BaseMapper<Publish> {
void elitePublish(@Param("communityId") Long communityId, @Param("publishId") Long publishId); void elitePublish(@Param("communityId") Long communityId, @Param("publishId") Long publishId);
@InterceptorIgnore(tenantLine = "true") @InterceptorIgnore(tenantLine = "true")
List<Publish> publishList(Page<Publish> page,@Param("publishPageRes") PublishPageRes publishPageRes); List<Publish> publishList(Page<Publish> page, @Param("publishPageRes") PublishPageRes publishPageRes);
@InterceptorIgnore(tenantLine = "true")
List<PublishVo> myPublishList(Page<Publish> page,
@Param("myPublishPageRes") MyPublishPageRes myPublishPageRes,
@Param("userId") Long userId);
@InterceptorIgnore(tenantLine = "true")
void insertPublish(@Param("publish") Publish publish);
} }

View File

@ -5,10 +5,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.communityCenter.domain.Community; import com.mcwl.communityCenter.domain.Community;
import com.mcwl.communityCenter.domain.Question; import com.mcwl.communityCenter.domain.Question;
import com.mcwl.communityCenter.domain.dto.QuestionPageRes;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.List;
@Mapper @Mapper
public interface QuestionMapper extends BaseMapper<Question> { public interface QuestionMapper extends BaseMapper<Question> {
@ -37,4 +39,9 @@ public interface QuestionMapper extends BaseMapper<Question> {
@NotNull(message = "社区不能为空") @NotNull(message = "社区不能为空")
@Param("communityId") @Param("communityId")
Long communityId); Long communityId);
@InterceptorIgnore(tenantLine = "true")
List<Question> myQuestionList(Page<Question> page,
@Param("questionPageRes") QuestionPageRes questionPageRes,
@Param("userId") Long userId);
} }

View File

@ -1,8 +1,13 @@
package com.mcwl.communityCenter.service; package com.mcwl.communityCenter.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.communityCenter.domain.Community; import com.mcwl.communityCenter.domain.Community;
import com.mcwl.communityCenter.domain.CommunityAdvice; import com.mcwl.communityCenter.domain.CommunityAdvice;
import com.mcwl.communityCenter.domain.dto.CommunityAdvicePageRes;
import javax.validation.Valid;
public interface CommunityAdviceService extends IService<CommunityAdvice> { public interface CommunityAdviceService extends IService<CommunityAdvice> {
TableDataInfo getCommunityAdviceList(@Valid CommunityAdvicePageRes communityAdvicePageRes);
} }

View File

@ -11,4 +11,6 @@ public interface CommunityFileLogService extends IService<CommunityFileLog> {
List<String> getUserAvatarList(Long tenantId, Long communityId, Long communityFileId); List<String> getUserAvatarList(Long tenantId, Long communityId, Long communityFileId);
Integer getDownloadCount(Long tenantId, Long communityId, Long communityFileId); Integer getDownloadCount(Long tenantId, Long communityId, Long communityFileId);
void saveCommunityFileLog(CommunityFileLog communityFileLog);
} }

View File

@ -1,14 +1,20 @@
package com.mcwl.communityCenter.service; package com.mcwl.communityCenter.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.mcwl.common.core.domain.R;
import com.mcwl.common.core.page.PageDomain; import com.mcwl.common.core.page.PageDomain;
import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.communityCenter.domain.CommunityFile; import com.mcwl.communityCenter.domain.CommunityFile;
import com.mcwl.communityCenter.domain.dto.*; import com.mcwl.communityCenter.domain.dto.*;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
public interface CommunityFileService extends IService<CommunityFile> { public interface CommunityFileService extends IService<CommunityFile> {
void upload(CommunityUploadFileRes communityUploadFileRes); R<String> upload(CommunityUploadFileRes communityUploadFileRes);
TableDataInfo getCommunityFileList(CommunityFilePageListRes communityFilePageListRes); TableDataInfo getCommunityFileList(CommunityFilePageListRes communityFilePageListRes);
R<String> download(@Valid CommunityDownloadFileRes communityDownloadFileRes);
} }

View File

@ -2,25 +2,21 @@ package com.mcwl.communityCenter.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.mcwl.common.core.domain.R; import com.mcwl.common.core.domain.R;
import com.mcwl.common.core.page.PageDomain;
import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.communityCenter.domain.Community; import com.mcwl.communityCenter.domain.Community;
import com.mcwl.communityCenter.domain.dto.CommunityListPageRes; import com.mcwl.communityCenter.domain.dto.*;
import com.mcwl.communityCenter.domain.dto.CommunityRes; import com.mcwl.communityCenter.domain.vo.CommunityDetailVo;
import com.mcwl.communityCenter.domain.dto.JoinCommunityListPageRes;
import com.mcwl.communityCenter.domain.dto.JoinCommunityRes;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotNull;
public interface CommunityService extends IService<Community> { public interface CommunityService extends IService<Community> {
TableDataInfo listByPage(CommunityListPageRes communityListPageRes); TableDataInfo listByPage(CommunityListPageRes communityListPageRes);
/** /**
* *
* @param communityRes * @param addCommunityRes
*/ */
void addCommunity(CommunityRes communityRes); void addCommunity(AddCommunityRes addCommunityRes);
/** /**
* *
@ -44,4 +40,8 @@ public interface CommunityService extends IService<Community> {
* *
*/ */
R<Object> isJoinCommunity(JoinCommunityRes joinCommunityRes); R<Object> isJoinCommunity(JoinCommunityRes joinCommunityRes);
CommunityDetailVo getCommunityDetail(Long communityId);
void editCommunity(@Valid EditCommunityRes editCommunityRes);
} }

View File

@ -3,14 +3,14 @@ package com.mcwl.communityCenter.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.mcwl.common.core.domain.R; import com.mcwl.common.core.domain.R;
import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.communityCenter.domain.Community;
import com.mcwl.communityCenter.domain.CommunityUser; import com.mcwl.communityCenter.domain.CommunityUser;
import com.mcwl.communityCenter.domain.dto.BlackListRes; import com.mcwl.communityCenter.domain.dto.BlackListRes;
import com.mcwl.communityCenter.domain.dto.CommunityListPageRes;
import com.mcwl.communityCenter.domain.dto.CommunityRes;
import com.mcwl.communityCenter.domain.dto.CommunityUserListPageRes; import com.mcwl.communityCenter.domain.dto.CommunityUserListPageRes;
import com.mcwl.communityCenter.domain.dto.CommunityUserManageRes;
import com.mcwl.communityCenter.domain.dto.UnBlackListRes;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.List;
public interface CommunityUserService extends IService<CommunityUser> { public interface CommunityUserService extends IService<CommunityUser> {
@ -23,4 +23,12 @@ public interface CommunityUserService extends IService<CommunityUser> {
* *
*/ */
R<Object> black(@Valid BlackListRes blackListRes); R<Object> black(@Valid BlackListRes blackListRes);
List<CommunityUser> getAllCommunityUser();
void updateBlankCommunityUser(CommunityUser communityUser);
R<Object> unBlack(@Valid UnBlackListRes unBlackListRes);
R<Object> manage(@Valid CommunityUserManageRes communityUserManageRes);
} }

View File

@ -0,0 +1,20 @@
package com.mcwl.communityCenter.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mcwl.common.core.domain.R;
import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.communityCenter.domain.IncomeInfo;
import com.mcwl.communityCenter.domain.Publish;
import com.mcwl.communityCenter.domain.dto.*;
import com.mcwl.communityCenter.domain.vo.IncomeInfoVo;
import com.mcwl.communityCenter.domain.vo.PublishVo;
import javax.validation.Valid;
public interface IncomeInfoService extends IService<IncomeInfo> {
R<IncomeInfoVo> communityIncome();
TableDataInfo incomeList(@Valid IncomeInfoListPageRes incomeInfoListPageRes);
}

View File

@ -0,0 +1,24 @@
package com.mcwl.communityCenter.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mcwl.common.core.domain.R;
import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.communityCenter.domain.Publish;
import com.mcwl.communityCenter.domain.PublishCollect;
import com.mcwl.communityCenter.domain.dto.*;
import com.mcwl.communityCenter.domain.vo.PublishVo;
import javax.validation.Valid;
public interface PublishCollectService extends IService<PublishCollect> {
TableDataInfo myCollectList(@Valid MyPublishCollectPageRes myPublishCollectPageRes);
void savePublishCollect(PublishCollect publishCollect);
PublishCollect getPublishCollect(PublishCollectRes publishCollectRes, Long userId);
void updatePublishCollect(PublishCollect publishCollect);
}

View File

@ -2,8 +2,12 @@ package com.mcwl.communityCenter.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.mcwl.communityCenter.domain.PublishCommentLike; import com.mcwl.communityCenter.domain.PublishCommentLike;
import com.mcwl.communityCenter.domain.dto.PublishCommentLikeRes;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
/** /**
* @AuthorChenYan * @AuthorChenYan
* @Projectmcwl-ai * @Projectmcwl-ai
@ -15,4 +19,5 @@ import org.springframework.stereotype.Service;
@Service @Service
public interface PublishCommentLikeService extends IService<PublishCommentLike> { public interface PublishCommentLikeService extends IService<PublishCommentLike> {
void like(PublishCommentLikeRes publishCommentLikeRes);
} }

View File

@ -28,7 +28,7 @@ public interface PublishCommentService extends IService<PublishComment> {
* @param commentDetailRes * @param commentDetailRes
* @return * @return
*/ */
R<Object> getComment(CommentDetailRes commentDetailRes); R<List<CommentVo>> getComment(CommentDetailRes commentDetailRes);
R<Object> addComment(CommentRes commentRes); R<Object> addComment(CommentRes commentRes);

View File

@ -0,0 +1,25 @@
package com.mcwl.communityCenter.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mcwl.communityCenter.domain.PublishCommentLike;
import com.mcwl.communityCenter.domain.PublishLike;
import com.mcwl.communityCenter.domain.dto.PublishCommentLikeRes;
import com.mcwl.communityCenter.domain.dto.PublishLikeRes;
import org.springframework.stereotype.Service;
import javax.validation.Valid;
/**
* @AuthorChenYan
* @Projectmcwl-ai
* @Packagecom.mcwl.communityCenter.service
* @FilenamePublishCommissionLikeService
* @Description TODO
* @Date2025/1/17 14:23
*/
@Service
public interface PublishLikeService extends IService<PublishLike> {
void like(@Valid PublishLikeRes publishLikeRes);
}

View File

@ -7,9 +7,7 @@ import com.mcwl.common.core.page.PageDomain;
import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.communityCenter.domain.Community; import com.mcwl.communityCenter.domain.Community;
import com.mcwl.communityCenter.domain.Publish; import com.mcwl.communityCenter.domain.Publish;
import com.mcwl.communityCenter.domain.dto.PublishDetailRes; import com.mcwl.communityCenter.domain.dto.*;
import com.mcwl.communityCenter.domain.dto.PublishPageRes;
import com.mcwl.communityCenter.domain.dto.PublishRes;
import com.mcwl.communityCenter.domain.vo.PublishVo; import com.mcwl.communityCenter.domain.vo.PublishVo;
import javax.validation.Valid; import javax.validation.Valid;
@ -35,4 +33,10 @@ public interface PublishService extends IService<Publish> {
void elitePublish(Long communityId, Long publishId); void elitePublish(Long communityId, Long publishId);
TableDataInfo publishList(PublishPageRes publishPageRes); TableDataInfo publishList(PublishPageRes publishPageRes);
TableDataInfo myPublishList(MyPublishPageRes myPublishPageRes);
void collectPublish(@Valid PublishCollectRes publishCollectRes);
TableDataInfo getPersonHomeList(@Valid PersonHomePageRes personHomePageRes);
} }

View File

@ -34,4 +34,6 @@ public interface QuestionService extends IService<Question> {
// AjaxResult reply(QuestionReplyRes questionReplyRes); // AjaxResult reply(QuestionReplyRes questionReplyRes);
TableDataInfo listImage(@Valid QuestionPageRes questionPageRes); TableDataInfo listImage(@Valid QuestionPageRes questionPageRes);
TableDataInfo myQuestionList(@Valid QuestionPageRes questionPageRes);
} }

View File

@ -1,17 +1,38 @@
package com.mcwl.communityCenter.service.impl; package com.mcwl.communityCenter.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mcwl.common.constant.HttpStatus;
import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.communityCenter.domain.Community; import com.mcwl.communityCenter.domain.Community;
import com.mcwl.communityCenter.domain.CommunityAdvice; import com.mcwl.communityCenter.domain.CommunityAdvice;
import com.mcwl.communityCenter.domain.dto.CommunityAdvicePageRes;
import com.mcwl.communityCenter.domain.vo.CommunityAdviceVo;
import com.mcwl.communityCenter.mapper.CommunityAdviceMapper; import com.mcwl.communityCenter.mapper.CommunityAdviceMapper;
import com.mcwl.communityCenter.mapper.CommunityMapper; import com.mcwl.communityCenter.mapper.CommunityMapper;
import com.mcwl.communityCenter.service.CommunityAdviceService; import com.mcwl.communityCenter.service.CommunityAdviceService;
import com.mcwl.communityCenter.service.CommunityService; import com.mcwl.communityCenter.service.CommunityService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
@Service @Service
public class CommunityAdviceServiceImpl extends ServiceImpl<CommunityAdviceMapper, CommunityAdvice> public class CommunityAdviceServiceImpl extends ServiceImpl<CommunityAdviceMapper, CommunityAdvice>
implements CommunityAdviceService { implements CommunityAdviceService {
@Override
public TableDataInfo getCommunityAdviceList(CommunityAdvicePageRes communityAdvicePageRes) {
Page<CommunityAdvice> page = new Page<>(communityAdvicePageRes.getPageNum(), communityAdvicePageRes.getPageSize());
List<CommunityAdviceVo> communityAdviceList = baseMapper.getCommunityAdviceList(page, communityAdvicePageRes);
// 封装分页信息
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(HttpStatus.SUCCESS);
rspData.setMsg("查询成功");
rspData.setRows(communityAdviceList);
rspData.setTotal(page.getTotal());
return rspData;
}
} }

View File

@ -28,4 +28,9 @@ public class CommunityFileLogServiceImpl extends ServiceImpl<CommunityFileLogMap
return baseMapper.getDownloadCount(tenantId, communityId, communityFileId); return baseMapper.getDownloadCount(tenantId, communityId, communityFileId);
} }
@Override
public void saveCommunityFileLog(CommunityFileLog communityFileLog) {
baseMapper.saveCommunityFileLog(communityFileLog);
}
} }

View File

@ -1,21 +1,29 @@
package com.mcwl.communityCenter.service.impl; package com.mcwl.communityCenter.service.impl;
import cn.hutool.Hutool;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.io.file.FileNameUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mcwl.common.constant.HttpStatus; import com.mcwl.common.constant.HttpStatus;
import com.mcwl.common.core.domain.R;
import com.mcwl.common.core.page.PageDomain; import com.mcwl.common.core.page.PageDomain;
import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.common.utils.SecurityUtils; import com.mcwl.common.utils.SecurityUtils;
import com.mcwl.common.utils.obs.ObsUtils; import com.mcwl.common.utils.obs.ObsUtils;
import com.mcwl.communityCenter.domain.CommunityFile; import com.mcwl.communityCenter.domain.CommunityFile;
import com.mcwl.communityCenter.domain.CommunityFileLog;
import com.mcwl.communityCenter.domain.CommunityUser;
import com.mcwl.communityCenter.domain.dto.*; import com.mcwl.communityCenter.domain.dto.*;
import com.mcwl.communityCenter.domain.vo.CommunityFileVo; import com.mcwl.communityCenter.domain.vo.CommunityFileVo;
import com.mcwl.communityCenter.domain.vo.DownloadFileUserVo; import com.mcwl.communityCenter.domain.vo.DownloadFileUserVo;
import com.mcwl.communityCenter.mapper.CommunityFileMapper; import com.mcwl.communityCenter.mapper.CommunityFileMapper;
import com.mcwl.communityCenter.mapper.CommunityUserMapper;
import com.mcwl.communityCenter.service.CommunityFileLogService; import com.mcwl.communityCenter.service.CommunityFileLogService;
import com.mcwl.communityCenter.service.CommunityFileService; import com.mcwl.communityCenter.service.CommunityFileService;
import com.mcwl.communityCenter.service.CommunityUserService;
import com.mcwl.system.service.ISysUserService; import com.mcwl.system.service.ISysUserService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -33,26 +41,35 @@ public class CommunityFileServiceImpl extends ServiceImpl<CommunityFileMapper, C
private final CommunityFileLogService communityFileLogService; private final CommunityFileLogService communityFileLogService;
private final CommunityUserMapper communityUserMapper;
private static final String[] UN_UPLOAD_FILE_TYPE = new String[]{
"bmp", "dib",
"jpg", "jpeg", "jpe", "jfif",
"gif",
"tif", "tiff",
"png",
"heic",
"webp"
};
@Override @Override
public void upload(CommunityUploadFileRes communityUploadFileRes) { public R<String> upload(CommunityUploadFileRes communityUploadFileRes) {
Long tenantId = communityUploadFileRes.getTenantId(); Long tenantId = communityUploadFileRes.getTenantId();
Long communityId = communityUploadFileRes.getCommunityId(); Long communityId = communityUploadFileRes.getCommunityId();
MultipartFile file = communityUploadFileRes.getFile(); Long currentUserId = SecurityUtils.getUserId();
Map<String, String> map = obsUtils.uploadFile(file);
String filename = file.getOriginalFilename(); CommunityUser communityUser = communityUserMapper.selectCommunityUser(tenantId, communityId, currentUserId);
long fileSize = file.getSize(); if (Objects.isNull(communityUser)) {
return R.fail(HttpStatus.SHOW_ERROR_MSG, "您不是该社区成员");
}
CommunityFile communityFile = BeanUtil.toBean(communityUploadFileRes, CommunityFile.class);
communityFile.setUserId(currentUserId);
CommunityFile communityFile = CommunityFile.builder()
.tenantId(tenantId)
.communityId(communityId)
.userId(SecurityUtils.getUserId())
.fileUrl(map.get("path"))
.objectKey(map.get("objectKey"))
.fileName(filename)
.fileSize(fileSize)
.build();
baseMapper.insert(communityFile); baseMapper.insert(communityFile);
return R.ok();
} }
@Override @Override
@ -62,17 +79,14 @@ public class CommunityFileServiceImpl extends ServiceImpl<CommunityFileMapper, C
for (CommunityFileVo communityFileVo : communityFileList) { for (CommunityFileVo communityFileVo : communityFileList) {
DownloadFileUserVo downloadFileUserVo = new DownloadFileUserVo(); DownloadFileUserVo downloadFileUserVo = new DownloadFileUserVo();
List<String> avatarList = communityFileLogService.getUserAvatarList(communityFileVo.getTenantId(), Long tenantId = communityFileVo.getTenantId();
communityFileVo.getCommunityId(), Long communityId = communityFileVo.getCommunityId();
communityFileVo.getId()); Long fileId = communityFileVo.getId();
Integer count = communityFileLogService.getDownloadCount(communityFileVo.getTenantId(), List<String> avatarList = communityFileLogService.getUserAvatarList(tenantId, communityId, fileId);
communityFileVo.getCommunityId(), Integer count = communityFileLogService.getDownloadCount(tenantId, communityId, fileId);
communityFileVo.getId());
downloadFileUserVo.setAvatarList(avatarList); downloadFileUserVo.setAvatarList(avatarList);
downloadFileUserVo.setCount(count); downloadFileUserVo.setCount(count);
communityFileVo.setDownloadFileUser(downloadFileUserVo); communityFileVo.setDownloadFileUser(downloadFileUserVo);
} }
// 封装返回 // 封装返回
@ -83,4 +97,35 @@ public class CommunityFileServiceImpl extends ServiceImpl<CommunityFileMapper, C
tableDataInfo.setMsg("查询成功"); tableDataInfo.setMsg("查询成功");
return tableDataInfo; return tableDataInfo;
} }
@Override
public R<String> download(CommunityDownloadFileRes communityDownloadFileRes) {
Long tenantId = communityDownloadFileRes.getTenantId();
Long communityId = communityDownloadFileRes.getCommunityId();
Long fileId = communityDownloadFileRes.getFileId();
Long currentUserId = SecurityUtils.getUserId();
CommunityUser communityUser = communityUserMapper.selectCommunityUser(tenantId, communityId, currentUserId);
if (Objects.isNull(communityUser)) {
return R.fail(HttpStatus.SHOW_ERROR_MSG, "您不是该社区成员");
}
CommunityFile communityFile = baseMapper.selectCommunityFile(tenantId, communityId, fileId);
if (Objects.isNull(communityFile)) {
return R.fail(HttpStatus.SHOW_ERROR_MSG, "文件不存在");
}
CommunityFileLog communityFileLog = new CommunityFileLog();
communityFileLog.setTenantId(tenantId);
communityFileLog.setCommunityId(communityId);
communityFileLog.setCommunityFileId(fileId);
communityFileLog.setDownloadUserId(currentUserId);
communityFileLogService.saveCommunityFileLog(communityFileLog);
return R.ok(communityFile.getFileUrl());
}
} }

View File

@ -8,19 +8,19 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mcwl.common.constant.HttpStatus; import com.mcwl.common.constant.HttpStatus;
import com.mcwl.common.core.domain.R; import com.mcwl.common.core.domain.R;
import com.mcwl.common.core.domain.entity.SysUser; import com.mcwl.common.core.domain.entity.SysUser;
import com.mcwl.common.core.page.PageDomain;
import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.common.core.redis.RedisCache; import com.mcwl.common.core.redis.RedisCache;
import com.mcwl.common.exception.ServiceException; import com.mcwl.common.exception.ServiceException;
import com.mcwl.common.utils.SecurityUtils; import com.mcwl.common.utils.SecurityUtils;
import com.mcwl.common.utils.StringUtils; import com.mcwl.common.utils.StringUtils;
import com.mcwl.communityCenter.constant.AdviceConstant;
import com.mcwl.communityCenter.domain.Community; import com.mcwl.communityCenter.domain.Community;
import com.mcwl.communityCenter.domain.CommunityAdvice;
import com.mcwl.communityCenter.domain.CommunityUser; import com.mcwl.communityCenter.domain.CommunityUser;
import com.mcwl.communityCenter.domain.dto.CommunityListPageRes; import com.mcwl.communityCenter.domain.dto.*;
import com.mcwl.communityCenter.domain.dto.CommunityRes; import com.mcwl.communityCenter.domain.vo.CommunityDetailVo;
import com.mcwl.communityCenter.domain.dto.JoinCommunityListPageRes;
import com.mcwl.communityCenter.domain.dto.JoinCommunityRes;
import com.mcwl.communityCenter.domain.vo.CommunityVo; import com.mcwl.communityCenter.domain.vo.CommunityVo;
import com.mcwl.communityCenter.mapper.CommunityAdviceMapper;
import com.mcwl.communityCenter.mapper.CommunityMapper; import com.mcwl.communityCenter.mapper.CommunityMapper;
import com.mcwl.communityCenter.mapper.CommunityUserMapper; import com.mcwl.communityCenter.mapper.CommunityUserMapper;
import com.mcwl.communityCenter.service.CommunityService; import com.mcwl.communityCenter.service.CommunityService;
@ -46,6 +46,9 @@ public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, Community
private final RedisCache redisCache; private final RedisCache redisCache;
private final CommunityAdviceMapper communityAdviceMapper;
@Override @Override
public TableDataInfo listByPage(CommunityListPageRes communityListPageRes) { public TableDataInfo listByPage(CommunityListPageRes communityListPageRes) {
@ -68,11 +71,11 @@ public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, Community
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void addCommunity(CommunityRes communityRes) { public void addCommunity(AddCommunityRes addCommunityRes) {
try { try {
Community community = new Community(); Community community = new Community();
BeanUtil.copyProperties(communityRes, community); BeanUtil.copyProperties(addCommunityRes, community);
if (Objects.equals(communityRes.getType(), 0)) { if (Objects.equals(addCommunityRes.getType(), 0)) {
community.setPrice(0.0); community.setPrice(0.0);
} }
baseMapper.insert(community); baseMapper.insert(community);
@ -82,7 +85,7 @@ public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, Community
.tenantId(SecurityUtils.getUserId()) .tenantId(SecurityUtils.getUserId())
.communityId(community.getId()) .communityId(community.getId())
.userId(SecurityUtils.getUserId()) .userId(SecurityUtils.getUserId())
.userType(1) .userType(2)
.build()); .build());
} catch (Exception e) { } catch (Exception e) {
@ -129,7 +132,7 @@ public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, Community
Calendar now = Calendar.getInstance(); Calendar now = Calendar.getInstance();
Date startTime = now.getTime(); Date startTime = now.getTime();
now.add(Calendar.DAY_OF_YEAR, community.getValidityDay()); now.add(Calendar.YEAR, community.getValidityDay());
Date endTime = now.getTime(); Date endTime = now.getTime();
CommunityUser cu = CommunityUser.builder() CommunityUser cu = CommunityUser.builder()
@ -144,6 +147,19 @@ public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, Community
communityUserMapper.insert(cu); communityUserMapper.insert(cu);
if (price <= 0) {
return R.ok("加入成功");
}
CommunityAdvice communityAdvice = new CommunityAdvice();
communityAdvice.setTenantId(tenantId);
communityAdvice.setCommunityId(communityId);
communityAdvice.setSendUserId(SecurityUtils.getUserId());
communityAdvice.setAdviceType(AdviceConstant.COMMUNITY_NOTICE);
communityAdvice.setUserId(tenantId);
communityAdvice.setContent(StringUtils.format("{}加入{}社区,金币+{}",
SecurityUtils.getLoginUser().getUser().getNickName(), community.getCommunityName(), price));
communityAdviceMapper.insert(communityAdvice);
return R.ok("加入成功"); return R.ok("加入成功");
} }
@ -151,11 +167,9 @@ public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, Community
@Override @Override
public TableDataInfo getMyJoinCommunity(JoinCommunityListPageRes joinCommunityListPageRes) { public TableDataInfo getMyJoinCommunity(JoinCommunityListPageRes joinCommunityListPageRes) {
Page<Community> page = new Page<>(joinCommunityListPageRes.getPageNum(), joinCommunityListPageRes.getPageSize()); Page<Community> page = new Page<>(joinCommunityListPageRes.getPageNum(), joinCommunityListPageRes.getPageSize());
OrderItem orderItem = new OrderItem("create_time", false); page.addOrder(new OrderItem("create_time", false));
page.addOrder(orderItem);
String searchContent = joinCommunityListPageRes.getSearchContent(); List<Community> communityList = baseMapper.getMyJoinCommunity(page, SecurityUtils.getUserId(), joinCommunityListPageRes);
List<Community> communityList = baseMapper.getMyJoinCommunity(page, SecurityUtils.getUserId(), searchContent);
return this.getCommunityVoTableDataInfo(communityList, page.getTotal()); return this.getCommunityVoTableDataInfo(communityList, page.getTotal());
@ -169,9 +183,27 @@ public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, Community
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public R<Object> quitCommunity(Long tenantId, Long communityId) { public R<Object> quitCommunity(Long tenantId, Long communityId) {
Long userId = SecurityUtils.getUserId();
Community community = baseMapper.getByTenantIdAndCommunityId(tenantId, communityId);
if (Objects.isNull(community)) {
return R.fail(HttpStatus.SHOW_ERROR_MSG, "社区不存在");
}
CommunityUser communityUser = communityUserMapper.selectCommunityUser(tenantId, communityId, userId);
if (Objects.isNull(communityUser)) {
return R.fail(HttpStatus.SHOW_ERROR_MSG,"您不是该社区成员");
}
Integer communityJoinNum = communityUserMapper.getJoinNum(tenantId, communityId); Integer communityJoinNum = communityUserMapper.getJoinNum(tenantId, communityId);
baseMapper.quitCommunity(tenantId, communityId, SecurityUtils.getUserId()); if (communityUser.getUserType() == 2 && communityJoinNum > 1) {
return R.fail(HttpStatus.SHOW_ERROR_MSG,"社区还有成员,无法退出");
}
baseMapper.quitCommunity(tenantId, communityId, userId);
if (communityJoinNum == 1) { if (communityJoinNum == 1) {
baseMapper.deleteCommunity(tenantId, communityId); baseMapper.deleteCommunity(tenantId, communityId);
@ -186,6 +218,18 @@ public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, Community
return R.ok(isJoinCommunity); return R.ok(isJoinCommunity);
} }
@Override
public CommunityDetailVo getCommunityDetail(Long communityId) {
Community community = baseMapper.selectById(communityId);
return BeanUtil.toBean(community, CommunityDetailVo.class);
}
@Override
public void editCommunity(EditCommunityRes editCommunityRes) {
Community community = BeanUtil.toBean(editCommunityRes, Community.class);
baseMapper.updateById(community);
}
private TableDataInfo getCommunityVoTableDataInfo(List<Community> communityList, Long total) { private TableDataInfo getCommunityVoTableDataInfo(List<Community> communityList, Long total) {
@ -224,8 +268,7 @@ public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, Community
LocalDate currentLocalDate = LocalDate.now(ZoneId.systemDefault()); LocalDate currentLocalDate = LocalDate.now(ZoneId.systemDefault());
for (Community community : communityList) { for (Community community : communityList) {
CommunityVo communityVo = new CommunityVo(); CommunityVo communityVo = BeanUtil.toBean(community, CommunityVo.class);
BeanUtil.copyProperties(community, communityVo);
// 当前时间和创建时间差 // 当前时间和创建时间差
Date createTime = community.getCreateTime(); Date createTime = community.getCreateTime();
LocalDate createLocalDate = createTime.toInstant() LocalDate createLocalDate = createTime.toInstant()
@ -233,6 +276,10 @@ public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, Community
.toLocalDate(); .toLocalDate();
long daysBetween = ChronoUnit.DAYS.between(createLocalDate, currentLocalDate); long daysBetween = ChronoUnit.DAYS.between(createLocalDate, currentLocalDate);
SysUser sysUser = sysUserService.selectUserById(community.getTenantId()); SysUser sysUser = sysUserService.selectUserById(community.getTenantId());
CommunityUser communityUser = communityUserMapper.selectCommunityUser(community.getTenantId(), community.getId(), SecurityUtils.getUserId());
if (Objects.nonNull(communityUser)) {
communityVo.setUserType(communityUser.getUserType());
}
communityVo.setUserId(community.getTenantId()); communityVo.setUserId(community.getTenantId());
communityVo.setAvatar(sysUser.getAvatar()); communityVo.setAvatar(sysUser.getAvatar());
communityVo.setNickName(sysUser.getNickName()); communityVo.setNickName(sysUser.getNickName());

View File

@ -1,35 +1,24 @@
package com.mcwl.communityCenter.service.impl; package com.mcwl.communityCenter.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.OrderItem; import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mcwl.common.constant.HttpStatus; import com.mcwl.common.constant.HttpStatus;
import com.mcwl.common.core.domain.R; import com.mcwl.common.core.domain.R;
import com.mcwl.common.core.domain.entity.SysUser;
import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.common.utils.SecurityUtils; import com.mcwl.common.utils.SecurityUtils;
import com.mcwl.common.utils.StringUtils;
import com.mcwl.communityCenter.domain.Community;
import com.mcwl.communityCenter.domain.CommunityUser; import com.mcwl.communityCenter.domain.CommunityUser;
import com.mcwl.communityCenter.domain.dto.BlackListRes; import com.mcwl.communityCenter.domain.dto.BlackListRes;
import com.mcwl.communityCenter.domain.dto.CommunityListPageRes;
import com.mcwl.communityCenter.domain.dto.CommunityRes;
import com.mcwl.communityCenter.domain.dto.CommunityUserListPageRes; import com.mcwl.communityCenter.domain.dto.CommunityUserListPageRes;
import com.mcwl.communityCenter.domain.dto.CommunityUserManageRes;
import com.mcwl.communityCenter.domain.dto.UnBlackListRes;
import com.mcwl.communityCenter.domain.vo.CommunityUserVo; import com.mcwl.communityCenter.domain.vo.CommunityUserVo;
import com.mcwl.communityCenter.domain.vo.CommunityVo;
import com.mcwl.communityCenter.mapper.CommunityMapper;
import com.mcwl.communityCenter.mapper.CommunityUserMapper; import com.mcwl.communityCenter.mapper.CommunityUserMapper;
import com.mcwl.communityCenter.service.CommunityService;
import com.mcwl.communityCenter.service.CommunityUserService; import com.mcwl.communityCenter.service.CommunityUserService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.*; import java.util.*;
@Service @Service
@ -43,7 +32,7 @@ public class CommunityUserServiceImpl extends ServiceImpl<CommunityUserMapper, C
@Override @Override
public TableDataInfo getCommunityUserList(CommunityUserListPageRes communityUserListPageRes) { public TableDataInfo getCommunityUserList(CommunityUserListPageRes communityUserListPageRes) {
Page<CommunityUser> page = new Page<>(communityUserListPageRes.getPageNum(), communityUserListPageRes.getPageSize()); Page<CommunityUser> page = new Page<>(communityUserListPageRes.getPageNum(), communityUserListPageRes.getPageSize());
page.addOrder(new OrderItem("create_time", false)); // page.addOrder(new OrderItem("cu.create_time", false));
List<CommunityUserVo> communityUserList = baseMapper.getCommunityUserList(page, communityUserListPageRes); List<CommunityUserVo> communityUserList = baseMapper.getCommunityUserList(page, communityUserListPageRes);
@ -57,26 +46,128 @@ public class CommunityUserServiceImpl extends ServiceImpl<CommunityUserMapper, C
@Override @Override
public R<Object> black(BlackListRes blackListRes) { public R<Object> black(BlackListRes blackListRes) {
Long tenantId = blackListRes.getTenantId();
Long communityId = blackListRes.getCommunityId(); Long communityId = blackListRes.getCommunityId();
Long userId = blackListRes.getUserId(); Long userId = blackListRes.getUserId();
Integer blackDay = blackListRes.getBlackDay(); Integer blackDay = blackListRes.getBlackDay();
String blackReason = blackListRes.getBlackReason(); String blackReason = blackListRes.getBlackReason();
CommunityUser communityUser = baseMapper.selectOne(new LambdaQueryWrapper<CommunityUser>() // 拉黑用户
.eq(CommunityUser::getCommunityId, communityId) CommunityUser blackCommunityUser = baseMapper.selectCommunityUser(
.eq(CommunityUser::getUserId, userId)); tenantId, communityId, userId
if (Objects.isNull(communityUser)) { );
// 当前用户
CommunityUser currentCommunityUser = baseMapper.selectCommunityUser(
tenantId, communityId, SecurityUtils.getUserId()
);
if (currentCommunityUser.getUserType() == 0) {
return R.fail(HttpStatus.SHOW_ERROR_MSG, "您不是群主/管理员,无法拉黑");
}
if (Objects.isNull(blackCommunityUser)) {
return R.fail(HttpStatus.SHOW_ERROR_MSG, "该用户不在该社区中"); return R.fail(HttpStatus.SHOW_ERROR_MSG, "该用户不在该社区中");
} }
if ("1".equals(blackCommunityUser.getIsBlack())) {
return R.fail(HttpStatus.SHOW_ERROR_MSG, "该用户已拉黑");
}
if (blackCommunityUser.getUserType() != 0) {
return R.fail(HttpStatus.SHOW_ERROR_MSG, "该用户是群主/管理员,无法拉黑");
}
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DATE, blackDay); calendar.add(Calendar.DATE, blackDay);
communityUser.setIsBlank("1"); blackCommunityUser.setIsBlack("1");
communityUser.setBlankEndTime(calendar.getTime()); blackCommunityUser.setBlackEndTime(calendar.getTime());
communityUser.setBlackReason(blackReason); blackCommunityUser.setBlackReason(blackReason);
baseMapper.updateBlackCommunityUser(blackCommunityUser);
return R.ok(); return R.ok();
} }
@Override
public List<CommunityUser> getAllCommunityUser() {
return baseMapper.getAllCommunityUser();
}
@Override
public void updateBlankCommunityUser(CommunityUser communityUser) {
baseMapper.updateBlackCommunityUser(communityUser);
}
@Override
public R<Object> unBlack(UnBlackListRes unBlackListRes) {
Long tenantId = unBlackListRes.getTenantId();
Long communityId = unBlackListRes.getCommunityId();
Long unBlankUserId = unBlackListRes.getUserId();
Long currentUserId = SecurityUtils.getUserId();
// 当前用户
CommunityUser currentCommunityUser = baseMapper.selectCommunityUser(tenantId, communityId, currentUserId);
if (Objects.isNull(currentCommunityUser)) {
return R.fail(HttpStatus.SHOW_ERROR_MSG, "您不是该社区用户");
}
if (Objects.equals(currentCommunityUser.getUserType(), 0)) {
return R.fail(HttpStatus.SHOW_ERROR_MSG, "您不是群主/管理员,无法取消拉黑");
}
// 被取消拉黑的用户
CommunityUser unBlackCommunityUser = baseMapper.selectCommunityUser(tenantId, communityId, unBlankUserId);
if (Objects.isNull(unBlackCommunityUser)) {
return R.fail(HttpStatus.SHOW_ERROR_MSG, "该用户不在该社区中");
}
CommunityUser communityUser = BeanUtil.toBean(unBlackCommunityUser, CommunityUser.class);
communityUser.setIsBlack("0");
communityUser.setBlackReason(null);
communityUser.setBlackEndTime(null);
baseMapper.updateBlackCommunityUser(communityUser);
return R.ok("取消成功");
}
@Override
public R<Object> manage(CommunityUserManageRes communityUserManageRes) {
Long tenantId = communityUserManageRes.getTenantId();
Long communityId = communityUserManageRes.getCommunityId();
Long manageUserId = communityUserManageRes.getUserId();
Long currentUserId = SecurityUtils.getUserId();
// 当前用户
CommunityUser currentCommunityUser = baseMapper.selectCommunityUser(tenantId, communityId, currentUserId);
if (Objects.isNull(currentCommunityUser)) {
return R.fail(HttpStatus.SHOW_ERROR_MSG, "您不是该社区用户");
}
if (!Objects.equals(currentCommunityUser.getUserType(), 2)) {
return R.fail(HttpStatus.SHOW_ERROR_MSG, "您不是群主,无法设置管理");
}
// 设置管理的用户
CommunityUser manageCommunityUser = baseMapper.selectCommunityUser(tenantId, communityId, manageUserId);
if (Objects.isNull(manageCommunityUser)) {
return R.fail(HttpStatus.SHOW_ERROR_MSG, "该用户不在该社区中");
}
if (Objects.equals(manageCommunityUser.getUserType(), 2)) {
return R.fail(HttpStatus.SHOW_ERROR_MSG, "该用户已经是群主");
}
if (Objects.equals(manageCommunityUser.getUserType(), 1)) {
manageCommunityUser.setUserType(0);
} else {
manageCommunityUser.setUserType(1);
}
baseMapper.updateManageCommunityUser(manageCommunityUser);
return R.ok("设置成功");
}
} }

View File

@ -0,0 +1,82 @@
package com.mcwl.communityCenter.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mcwl.common.constant.HttpStatus;
import com.mcwl.common.core.domain.R;
import com.mcwl.common.core.domain.entity.SysUser;
import com.mcwl.common.core.page.PageDomain;
import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.common.utils.SecurityUtils;
import com.mcwl.common.utils.StringUtils;
import com.mcwl.communityCenter.constant.AdviceConstant;
import com.mcwl.communityCenter.domain.*;
import com.mcwl.communityCenter.domain.dto.*;
import com.mcwl.communityCenter.domain.vo.IncomeAmountVo;
import com.mcwl.communityCenter.domain.vo.IncomeInfoListVo;
import com.mcwl.communityCenter.domain.vo.IncomeInfoVo;
import com.mcwl.communityCenter.domain.vo.QuestionVo;
import com.mcwl.communityCenter.mapper.*;
import com.mcwl.communityCenter.service.IncomeInfoService;
import com.mcwl.communityCenter.service.QuestionService;
import com.mcwl.system.service.ISysUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@Service
@RequiredArgsConstructor
public class IncomeInfoServiceImpl extends ServiceImpl<IncomeInfoMapper, IncomeInfo> implements IncomeInfoService {
/**
*
*/
@Override
public R<IncomeInfoVo> communityIncome() {
// 社区收益
IncomeAmountVo communityIncome = baseMapper.communityIncome(SecurityUtils.getUserId());
// 问答收益
IncomeAmountVo questionIncome = baseMapper.questionIncome(SecurityUtils.getUserId());
// 累计收益
Double totalIncome = baseMapper.totalIncome();
IncomeInfoVo incomeInfoVo = IncomeInfoVo.builder()
.communityIncome(communityIncome)
.questionIncome(questionIncome)
.totalIncome(totalIncome)
.build();
return R.ok(incomeInfoVo);
}
@Override
public TableDataInfo incomeList(IncomeInfoListPageRes incomeInfoListPageRes) {
Page<IncomeInfo> page = this.initPage(incomeInfoListPageRes);
List<IncomeInfoListVo> incomeInfoList = baseMapper.incomeList(page, incomeInfoListPageRes, SecurityUtils.getUserId());
// 封装分页信息
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(HttpStatus.SUCCESS);
rspData.setMsg("查询成功");
rspData.setRows(incomeInfoList);
rspData.setTotal(page.getTotal());
return rspData;
}
private Page<IncomeInfo> initPage(PageDomain pageDomain) {
return new Page<>(pageDomain.getPageNum(), pageDomain.getPageSize());
}
}

View File

@ -120,7 +120,7 @@ public class InviteServiceImpl extends ServiceImpl<InviteMapper, Invite> impleme
Calendar now = Calendar.getInstance(); Calendar now = Calendar.getInstance();
Date startTime = now.getTime(); Date startTime = now.getTime();
now.add(Calendar.DAY_OF_YEAR, community.getValidityDay()); now.add(Calendar.YEAR, community.getValidityDay());
Date endTime = now.getTime(); Date endTime = now.getTime();
communityUserMapper.insert(CommunityUser communityUserMapper.insert(CommunityUser
@ -128,7 +128,7 @@ public class InviteServiceImpl extends ServiceImpl<InviteMapper, Invite> impleme
.tenantId(userId) .tenantId(userId)
.communityId(communityId) .communityId(communityId)
.userId(SecurityUtils.getUserId()) .userId(SecurityUtils.getUserId())
.userType(0) .userType(1)
.inviteId(invite.getId()) .inviteId(invite.getId())
.startTime(startTime) .startTime(startTime)
.endTime(endTime) .endTime(endTime)

View File

@ -0,0 +1,91 @@
package com.mcwl.communityCenter.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mcwl.common.constant.HttpStatus;
import com.mcwl.common.core.domain.R;
import com.mcwl.common.core.domain.entity.SysUser;
import com.mcwl.common.core.page.PageDomain;
import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.common.utils.SecurityUtils;
import com.mcwl.communityCenter.domain.Community;
import com.mcwl.communityCenter.domain.Publish;
import com.mcwl.communityCenter.domain.PublishCollect;
import com.mcwl.communityCenter.domain.Question;
import com.mcwl.communityCenter.domain.dto.*;
import com.mcwl.communityCenter.domain.vo.CommentVo;
import com.mcwl.communityCenter.domain.vo.PersonHomeVo;
import com.mcwl.communityCenter.domain.vo.PublishVo;
import com.mcwl.communityCenter.mapper.CommunityMapper;
import com.mcwl.communityCenter.mapper.InviteMapper;
import com.mcwl.communityCenter.mapper.PublishCollectMapper;
import com.mcwl.communityCenter.mapper.PublishMapper;
import com.mcwl.communityCenter.service.PublishCollectService;
import com.mcwl.communityCenter.service.PublishCommentService;
import com.mcwl.communityCenter.service.PublishService;
import com.mcwl.system.service.ISysUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.*;
@Service
@RequiredArgsConstructor
public class PublishCollectServiceImpl extends ServiceImpl<PublishCollectMapper, PublishCollect> implements PublishCollectService {
private final PublishCommentService publishCommentService;
@Override
public TableDataInfo myCollectList(MyPublishCollectPageRes myPublishCollectPageRes) {
Page<PublishCollect> page = initPage(myPublishCollectPageRes);
page.addOrder(new OrderItem("p.create_time", false));
List<PublishVo> publishVoList = baseMapper.myCollectList(page, myPublishCollectPageRes, SecurityUtils.getUserId());
List<PersonHomeVo> personHomeVoList = new ArrayList<>();
for (PublishVo publishVo : publishVoList) {
PersonHomeVo personHomeVo = BeanUtil.toBean(publishVo, PersonHomeVo.class);
CommentDetailRes commentDetailRes = new CommentDetailRes();
commentDetailRes.setTenantId(myPublishCollectPageRes.getTenantId());
commentDetailRes.setCommunityId(myPublishCollectPageRes.getCommunityId());
commentDetailRes.setOperatorId(publishVo.getId());
List<CommentVo> commentVoList = publishCommentService.getComment(commentDetailRes).getData();
personHomeVo.setCommentList(commentVoList);
personHomeVoList.add(personHomeVo);
}
// 封装分页信息
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(HttpStatus.SUCCESS);
rspData.setMsg("查询成功");
rspData.setRows(personHomeVoList);
rspData.setTotal(page.getTotal());
return rspData;
}
@Override
public void savePublishCollect(PublishCollect publishCollect) {
baseMapper.savePublishCollect(publishCollect);
}
@Override
public PublishCollect getPublishCollect(PublishCollectRes publishCollectRes, Long userId) {
return baseMapper.getPublishCollect(publishCollectRes, userId);
}
@Override
public void updatePublishCollect(PublishCollect publishCollect) {
baseMapper.updatePublishCollect(publishCollect);
}
private Page<PublishCollect> initPage(PageDomain pageDomain) {
return new Page<>(pageDomain.getPageNum(), pageDomain.getPageSize());
}
}

View File

@ -1,12 +1,27 @@
package com.mcwl.communityCenter.service.impl; package com.mcwl.communityCenter.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mcwl.common.constant.HttpStatus;
import com.mcwl.common.exception.ServiceException;
import com.mcwl.common.utils.SecurityUtils;
import com.mcwl.common.utils.StringUtils;
import com.mcwl.communityCenter.constant.AdviceConstant;
import com.mcwl.communityCenter.domain.CommunityAdvice;
import com.mcwl.communityCenter.domain.PublishComment;
import com.mcwl.communityCenter.domain.PublishCommentLike; import com.mcwl.communityCenter.domain.PublishCommentLike;
import com.mcwl.communityCenter.domain.dto.PublishCommentLikeRes;
import com.mcwl.communityCenter.mapper.PublishCommentLikeMapper; import com.mcwl.communityCenter.mapper.PublishCommentLikeMapper;
import com.mcwl.communityCenter.mapper.PublishCommentMapper;
import com.mcwl.communityCenter.service.PublishCommentLikeService; import com.mcwl.communityCenter.service.PublishCommentLikeService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/** import java.util.Objects;
/**
*
*
* @AuthorChenYan * @AuthorChenYan
* @Projectmcwl-ai * @Projectmcwl-ai
* @Packagecom.mcwl.communityCenter.service.impl * @Packagecom.mcwl.communityCenter.service.impl
@ -15,5 +30,18 @@ import org.springframework.stereotype.Service;
* @Date2025/1/17 14:25 * @Date2025/1/17 14:25
*/ */
@Service @Service
public class PublishCommentLikeServiceImpl extends ServiceImpl<PublishCommentLikeMapper, PublishCommentLike>implements PublishCommentLikeService { @RequiredArgsConstructor
public class PublishCommentLikeServiceImpl extends ServiceImpl<PublishCommentLikeMapper, PublishCommentLike> implements PublishCommentLikeService {
private final PublishCommentMapper publishCommentMapper;
@Override
@Transactional(rollbackFor = Exception.class)
public void like(PublishCommentLikeRes publishCommentLikeRes) {
}
} }

Some files were not shown because too many files have changed in this diff Show More