mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-08-19 12:41:55 +08:00
Merge remote-tracking branch 'yudao/feature/mall_product' into feature/mall_product
# Conflicts: # yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/ArticleController.java # yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/article/ArticleExcelVO.java # yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/article/vo/article/ArticleExportReqVO.java # yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/article/ArticleConvert.java # yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/article/ArticleMapper.java # yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/article/ArticleService.java # yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/article/ArticleServiceImpl.java # yudao-module-mall/yudao-module-promotion-biz/src/test/java/cn/iocoder/yudao/module/promotion/service/article/ArticleServiceImplTest.java
This commit is contained in:
@@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.promotion.controller.admin.article;
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.*;
|
||||
import cn.iocoder.yudao.module.promotion.convert.article.ArticleCategoryConvert;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleCategoryDO;
|
||||
@@ -17,15 +15,11 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 文章分类")
|
||||
@RestController
|
||||
@@ -65,23 +59,14 @@ public class ArticleCategoryController {
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:article-category:query')")
|
||||
public CommonResult<ArticleCategoryRespVO> getArticleCategory(@RequestParam("id") Long id) {
|
||||
ArticleCategoryDO articleCategory = articleCategoryService.getArticleCategory(id);
|
||||
return success(ArticleCategoryConvert.INSTANCE.convert(articleCategory));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得文章分类列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:article-category:query')")
|
||||
public CommonResult<List<ArticleCategoryRespVO>> getArticleCategoryList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<ArticleCategoryDO> list = articleCategoryService.getArticleCategoryList(ids);
|
||||
return success(ArticleCategoryConvert.INSTANCE.convertList(list));
|
||||
ArticleCategoryDO category = articleCategoryService.getArticleCategory(id);
|
||||
return success(ArticleCategoryConvert.INSTANCE.convert(category));
|
||||
}
|
||||
|
||||
@GetMapping("/list-all-simple")
|
||||
@Operation(summary = "获取文章分类精简信息列表", description = "只包含被开启的文章分类,主要用于前端的下拉选项")
|
||||
public CommonResult<List<ArticleCategorySimpleRespVO>> getSimpleDeptList() {
|
||||
// 获得部门列表,只要开启状态的
|
||||
// 获得分类列表,只要开启状态的
|
||||
List<ArticleCategoryDO> list = articleCategoryService.getArticleCategoryListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
// 降序排序后,返回给前端
|
||||
list.sort(Comparator.comparing(ArticleCategoryDO::getSort).reversed());
|
||||
@@ -96,16 +81,4 @@ public class ArticleCategoryController {
|
||||
return success(ArticleCategoryConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出文章分类 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:article-category:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportArticleCategoryExcel(@Valid ArticleCategoryExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<ArticleCategoryDO> list = articleCategoryService.getArticleCategoryList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<ArticleCategoryExcelVO> datas = ArticleCategoryConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "文章分类.xls", "数据", ArticleCategoryExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -2,9 +2,10 @@ package cn.iocoder.yudao.module.promotion.controller.admin.article;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.*;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleCreateReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticlePageReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleRespVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.convert.article.ArticleConvert;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleDO;
|
||||
import cn.iocoder.yudao.module.promotion.service.article.ArticleService;
|
||||
@@ -16,14 +17,9 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 文章管理")
|
||||
@RestController
|
||||
@@ -67,15 +63,6 @@ public class ArticleController {
|
||||
return success(ArticleConvert.INSTANCE.convert(article));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得文章管理列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:article:query')")
|
||||
public CommonResult<List<ArticleRespVO>> getArticleList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<ArticleDO> list = articleService.getArticleList(ids);
|
||||
return success(ArticleConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得文章管理分页")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:article:query')")
|
||||
@@ -84,16 +71,4 @@ public class ArticleController {
|
||||
return success(ArticleConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出文章管理 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:article:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportArticleExcel(@Valid ArticleExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<ArticleDO> list = articleService.getArticleList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<ArticleExcelVO> datas = ArticleConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "文章管理.xls", "数据", ArticleExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -34,6 +34,7 @@ public class ArticleBaseVO {
|
||||
@Schema(description = "文章简介", requiredMode = Schema.RequiredMode.REQUIRED, example = "这是一个简介")
|
||||
private String introduction;
|
||||
|
||||
// TODO @puhui999:浏览量的字段,应该不是后端新增设置的哈;
|
||||
@Schema(description = "浏览次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "111")
|
||||
private String browseCount;
|
||||
|
||||
|
@@ -1,63 +0,0 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import cn.iocoder.yudao.module.system.enums.DictTypeConstants;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* 文章管理 Excel VO
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
@Data
|
||||
public class ArticleExcelVO {
|
||||
|
||||
@ExcelProperty("文章编号")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("文章分类编号")
|
||||
private Long categoryId;
|
||||
|
||||
@ExcelProperty("关联商品编号")
|
||||
private Long spuId;
|
||||
|
||||
@ExcelProperty("文章标题")
|
||||
private String title;
|
||||
|
||||
@ExcelProperty("文章作者")
|
||||
private String author;
|
||||
|
||||
@ExcelProperty("文章封面图片地址")
|
||||
private String picUrl;
|
||||
|
||||
@ExcelProperty("文章简介")
|
||||
private String introduction;
|
||||
|
||||
@ExcelProperty("浏览次数")
|
||||
private String browseCount;
|
||||
|
||||
@ExcelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.COMMON_STATUS)
|
||||
private Integer status;
|
||||
|
||||
@ExcelProperty("是否热门(小程序)")
|
||||
private Boolean recommendHot;
|
||||
|
||||
@ExcelProperty("是否轮播图(小程序)")
|
||||
private Boolean recommendBanner;
|
||||
|
||||
@ExcelProperty("文章内容")
|
||||
private String content;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@@ -1,40 +0,0 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 文章管理 Excel 导出 Request VO,参数和 ArticlePageReqVO 是一致的")
|
||||
@Data
|
||||
public class ArticleExportReqVO {
|
||||
|
||||
@Schema(description = "文章分类编号", example = "15458")
|
||||
private Long categoryId;
|
||||
|
||||
@Schema(description = "关联商品编号", example = "22378")
|
||||
private Long spuId;
|
||||
|
||||
@Schema(description = "文章标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "文章作者")
|
||||
private String author;
|
||||
|
||||
@Schema(description = "状态", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否热门(小程序)")
|
||||
private Boolean recommendHot;
|
||||
|
||||
@Schema(description = "是否轮播图(小程序)")
|
||||
private Boolean recommendBanner;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import cn.iocoder.yudao.module.system.enums.DictTypeConstants;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* 文章分类 Excel VO
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
@Data
|
||||
public class ArticleCategoryExcelVO {
|
||||
|
||||
@ExcelProperty("文章分类编号")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("文章分类名称")
|
||||
private String name;
|
||||
|
||||
@ExcelProperty("图标地址")
|
||||
private String picUrl;
|
||||
|
||||
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.COMMON_STATUS)
|
||||
private Integer status;
|
||||
|
||||
@ExcelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@@ -1,25 +0,0 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 文章分类 Excel 导出 Request VO,参数和 ArticleCategoryPageReqVO 是一致的")
|
||||
@Data
|
||||
public class ArticleCategoryExportReqVO {
|
||||
|
||||
@Schema(description = "文章分类名称", example = "秒杀")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@@ -40,8 +40,6 @@ public class CombinationRecordController {
|
||||
@Lazy
|
||||
private CombinationRecordService combinationRecordService;
|
||||
|
||||
// 然后如果 headId 非空,并且第一页,单独多查询一条 head ;放到第 0 个位置;相当于说,第一页特殊一点;
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得拼团记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:combination-record:query')")
|
||||
|
@@ -47,13 +47,13 @@ public class AppCombinationRecordController {
|
||||
public CommonResult<AppCombinationRecordSummaryRespVO> getCombinationRecordSummary() {
|
||||
AppCombinationRecordSummaryRespVO summary = new AppCombinationRecordSummaryRespVO();
|
||||
// 1. 获得拼团参与用户数量
|
||||
Long count = combinationRecordService.getCombinationUserCount();
|
||||
if (count == 0) {
|
||||
Long userCount = combinationRecordService.getCombinationUserCount();
|
||||
if (userCount == 0) {
|
||||
summary.setAvatars(Collections.emptyList());
|
||||
summary.setUserCount(count);
|
||||
summary.setUserCount(userCount);
|
||||
return success(summary);
|
||||
}
|
||||
summary.setUserCount(count);
|
||||
summary.setUserCount(userCount);
|
||||
|
||||
// 2. 获得拼团记录头像
|
||||
List<CombinationRecordDO> records = combinationRecordService.getLatestCombinationRecordList(
|
||||
|
@@ -29,8 +29,6 @@ public interface ArticleCategoryConvert {
|
||||
|
||||
PageResult<ArticleCategoryRespVO> convertPage(PageResult<ArticleCategoryDO> page);
|
||||
|
||||
List<ArticleCategoryExcelVO> convertList02(List<ArticleCategoryDO> list);
|
||||
|
||||
List<ArticleCategorySimpleRespVO> convertList03(List<ArticleCategoryDO> list);
|
||||
|
||||
List<AppArticleCategoryRespVO> convertList04(List<ArticleCategoryDO> categoryList);
|
||||
|
@@ -2,10 +2,8 @@ package cn.iocoder.yudao.module.promotion.convert.article;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleCreateReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleExcelVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleRespVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.app.article.vo.article.AppArticleRespVO;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@@ -32,12 +30,4 @@ public interface ArticleConvert {
|
||||
|
||||
PageResult<ArticleRespVO> convertPage(PageResult<ArticleDO> page);
|
||||
|
||||
List<ArticleExcelVO> convertList02(List<ArticleDO> list);
|
||||
|
||||
List<AppArticleRespVO> convertList03(List<ArticleDO> list);
|
||||
|
||||
AppArticleRespVO convert01(ArticleDO article);
|
||||
|
||||
PageResult<AppArticleRespVO> convertPage02(PageResult<ArticleDO> articlePage);
|
||||
|
||||
}
|
||||
|
@@ -192,7 +192,6 @@ public interface CombinationActivityConvert {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
default AppCombinationRecordDetailRespVO convert(Long userId, CombinationRecordDO headRecord, List<CombinationRecordDO> memberRecords) {
|
||||
AppCombinationRecordDetailRespVO respVO = new AppCombinationRecordDetailRespVO()
|
||||
.setHeadRecord(convert(headRecord)).setMemberRecords(convertList3(memberRecords));
|
||||
|
@@ -3,13 +3,10 @@ package cn.iocoder.yudao.module.promotion.dal.mysql.article;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryExportReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryPageReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleCategoryDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文章分类 Mapper
|
||||
*
|
||||
@@ -26,12 +23,4 @@ public interface ArticleCategoryMapper extends BaseMapperX<ArticleCategoryDO> {
|
||||
.orderByDesc(ArticleCategoryDO::getSort));
|
||||
}
|
||||
|
||||
default List<ArticleCategoryDO> selectList(ArticleCategoryExportReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<ArticleCategoryDO>()
|
||||
.likeIfPresent(ArticleCategoryDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ArticleCategoryDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(ArticleCategoryDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ArticleCategoryDO::getSort));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -3,14 +3,10 @@ package cn.iocoder.yudao.module.promotion.dal.mysql.article;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleExportReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticlePageReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.app.article.vo.article.AppArticlePageReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文章管理 Mapper
|
||||
*
|
||||
@@ -32,28 +28,4 @@ public interface ArticleMapper extends BaseMapperX<ArticleDO> {
|
||||
.orderByDesc(ArticleDO::getId));
|
||||
}
|
||||
|
||||
default List<ArticleDO> selectList(ArticleExportReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<ArticleDO>()
|
||||
.eqIfPresent(ArticleDO::getCategoryId, reqVO.getCategoryId())
|
||||
.eqIfPresent(ArticleDO::getTitle, reqVO.getTitle())
|
||||
.eqIfPresent(ArticleDO::getAuthor, reqVO.getAuthor())
|
||||
.eqIfPresent(ArticleDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ArticleDO::getSpuId, reqVO.getSpuId())
|
||||
.eqIfPresent(ArticleDO::getRecommendHot, reqVO.getRecommendHot())
|
||||
.eqIfPresent(ArticleDO::getRecommendBanner, reqVO.getRecommendBanner())
|
||||
.betweenIfPresent(ArticleDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ArticleDO::getId));
|
||||
}
|
||||
|
||||
default List<ArticleDO> selectList(Boolean recommendHot, Boolean recommendBanner) {
|
||||
return selectList(new LambdaQueryWrapperX<ArticleDO>()
|
||||
.eqIfPresent(ArticleDO::getRecommendHot, recommendHot)
|
||||
.eqIfPresent(ArticleDO::getRecommendBanner, recommendBanner));
|
||||
}
|
||||
|
||||
default PageResult<ArticleDO> selectPage(AppArticlePageReqVO pageReqVO) {
|
||||
return selectPage(pageReqVO, new LambdaQueryWrapperX<ArticleDO>()
|
||||
.eqIfPresent(ArticleDO::getCategoryId, pageReqVO.getCategoryId()));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -99,10 +99,10 @@ public interface CombinationRecordMapper extends BaseMapperX<CombinationRecordDO
|
||||
LambdaQueryWrapperX<CombinationRecordDO> queryWrapper = new LambdaQueryWrapperX<CombinationRecordDO>()
|
||||
.eqIfPresent(CombinationRecordDO::getStatus, pageVO.getStatus())
|
||||
.betweenIfPresent(CombinationRecordDO::getCreateTime, pageVO.getCreateTime());
|
||||
// 如果 headId 非空,说明查询指定团的团长 + 团员的拼团记录
|
||||
if (pageVO.getHeadId() != null) {
|
||||
queryWrapper.eq(CombinationRecordDO::getId, pageVO.getHeadId())
|
||||
.or()
|
||||
.eq(CombinationRecordDO::getHeadId, pageVO.getHeadId());
|
||||
queryWrapper.eq(CombinationRecordDO::getId, pageVO.getHeadId()) // 团长
|
||||
.or().eq(CombinationRecordDO::getHeadId, pageVO.getHeadId()); // 团员
|
||||
}
|
||||
return selectPage(pageVO, queryWrapper);
|
||||
}
|
||||
@@ -127,6 +127,7 @@ public interface CombinationRecordMapper extends BaseMapperX<CombinationRecordDO
|
||||
*
|
||||
* @return 参加过拼团的用户数
|
||||
*/
|
||||
// TODO @puhui999:1)方法名,直接 selectUserCount;2)COUNT(DISTINCT(user_id)) 就可以啦,不用 group by 哈
|
||||
default Long selectUserDistinctCount() {
|
||||
return selectCount(new QueryWrapper<CombinationRecordDO>()
|
||||
.select("DISTINCT (user_id)")
|
||||
|
@@ -2,13 +2,11 @@ package cn.iocoder.yudao.module.promotion.service.article;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryCreateReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryExportReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryPageReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleCategoryDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -48,14 +46,6 @@ public interface ArticleCategoryService {
|
||||
*/
|
||||
ArticleCategoryDO getArticleCategory(Long id);
|
||||
|
||||
/**
|
||||
* 获得文章分类列表
|
||||
*
|
||||
* @param ids 编号
|
||||
* @return 文章分类列表
|
||||
*/
|
||||
List<ArticleCategoryDO> getArticleCategoryList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得文章分类分页
|
||||
*
|
||||
@@ -64,14 +54,6 @@ public interface ArticleCategoryService {
|
||||
*/
|
||||
PageResult<ArticleCategoryDO> getArticleCategoryPage(ArticleCategoryPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得文章分类列表, 用于 Excel 导出
|
||||
*
|
||||
* @param exportReqVO 查询条件
|
||||
* @return 文章分类列表
|
||||
*/
|
||||
List<ArticleCategoryDO> getArticleCategoryList(ArticleCategoryExportReqVO exportReqVO);
|
||||
|
||||
/**
|
||||
* 获得指定状态的文章分类列表
|
||||
*
|
||||
|
@@ -1,10 +1,7 @@
|
||||
package cn.iocoder.yudao.module.promotion.service.article;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryCreateReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryExportReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryPageReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.convert.article.ArticleCategoryConvert;
|
||||
@@ -14,7 +11,6 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
@@ -35,10 +31,10 @@ public class ArticleCategoryServiceImpl implements ArticleCategoryService {
|
||||
@Override
|
||||
public Long createArticleCategory(ArticleCategoryCreateReqVO createReqVO) {
|
||||
// 插入
|
||||
ArticleCategoryDO articleCategory = ArticleCategoryConvert.INSTANCE.convert(createReqVO);
|
||||
articleCategoryMapper.insert(articleCategory);
|
||||
ArticleCategoryDO category = ArticleCategoryConvert.INSTANCE.convert(createReqVO);
|
||||
articleCategoryMapper.insert(category);
|
||||
// 返回
|
||||
return articleCategory.getId();
|
||||
return category.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,6 +50,8 @@ public class ArticleCategoryServiceImpl implements ArticleCategoryService {
|
||||
public void deleteArticleCategory(Long id) {
|
||||
// 校验存在
|
||||
validateArticleCategoryExists(id);
|
||||
// TODO @puhui999:需要校验下,是不是存在文章
|
||||
|
||||
// 删除
|
||||
articleCategoryMapper.deleteById(id);
|
||||
}
|
||||
@@ -69,24 +67,11 @@ public class ArticleCategoryServiceImpl implements ArticleCategoryService {
|
||||
return articleCategoryMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArticleCategoryDO> getArticleCategoryList(Collection<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return ListUtil.empty();
|
||||
}
|
||||
return articleCategoryMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ArticleCategoryDO> getArticleCategoryPage(ArticleCategoryPageReqVO pageReqVO) {
|
||||
return articleCategoryMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArticleCategoryDO> getArticleCategoryList(ArticleCategoryExportReqVO exportReqVO) {
|
||||
return articleCategoryMapper.selectList(exportReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArticleCategoryDO> getArticleCategoryListByStatus(Integer status) {
|
||||
return articleCategoryMapper.selectList(ArticleCategoryDO::getStatus, status);
|
||||
|
@@ -2,25 +2,21 @@ package cn.iocoder.yudao.module.promotion.service.article;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleCreateReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleExportReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticlePageReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.app.article.vo.article.AppArticlePageReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文章详情 Service 接口
|
||||
* 文章管理 Service 接口
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
public interface ArticleService {
|
||||
|
||||
/**
|
||||
* 创建文章详情
|
||||
* 创建文章管理
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
@@ -28,66 +24,33 @@ public interface ArticleService {
|
||||
Long createArticle(@Valid ArticleCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新文章详情
|
||||
* 更新文章管理
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateArticle(@Valid ArticleUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除文章详情
|
||||
* 删除文章管理
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteArticle(Long id);
|
||||
|
||||
/**
|
||||
* 获得文章详情
|
||||
* 获得文章管理
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 文章详情
|
||||
* @return 文章管理
|
||||
*/
|
||||
ArticleDO getArticle(Long id);
|
||||
|
||||
/**
|
||||
* 获得文章详情列表
|
||||
*
|
||||
* @param ids 编号
|
||||
* @return 文章详情列表
|
||||
*/
|
||||
List<ArticleDO> getArticleList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得文章详情分页
|
||||
* 获得文章管理分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 文章详情分页
|
||||
* @return 文章管理分页
|
||||
*/
|
||||
PageResult<ArticleDO> getArticlePage(ArticlePageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得文章详情列表, 用于 Excel 导出
|
||||
*
|
||||
* @param exportReqVO 查询条件
|
||||
* @return 文章详情列表
|
||||
*/
|
||||
List<ArticleDO> getArticleList(ArticleExportReqVO exportReqVO);
|
||||
|
||||
/**
|
||||
* 获得文章详情列表
|
||||
*
|
||||
* @param recommendHot 是否热门
|
||||
* @param recommendBanner 是否轮播图
|
||||
* @return 文章详情列表
|
||||
*/
|
||||
List<ArticleDO> getArticleCategoryListByRecommendHotAndRecommendBanner(Boolean recommendHot, Boolean recommendBanner);
|
||||
|
||||
/**
|
||||
* 获得文章详情分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 文章详情分页
|
||||
*/
|
||||
PageResult<ArticleDO> getArticlePage(AppArticlePageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
|
@@ -1,13 +1,9 @@
|
||||
package cn.iocoder.yudao.module.promotion.service.article;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleCreateReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleExportReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticlePageReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.app.article.vo.article.AppArticlePageReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.convert.article.ArticleConvert;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleDO;
|
||||
import cn.iocoder.yudao.module.promotion.dal.mysql.article.ArticleMapper;
|
||||
@@ -15,8 +11,6 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.ARTICLE_NOT_EXISTS;
|
||||
@@ -35,6 +29,7 @@ public class ArticleServiceImpl implements ArticleService {
|
||||
|
||||
@Override
|
||||
public Long createArticle(ArticleCreateReqVO createReqVO) {
|
||||
// TODO @puhui999:需要校验分类存在
|
||||
// 插入
|
||||
ArticleDO article = ArticleConvert.INSTANCE.convert(createReqVO);
|
||||
articleMapper.insert(article);
|
||||
@@ -46,6 +41,8 @@ public class ArticleServiceImpl implements ArticleService {
|
||||
public void updateArticle(ArticleUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateArticleExists(updateReqVO.getId());
|
||||
// TODO @puhui999:需要校验分类存在
|
||||
|
||||
// 更新
|
||||
ArticleDO updateObj = ArticleConvert.INSTANCE.convert(updateReqVO);
|
||||
articleMapper.updateById(updateObj);
|
||||
@@ -70,32 +67,9 @@ public class ArticleServiceImpl implements ArticleService {
|
||||
return articleMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArticleDO> getArticleList(Collection<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return ListUtil.empty();
|
||||
}
|
||||
return articleMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ArticleDO> getArticlePage(ArticlePageReqVO pageReqVO) {
|
||||
return articleMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArticleDO> getArticleList(ArticleExportReqVO exportReqVO) {
|
||||
return articleMapper.selectList(exportReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArticleDO> getArticleCategoryListByRecommendHotAndRecommendBanner(Boolean recommendHot, Boolean recommendBanner) {
|
||||
return articleMapper.selectList(recommendHot, recommendBanner);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ArticleDO> getArticlePage(AppArticlePageReqVO pageReqVO) {
|
||||
return articleMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -339,19 +339,20 @@ public class CombinationRecordServiceImpl implements CombinationRecordService {
|
||||
|
||||
@Override
|
||||
public KeyValue<Integer, Integer> expireCombinationRecord() {
|
||||
// 1.获取所有正在进行中的过期的父拼团
|
||||
// 1. 获取所有正在进行中的过期的父拼团
|
||||
List<CombinationRecordDO> headExpireRecords = combinationRecordMapper.selectListByHeadIdAndStatusAndExpireTimeLt(
|
||||
CombinationRecordDO.HEAD_ID_GROUP, CombinationRecordStatusEnum.IN_PROGRESS.getStatus(), LocalDateTime.now());
|
||||
if (CollUtil.isEmpty(headExpireRecords)) {
|
||||
return new KeyValue<>(0, 0);
|
||||
}
|
||||
|
||||
// 2.获取拼团活动
|
||||
// 2. 获取拼团活动
|
||||
List<CombinationActivityDO> activities = combinationActivityService.getCombinationActivityListByIds(
|
||||
convertSet(headExpireRecords, CombinationRecordDO::getActivityId));
|
||||
Map<Long, CombinationActivityDO> activityMap = convertMap(activities, CombinationActivityDO::getId);
|
||||
|
||||
// 3.校验是否虚拟成团
|
||||
// TODO @puhui999:这里可以改成“每个团”,处理一次哈;这样 handleExpireRecord、handleVirtualGroupRecord 都改成按团处理,每个是一个小事务;
|
||||
// 3. 校验是否虚拟成团
|
||||
List<CombinationRecordDO> virtualGroupHeadRecords = new ArrayList<>(); // 虚拟成团
|
||||
for (Iterator<CombinationRecordDO> iterator = headExpireRecords.iterator(); iterator.hasNext(); ) {
|
||||
CombinationRecordDO record = iterator.next();
|
||||
|
@@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.promotion.service.article;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryCreateReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryExportReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryPageReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.category.ArticleCategoryUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleCategoryDO;
|
||||
@@ -13,7 +12,6 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime;
|
||||
import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId;
|
||||
@@ -24,6 +22,7 @@ import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo;
|
||||
import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.ARTICLE_CATEGORY_NOT_EXISTS;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
// TODO 芋艿:review 单测
|
||||
/**
|
||||
* {@link ArticleCategoryServiceImpl} 的单元测试类
|
||||
*
|
||||
@@ -137,39 +136,4 @@ public class ArticleCategoryServiceImplTest extends BaseDbUnitTest {
|
||||
assertPojoEquals(dbArticleCategory, pageResult.getList().get(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
|
||||
public void testGetArticleCategoryList() {
|
||||
// mock 数据
|
||||
ArticleCategoryDO dbArticleCategory = randomPojo(ArticleCategoryDO.class, o -> { // 等会查询到
|
||||
o.setName(null);
|
||||
o.setPicUrl(null);
|
||||
o.setStatus(null);
|
||||
o.setSort(null);
|
||||
o.setCreateTime(null);
|
||||
});
|
||||
articleCategoryMapper.insert(dbArticleCategory);
|
||||
// 测试 name 不匹配
|
||||
articleCategoryMapper.insert(cloneIgnoreId(dbArticleCategory, o -> o.setName(null)));
|
||||
// 测试 picUrl 不匹配
|
||||
articleCategoryMapper.insert(cloneIgnoreId(dbArticleCategory, o -> o.setPicUrl(null)));
|
||||
// 测试 status 不匹配
|
||||
articleCategoryMapper.insert(cloneIgnoreId(dbArticleCategory, o -> o.setStatus(null)));
|
||||
// 测试 sort 不匹配
|
||||
articleCategoryMapper.insert(cloneIgnoreId(dbArticleCategory, o -> o.setSort(null)));
|
||||
// 测试 createTime 不匹配
|
||||
articleCategoryMapper.insert(cloneIgnoreId(dbArticleCategory, o -> o.setCreateTime(null)));
|
||||
// 准备参数
|
||||
ArticleCategoryExportReqVO reqVO = new ArticleCategoryExportReqVO();
|
||||
reqVO.setName(null);
|
||||
reqVO.setStatus(null);
|
||||
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
|
||||
|
||||
// 调用
|
||||
List<ArticleCategoryDO> list = articleCategoryService.getArticleCategoryList(reqVO);
|
||||
// 断言
|
||||
assertEquals(1, list.size());
|
||||
assertPojoEquals(dbArticleCategory, list.get(0));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.promotion.service.article;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleCreateReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleExportReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.ArticleExportReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticlePageReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.article.vo.article.ArticleUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.article.ArticleDO;
|
||||
|
Reference in New Issue
Block a user