src/main/java/com/xcong/excoin/modules/otc/controller/OtcBlackListController.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/otc/dao/OtcBlackListDao.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/otc/dto/AddBlackDto.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/otc/dto/BlackListDto.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/xcong/excoin/modules/otc/vo/BlackListVo.java | ●●●●● patch | view | raw | blame | history | |
src/main/resources/application.yml | ●●●●● patch | view | raw | blame | history | |
src/main/resources/mapper/otc/OtcBlackListDao.xml | ●●●●● patch | view | raw | blame | history |
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 @@ -50,9 +56,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 = "删除黑名单") src/main/java/com/xcong/excoin/modules/otc/dao/OtcBlackListDao.java
@@ -1,10 +1,15 @@ package com.xcong.excoin.modules.otc.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.xcong.excoin.modules.otc.entity.OtcBlackList; import com.xcong.excoin.modules.otc.vo.BlackListVo; import org.apache.ibatis.annotations.Param; public interface OtcBlackListDao extends BaseMapper<OtcBlackList> { OtcBlackList selectByMemberIdAndBlackMemberId(@Param("memberId") Long memberId, @Param("blackMemberId") Long blackMemberId); IPage<BlackListVo> selectBlackListInPage(@Param("memberId") Long memberId, Page<BlackListVo> page); } src/main/java/com/xcong/excoin/modules/otc/dto/AddBlackDto.java
@@ -13,10 +13,11 @@ public class AddBlackDto { @NotNull(message = "参数错误") @ApiModelProperty(value = "订单id/用户id") @ApiModelProperty(value = "订单id/黑名单id") private Long id; @NotBlank(message = "参数错误") @ApiModelProperty(value = "1-订单 2-黑名单ID") private Integer type; @ApiModelProperty(value = "原因 - 删除不传") src/main/java/com/xcong/excoin/modules/otc/dto/BlackListDto.java
@@ -1,7 +1,16 @@ package com.xcong.excoin.modules.otc.dto; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "BlackListDto", description = "黑名单列表参数接收类") public class BlackListDto { @ApiModelProperty(value = "页数") private Integer pageNum = 1; @ApiModelProperty(value = "条数") private Integer pageSize = 10; } src/main/java/com/xcong/excoin/modules/otc/vo/BlackListVo.java
New file @@ -0,0 +1,24 @@ package com.xcong.excoin.modules.otc.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 = "BlackListVo", description = "黑名单列表接口返回类") public class BlackListVo { @ApiModelProperty(value = "id") private Long id; @ApiModelProperty(value = "昵称") private String name; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "拉黑时间") private Date time; } src/main/resources/application.yml
@@ -7,12 +7,12 @@ profiles: active: dev datasource: # url: jdbc:mysql://rm-bp151tw8er79ig9kb5o.mysql.rds.aliyuncs.com:3306/db_biue?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8 # username: ctcoin_data # password: ctcoin_123 url: jdbc:mysql://120.27.238.55:3306/db_otc?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8 username: ct_test password: 123456 url: jdbc:mysql://154.91.195.170:3306/db_otc?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8 username: yd_otc password: yd_otc123!@# # url: jdbc:mysql://120.27.238.55:3306/db_otc?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8 # username: ct_test # password: 123456 driver-class-name: com.mysql.jdbc.Driver type: com.alibaba.druid.pool.DruidDataSource druid: @@ -95,6 +95,7 @@ app: debug: true project: otc redis_expire: 3000 # k线更新任务控制 kline-update-job: false src/main/resources/mapper/otc/OtcBlackListDao.xml
@@ -6,4 +6,9 @@ select * from otc_black_list where member_id=#{memberId} and black_member_id=#{blackMemberId} </select> <select id="selectBlackListInPage" resultType="com.xcong.excoin.modules.otc.vo.BlackListVo"> select a.id, a.create_time time, b.name from otc_black_list a, member b where a.black_member_id=b.id and a.member_id=#{memberId} </select> </mapper>