From b787caa660c2aed5281d1429d5db2ec18ac8fa7c Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Tue, 25 May 2021 16:31:36 +0800 Subject: [PATCH] Merge branch 'otc' of http://120.27.238.55:7000/r/exchange into otc --- src/main/java/com/xcong/excoin/modules/otc/controller/OtcBlackListController.java | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/xcong/excoin/modules/otc/controller/OtcBlackListController.java b/src/main/java/com/xcong/excoin/modules/otc/controller/OtcBlackListController.java index 69708cf..343c139 100644 --- a/src/main/java/com/xcong/excoin/modules/otc/controller/OtcBlackListController.java +++ b/src/main/java/com/xcong/excoin/modules/otc/controller/OtcBlackListController.java @@ -1,16 +1,22 @@ package com.xcong.excoin.modules.otc.controller; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.xcong.excoin.common.LoginUserUtils; import com.xcong.excoin.common.response.Result; import com.xcong.excoin.modules.member.entity.MemberEntity; import com.xcong.excoin.modules.otc.dao.OtcBlackListDao; import com.xcong.excoin.modules.otc.dao.OtcOrderDao; import com.xcong.excoin.modules.otc.dto.AddBlackDto; +import com.xcong.excoin.modules.otc.dto.BlackListDto; import com.xcong.excoin.modules.otc.entity.OtcBlackList; import com.xcong.excoin.modules.otc.entity.OtcOrder; +import com.xcong.excoin.modules.otc.vo.BlackListVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; @@ -23,7 +29,7 @@ @Validated @RestController @RequestMapping(value = "/api/black") -@Api(value = "OtcBlackListController", tags = "黑名单列表接口类") +@Api(value = "OtcBlackListController", tags = "otc黑名单列表接口类") public class OtcBlackListController { @Autowired @@ -41,6 +47,11 @@ return Result.fail("订单不存在"); } + OtcBlackList isExist = otcBlackListDao.selectByMemberIdAndBlackMemberId(member.getId(), otcOrder.getEntrustMemberId()); + if (isExist != null) { + return Result.fail("请勿重复拉黑"); + } + OtcBlackList otcBlackList = new OtcBlackList(); otcBlackList.setMemberId(member.getId()); otcBlackList.setBlackMemberId(otcOrder.getEntrustMemberId()); @@ -50,9 +61,15 @@ } @ApiOperation(value = "黑名单列表") + @ApiResponses({ + @ApiResponse(code = 200, message = "success", response = BlackListVo.class) + }) @PostMapping(value = "/blackList") - public Result blackList() { - return null; + public Result blackList(@RequestBody BlackListDto blackListDto) { + MemberEntity member = LoginUserUtils.getAppLoginUser(); + Page<BlackListVo> page = new Page<>(blackListDto.getPageNum(), blackListDto.getPageSize()); + IPage<BlackListVo> result = otcBlackListDao.selectBlackListInPage(member.getId(), page); + return Result.ok(result.getRecords()); } @ApiOperation(value = "删除黑名单") -- Gitblit v1.9.1