feat:朋友圈
This commit is contained in:
1 parent
1ae786dc8b
commit
8f3b113fcc
35 files changed
+1094
-73
No files matched your search
+2
-52
@@ -1,58 +1,8 @@
|
||||
package cn.iocoder.yudao.module.member.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
|
||||
/**
|
||||
* Member 错误码枚举类
|
||||
* <p>
|
||||
* member 系统,使用 1-004-000-000 段
|
||||
* @author liusiyang_dxm
|
||||
* @since 2025/10/28
|
||||
*/
|
||||
public interface ErrorCodeConstants {
|
||||
|
||||
// ========== 用户相关 1-004-001-000 ============
|
||||
ErrorCode USER_NOT_EXISTS = new ErrorCode(1_004_001_000, "用户不存在");
|
||||
ErrorCode USER_MOBILE_NOT_EXISTS = new ErrorCode(1_004_001_001, "手机号未注册用户");
|
||||
ErrorCode USER_MOBILE_USED = new ErrorCode(1_004_001_002, "修改手机失败,该手机号({})已经被使用");
|
||||
ErrorCode USER_POINT_NOT_ENOUGH = new ErrorCode(1_004_001_003, "用户积分余额不足");
|
||||
|
||||
// ========== AUTH 模块 1-004-003-000 ==========
|
||||
ErrorCode AUTH_LOGIN_BAD_CREDENTIALS = new ErrorCode(1_004_003_000, "登录失败,账号密码不正确");
|
||||
ErrorCode AUTH_LOGIN_USER_DISABLED = new ErrorCode(1_004_003_001, "登录失败,账号被禁用");
|
||||
ErrorCode AUTH_SOCIAL_USER_NOT_FOUND = new ErrorCode(1_004_003_005, "登录失败,解析不到三方登录信息");
|
||||
ErrorCode AUTH_MOBILE_USED = new ErrorCode(1_004_003_007, "手机号已经被使用");
|
||||
|
||||
// ========== 用户收件地址 1-004-004-000 ==========
|
||||
ErrorCode ADDRESS_NOT_EXISTS = new ErrorCode(1_004_004_000, "用户收件地址不存在");
|
||||
|
||||
//========== 用户标签 1-004-006-000 ==========
|
||||
ErrorCode TAG_NOT_EXISTS = new ErrorCode(1_004_006_000, "用户标签不存在");
|
||||
ErrorCode TAG_NAME_EXISTS = new ErrorCode(1_004_006_001, "用户标签已经存在");
|
||||
ErrorCode TAG_HAS_USER = new ErrorCode(1_004_006_002, "用户标签下存在用户,无法删除");
|
||||
|
||||
//========== 积分配置 1-004-007-000 ==========
|
||||
|
||||
//========== 积分记录 1-004-008-000 ==========
|
||||
ErrorCode POINT_RECORD_BIZ_NOT_SUPPORT = new ErrorCode(1_004_008_000, "用户积分记录业务类型不支持");
|
||||
|
||||
//========== 签到配置 1-004-009-000 ==========
|
||||
ErrorCode SIGN_IN_CONFIG_NOT_EXISTS = new ErrorCode(1_004_009_000, "签到天数规则不存在");
|
||||
ErrorCode SIGN_IN_CONFIG_EXISTS = new ErrorCode(1_004_009_001, "签到天数规则已存在");
|
||||
|
||||
//========== 签到配置 1-004-010-000 ==========
|
||||
ErrorCode SIGN_IN_RECORD_TODAY_EXISTS = new ErrorCode(1_004_010_000, "今日已签到,请勿重复签到");
|
||||
|
||||
//========== 用户等级 1-004-011-000 ==========
|
||||
ErrorCode LEVEL_NOT_EXISTS = new ErrorCode(1_004_011_000, "用户等级不存在");
|
||||
ErrorCode LEVEL_NAME_EXISTS = new ErrorCode(1_004_011_001, "用户等级名称[{}]已被使用");
|
||||
ErrorCode LEVEL_VALUE_EXISTS = new ErrorCode(1_004_011_002, "用户等级值[{}]已被[{}]使用");
|
||||
ErrorCode LEVEL_EXPERIENCE_MIN = new ErrorCode(1_004_011_003, "升级经验必须大于上一个等级[{}]设置的升级经验[{}]");
|
||||
ErrorCode LEVEL_EXPERIENCE_MAX = new ErrorCode(1_004_011_004, "升级经验必须小于下一个等级[{}]设置的升级经验[{}]");
|
||||
ErrorCode LEVEL_HAS_USER = new ErrorCode(1_004_011_005, "用户等级下存在用户,无法删除");
|
||||
|
||||
ErrorCode EXPERIENCE_BIZ_NOT_SUPPORT = new ErrorCode(1_004_011_201, "用户经验业务类型不支持");
|
||||
|
||||
//========== 用户分组 1-004-012-000 ==========
|
||||
ErrorCode GROUP_NOT_EXISTS = new ErrorCode(1_004_012_000, "用户分组不存在");
|
||||
ErrorCode GROUP_HAS_USER = new ErrorCode(1_004_012_001, "用户分组下存在用户,无法删除");
|
||||
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.member.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
|
||||
/**
|
||||
* 会员朋友圈
|
||||
*/
|
||||
public interface MemberRecentErrorCode {
|
||||
|
||||
// ========== 用户相关 1-004-001-000 ============
|
||||
ErrorCode USER_NOT_EXISTS = new ErrorCode(1_004_001_000, "用户不存在");
|
||||
ErrorCode USER_MOBILE_NOT_EXISTS = new ErrorCode(1_004_001_001, "手机号未注册用户");
|
||||
ErrorCode USER_MOBILE_USED = new ErrorCode(1_004_001_002, "修改手机失败,该手机号({})已经被使用");
|
||||
ErrorCode USER_POINT_NOT_ENOUGH = new ErrorCode(1_004_001_003, "用户积分余额不足");
|
||||
|
||||
// ========== AUTH 模块 1-004-003-000 ==========
|
||||
ErrorCode AUTH_LOGIN_BAD_CREDENTIALS = new ErrorCode(1_004_003_000, "登录失败,账号密码不正确");
|
||||
ErrorCode AUTH_LOGIN_USER_DISABLED = new ErrorCode(1_004_003_001, "登录失败,账号被禁用");
|
||||
ErrorCode AUTH_SOCIAL_USER_NOT_FOUND = new ErrorCode(1_004_003_005, "登录失败,解析不到三方登录信息");
|
||||
ErrorCode AUTH_MOBILE_USED = new ErrorCode(1_004_003_007, "手机号已经被使用");
|
||||
|
||||
// ========== 用户收件地址 1-004-004-000 ==========
|
||||
ErrorCode ADDRESS_NOT_EXISTS = new ErrorCode(1_004_004_000, "用户收件地址不存在");
|
||||
|
||||
//========== 用户标签 1-004-006-000 ==========
|
||||
ErrorCode TAG_NOT_EXISTS = new ErrorCode(1_004_006_000, "用户标签不存在");
|
||||
ErrorCode TAG_NAME_EXISTS = new ErrorCode(1_004_006_001, "用户标签已经存在");
|
||||
ErrorCode TAG_HAS_USER = new ErrorCode(1_004_006_002, "用户标签下存在用户,无法删除");
|
||||
|
||||
//========== 积分配置 1-004-007-000 ==========
|
||||
|
||||
//========== 积分记录 1-004-008-000 ==========
|
||||
ErrorCode POINT_RECORD_BIZ_NOT_SUPPORT = new ErrorCode(1_004_008_000, "用户积分记录业务类型不支持");
|
||||
|
||||
//========== 签到配置 1-004-009-000 ==========
|
||||
ErrorCode SIGN_IN_CONFIG_NOT_EXISTS = new ErrorCode(1_004_009_000, "签到天数规则不存在");
|
||||
ErrorCode SIGN_IN_CONFIG_EXISTS = new ErrorCode(1_004_009_001, "签到天数规则已存在");
|
||||
|
||||
//========== 签到配置 1-004-010-000 ==========
|
||||
ErrorCode SIGN_IN_RECORD_TODAY_EXISTS = new ErrorCode(1_004_010_000, "今日已签到,请勿重复签到");
|
||||
|
||||
//========== 用户等级 1-004-011-000 ==========
|
||||
ErrorCode LEVEL_NOT_EXISTS = new ErrorCode(1_004_011_000, "用户等级不存在");
|
||||
ErrorCode LEVEL_NAME_EXISTS = new ErrorCode(1_004_011_001, "用户等级名称[{}]已被使用");
|
||||
ErrorCode LEVEL_VALUE_EXISTS = new ErrorCode(1_004_011_002, "用户等级值[{}]已被[{}]使用");
|
||||
ErrorCode LEVEL_EXPERIENCE_MIN = new ErrorCode(1_004_011_003, "升级经验必须大于上一个等级[{}]设置的升级经验[{}]");
|
||||
ErrorCode LEVEL_EXPERIENCE_MAX = new ErrorCode(1_004_011_004, "升级经验必须小于下一个等级[{}]设置的升级经验[{}]");
|
||||
ErrorCode LEVEL_HAS_USER = new ErrorCode(1_004_011_005, "用户等级下存在用户,无法删除");
|
||||
|
||||
ErrorCode EXPERIENCE_BIZ_NOT_SUPPORT = new ErrorCode(1_004_011_201, "用户经验业务类型不支持");
|
||||
|
||||
//========== 用户分组 1-004-012-000 ==========
|
||||
ErrorCode GROUP_NOT_EXISTS = new ErrorCode(1_004_012_000, "用户分组不存在");
|
||||
ErrorCode GROUP_HAS_USER = new ErrorCode(1_004_012_001, "用户分组下存在用户,无法删除");
|
||||
|
||||
//========== 用户朋友圈 1-004-012-000 ==========
|
||||
ErrorCode OPERATION_NOT_EXISTS = new ErrorCode(2_001_000_001, "朋友圈操作不存在");
|
||||
|
||||
ErrorCode RECENT_NOT_EXISTS = new ErrorCode(2_001_000_001, "朋友圈操作不存在");
|
||||
|
||||
}
|
||||
+1
-1
@@ -11,7 +11,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.EXPERIENCE_BIZ_NOT_SUPPORT;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.EXPERIENCE_BIZ_NOT_SUPPORT;
|
||||
|
||||
/**
|
||||
* 会员等级 API 实现类
|
||||
|
||||
+2
-3
@@ -10,7 +10,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.POINT_RECORD_BIZ_NOT_SUPPORT;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.POINT_RECORD_BIZ_NOT_SUPPORT;
|
||||
|
||||
/**
|
||||
* 用户积分的 API 实现类
|
||||
@@ -30,8 +30,7 @@ public class MemberPointApiImpl implements MemberPointApi {
|
||||
Assert.isTrue(point > 0);
|
||||
MemberPointBizTypeEnum bizTypeEnum = MemberPointBizTypeEnum.getByType(bizType);
|
||||
if (bizTypeEnum == null) {
|
||||
log.error("[addPoint][userId({}) point({}) bizType({}) bizId({}) {}]", userId, point, bizType, bizId,
|
||||
POINT_RECORD_BIZ_NOT_SUPPORT);
|
||||
log.error("[addPoint][userId({}) point({}) bizType({}) bizId({}) {}]", userId, point, bizType, bizId, POINT_RECORD_BIZ_NOT_SUPPORT);
|
||||
return;
|
||||
}
|
||||
memberPointRecordService.createPointRecord(userId, point, bizTypeEnum, bizId);
|
||||
|
||||
+2
-1
@@ -12,7 +12,8 @@ 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.member.enums.ErrorCodeConstants.USER_MOBILE_NOT_EXISTS;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.USER_MOBILE_NOT_EXISTS;
|
||||
|
||||
|
||||
/**
|
||||
* 会员用户的 API 实现类
|
||||
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.recent;
|
||||
|
||||
import cn.iocoder.yudao.module.member.controller.admin.recent.vo.OperationPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.recent.vo.OperationRespVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.recent.vo.OperationSaveReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.recent.OperationDO;
|
||||
import cn.iocoder.yudao.module.member.service.recent.OperationService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 朋友圈操作")
|
||||
@RestController
|
||||
@RequestMapping("/member/operation")
|
||||
@Validated
|
||||
public class OperationController {
|
||||
|
||||
@Resource
|
||||
private OperationService operationService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建朋友圈操作")
|
||||
@PreAuthorize("@ss.hasPermission('member:operation:create')")
|
||||
public CommonResult<Long> createOperation(@Valid @RequestBody OperationSaveReqVO createReqVO) {
|
||||
return success(operationService.createOperation(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新朋友圈操作")
|
||||
@PreAuthorize("@ss.hasPermission('member:operation:update')")
|
||||
public CommonResult<Boolean> updateOperation(@Valid @RequestBody OperationSaveReqVO updateReqVO) {
|
||||
operationService.updateOperation(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除朋友圈操作")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('member:operation:delete')")
|
||||
public CommonResult<Boolean> deleteOperation(@RequestParam("id") Long id) {
|
||||
operationService.deleteOperation(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得朋友圈操作")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('member:operation:query')")
|
||||
public CommonResult<OperationRespVO> getOperation(@RequestParam("id") Long id) {
|
||||
OperationDO operation = operationService.getOperation(id);
|
||||
return success(BeanUtils.toBean(operation, OperationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得朋友圈操作分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:operation:query')")
|
||||
public CommonResult<PageResult<OperationRespVO>> getOperationPage(@Valid OperationPageReqVO pageReqVO) {
|
||||
PageResult<OperationDO> pageResult = operationService.getOperationPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, OperationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出朋友圈操作 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('member:operation:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportOperationExcel(@Valid OperationPageReqVO pageReqVO, HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<OperationDO> list = operationService.getOperationPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "朋友圈操作.xls", "数据", OperationRespVO.class, BeanUtils.toBean(list, OperationRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.recent;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.member.controller.admin.recent.vo.*;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.recent.RecentDO;
|
||||
import cn.iocoder.yudao.module.member.service.recent.RecentService;
|
||||
|
||||
@Tag(name = "管理后台 - 朋友圈")
|
||||
@RestController
|
||||
@RequestMapping("/member/recent")
|
||||
@Validated
|
||||
public class RecentController {
|
||||
|
||||
@Resource
|
||||
private RecentService recentService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建朋友圈")
|
||||
@PreAuthorize("@ss.hasPermission('member:recent:create')")
|
||||
public CommonResult<Long> createRecent(@Valid @RequestBody RecentSaveReqVO createReqVO) {
|
||||
return success(recentService.createRecent(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新朋友圈")
|
||||
@PreAuthorize("@ss.hasPermission('member:recent:update')")
|
||||
public CommonResult<Boolean> updateRecent(@Valid @RequestBody RecentSaveReqVO updateReqVO) {
|
||||
recentService.updateRecent(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除朋友圈")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('member:recent:delete')")
|
||||
public CommonResult<Boolean> deleteRecent(@RequestParam("id") Long id) {
|
||||
recentService.deleteRecent(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得朋友圈")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('member:recent:query')")
|
||||
public CommonResult<RecentRespVO> getRecent(@RequestParam("id") Long id) {
|
||||
RecentDO recent = recentService.getRecent(id);
|
||||
return success(BeanUtils.toBean(recent, RecentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得朋友圈分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:recent:query')")
|
||||
public CommonResult<PageResult<RecentRespVO>> getRecentPage(@Valid RecentPageReqVO pageReqVO) {
|
||||
PageResult<RecentDO> pageResult = recentService.getRecentPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, RecentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出朋友圈 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('member:recent:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportRecentExcel(@Valid RecentPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RecentDO> list = recentService.getRecentPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "朋友圈.xls", "数据", RecentRespVO.class,
|
||||
BeanUtils.toBean(list, RecentRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.recent.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
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 = "管理后台 - 朋友圈操作分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class OperationPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "用户编号", example = "31854")
|
||||
private Long memberId;
|
||||
|
||||
@Schema(description = "朋友圈编号", example = "29447")
|
||||
private Long memberRecentId;
|
||||
|
||||
@Schema(description = "点赞、屏蔽、举报", example = "2")
|
||||
private String bizType;
|
||||
|
||||
@Schema(description = "点击时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] tapTime;
|
||||
|
||||
@Schema(description = "取消时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] cancelTime;
|
||||
|
||||
@Schema(description = "举报类型", example = "2")
|
||||
private String reportType;
|
||||
|
||||
@Schema(description = "身材评分")
|
||||
private Integer scoreSc;
|
||||
|
||||
@Schema(description = "耐心评分")
|
||||
private Integer scoreNx;
|
||||
|
||||
@Schema(description = "爽快评分")
|
||||
private Integer scoreSk;
|
||||
|
||||
@Schema(description = "有趣评分")
|
||||
private Integer scoreYq;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.recent.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 朋友圈操作 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class OperationRespVO {
|
||||
|
||||
@Schema(description = "收件地址编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11909")
|
||||
@ExcelProperty("收件地址编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "31854")
|
||||
@ExcelProperty("用户编号")
|
||||
private Long memberId;
|
||||
|
||||
@Schema(description = "朋友圈编号", example = "29447")
|
||||
@ExcelProperty("朋友圈编号")
|
||||
private Long memberRecentId;
|
||||
|
||||
@Schema(description = "点赞、屏蔽、举报", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("点赞、屏蔽、举报")
|
||||
private String bizType;
|
||||
|
||||
@Schema(description = "点击时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("点击时间")
|
||||
private LocalDateTime tapTime;
|
||||
|
||||
@Schema(description = "取消时间")
|
||||
@ExcelProperty("取消时间")
|
||||
private LocalDateTime cancelTime;
|
||||
|
||||
@Schema(description = "举报类型", example = "2")
|
||||
@ExcelProperty("举报类型")
|
||||
private String reportType;
|
||||
|
||||
@Schema(description = "身材评分")
|
||||
@ExcelProperty("身材评分")
|
||||
private Integer scoreSc;
|
||||
|
||||
@Schema(description = "耐心评分")
|
||||
@ExcelProperty("耐心评分")
|
||||
private Integer scoreNx;
|
||||
|
||||
@Schema(description = "爽快评分")
|
||||
@ExcelProperty("爽快评分")
|
||||
private Integer scoreSk;
|
||||
|
||||
@Schema(description = "有趣评分")
|
||||
@ExcelProperty("有趣评分")
|
||||
private Integer scoreYq;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.recent.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 朋友圈操作新增/修改 Request VO")
|
||||
@Data
|
||||
public class OperationSaveReqVO {
|
||||
|
||||
@Schema(description = "收件地址编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11909")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "31854")
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Long memberId;
|
||||
|
||||
@Schema(description = "朋友圈编号", example = "29447")
|
||||
private Long memberRecentId;
|
||||
|
||||
@Schema(description = "点赞、屏蔽、举报", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "点赞、屏蔽、举报不能为空")
|
||||
private String bizType;
|
||||
|
||||
@Schema(description = "点击时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "点击时间不能为空")
|
||||
private LocalDateTime tapTime;
|
||||
|
||||
@Schema(description = "取消时间")
|
||||
private LocalDateTime cancelTime;
|
||||
|
||||
@Schema(description = "举报类型", example = "2")
|
||||
private String reportType;
|
||||
|
||||
@Schema(description = "身材评分")
|
||||
private Integer scoreSc;
|
||||
|
||||
@Schema(description = "耐心评分")
|
||||
private Integer scoreNx;
|
||||
|
||||
@Schema(description = "爽快评分")
|
||||
private Integer scoreSk;
|
||||
|
||||
@Schema(description = "有趣评分")
|
||||
private Integer scoreYq;
|
||||
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.recent.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
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 = "管理后台 - 朋友圈分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class RecentPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "主图")
|
||||
private String coverPic;
|
||||
|
||||
@Schema(description = "描述")
|
||||
private String describe;
|
||||
|
||||
@Schema(description = "发布-经度")
|
||||
private BigDecimal issueLong;
|
||||
|
||||
@Schema(description = "发布-纬度")
|
||||
private BigDecimal issueLat;
|
||||
|
||||
@Schema(description = "发布-省")
|
||||
private String issueProvince;
|
||||
|
||||
@Schema(description = "发布-市")
|
||||
private String issueCity;
|
||||
|
||||
@Schema(description = "发布-区")
|
||||
private String issueDistrict;
|
||||
|
||||
@Schema(description = "发布-详细地址")
|
||||
private String issueAddress;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.recent.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 朋友圈 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class RecentRespVO {
|
||||
|
||||
@Schema(description = "收件地址编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "31860")
|
||||
@ExcelProperty("收件地址编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "32692")
|
||||
@ExcelProperty("用户编号")
|
||||
private Long memberId;
|
||||
|
||||
@Schema(description = "主图", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("主图")
|
||||
private String coverPic;
|
||||
|
||||
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("描述")
|
||||
private String describe;
|
||||
|
||||
@Schema(description = "发布-经度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("发布-经度")
|
||||
private BigDecimal issueLong;
|
||||
|
||||
@Schema(description = "发布-纬度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("发布-纬度")
|
||||
private BigDecimal issueLat;
|
||||
|
||||
@Schema(description = "发布-省")
|
||||
@ExcelProperty("发布-省")
|
||||
private String issueProvince;
|
||||
|
||||
@Schema(description = "发布-市")
|
||||
@ExcelProperty("发布-市")
|
||||
private String issueCity;
|
||||
|
||||
@Schema(description = "发布-区")
|
||||
@ExcelProperty("发布-区")
|
||||
private String issueDistrict;
|
||||
|
||||
@Schema(description = "发布-详细地址")
|
||||
@ExcelProperty("发布-详细地址")
|
||||
private String issueAddress;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.recent.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 朋友圈新增/修改 Request VO")
|
||||
@Data
|
||||
public class RecentSaveReqVO {
|
||||
|
||||
@Schema(description = "收件地址编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "31860")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "32692")
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Long memberId;
|
||||
|
||||
@Schema(description = "主图", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "主图不能为空")
|
||||
private String coverPic;
|
||||
|
||||
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "描述不能为空")
|
||||
private String describe;
|
||||
|
||||
@Schema(description = "发布-经度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "发布-经度不能为空")
|
||||
private BigDecimal issueLong;
|
||||
|
||||
@Schema(description = "发布-纬度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "发布-纬度不能为空")
|
||||
private BigDecimal issueLat;
|
||||
|
||||
@Schema(description = "发布-省")
|
||||
private String issueProvince;
|
||||
|
||||
@Schema(description = "发布-市")
|
||||
private String issueCity;
|
||||
|
||||
@Schema(description = "发布-区")
|
||||
private String issueDistrict;
|
||||
|
||||
@Schema(description = "发布-详细地址")
|
||||
private String issueAddress;
|
||||
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package cn.iocoder.yudao.module.member.dal.dataobject.recent;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 朋友圈操作 DO
|
||||
*
|
||||
* @author 聊天交友
|
||||
*/
|
||||
@TableName("member_operation")
|
||||
@KeySequence("member_operation_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OperationDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 收件地址编号
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private Long memberId;
|
||||
|
||||
/**
|
||||
* 朋友圈编号
|
||||
*/
|
||||
private Long memberRecentId;
|
||||
|
||||
/**
|
||||
* 点赞、屏蔽、举报
|
||||
*/
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 点击时间
|
||||
*/
|
||||
private LocalDateTime tapTime;
|
||||
|
||||
/**
|
||||
* 取消时间
|
||||
*/
|
||||
private LocalDateTime cancelTime;
|
||||
|
||||
/**
|
||||
* 举报类型
|
||||
*/
|
||||
private String reportType;
|
||||
|
||||
/**
|
||||
* 身材评分
|
||||
*/
|
||||
private Integer scoreSc;
|
||||
|
||||
/**
|
||||
* 耐心评分
|
||||
*/
|
||||
private Integer scoreNx;
|
||||
|
||||
/**
|
||||
* 爽快评分
|
||||
*/
|
||||
private Integer scoreSk;
|
||||
|
||||
/**
|
||||
* 有趣评分
|
||||
*/
|
||||
private Integer scoreYq;
|
||||
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
package cn.iocoder.yudao.module.member.dal.dataobject.recent;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 朋友圈 DO
|
||||
*
|
||||
* @author 聊天交友
|
||||
*/
|
||||
@TableName("member_recent")
|
||||
@KeySequence("member_recent_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RecentDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 收件地址编号
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private Long memberId;
|
||||
|
||||
/**
|
||||
* 主图
|
||||
*/
|
||||
private String coverPic;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String describe;
|
||||
|
||||
/**
|
||||
* 发布-经度
|
||||
*/
|
||||
private BigDecimal issueLong;
|
||||
|
||||
/**
|
||||
* 发布-纬度
|
||||
*/
|
||||
private BigDecimal issueLat;
|
||||
|
||||
/**
|
||||
* 发布-省
|
||||
*/
|
||||
private String issueProvince;
|
||||
|
||||
/**
|
||||
* 发布-市
|
||||
*/
|
||||
private String issueCity;
|
||||
|
||||
/**
|
||||
* 发布-区
|
||||
*/
|
||||
private String issueDistrict;
|
||||
|
||||
/**
|
||||
* 发布-详细地址
|
||||
*/
|
||||
private String issueAddress;
|
||||
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.member.dal.mysql.recent;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.recent.vo.OperationPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.recent.OperationDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 朋友圈操作 Mapper
|
||||
*
|
||||
* @author 聊天交友
|
||||
*/
|
||||
@Mapper
|
||||
public interface OperationMapper extends BaseMapperX<OperationDO> {
|
||||
|
||||
default PageResult<OperationDO> selectPage(OperationPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<OperationDO>()
|
||||
.eqIfPresent(OperationDO::getMemberId, reqVO.getMemberId())
|
||||
.eqIfPresent(OperationDO::getMemberRecentId, reqVO.getMemberRecentId())
|
||||
.eqIfPresent(OperationDO::getBizType, reqVO.getBizType())
|
||||
.betweenIfPresent(OperationDO::getTapTime, reqVO.getTapTime())
|
||||
.betweenIfPresent(OperationDO::getCancelTime, reqVO.getCancelTime())
|
||||
.eqIfPresent(OperationDO::getReportType, reqVO.getReportType())
|
||||
.eqIfPresent(OperationDO::getScoreSc, reqVO.getScoreSc())
|
||||
.eqIfPresent(OperationDO::getScoreNx, reqVO.getScoreNx())
|
||||
.eqIfPresent(OperationDO::getScoreSk, reqVO.getScoreSk())
|
||||
.eqIfPresent(OperationDO::getScoreYq, reqVO.getScoreYq())
|
||||
.betweenIfPresent(OperationDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(OperationDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.member.dal.mysql.recent;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.recent.RecentDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.recent.vo.*;
|
||||
|
||||
/**
|
||||
* 朋友圈 Mapper
|
||||
*
|
||||
* @author 聊天交友
|
||||
*/
|
||||
@Mapper
|
||||
public interface RecentMapper extends BaseMapperX<RecentDO> {
|
||||
|
||||
default PageResult<RecentDO> selectPage(RecentPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<RecentDO>()
|
||||
.eqIfPresent(RecentDO::getCoverPic, reqVO.getCoverPic())
|
||||
.eqIfPresent(RecentDO::getDescribe, reqVO.getDescribe())
|
||||
.eqIfPresent(RecentDO::getIssueLong, reqVO.getIssueLong())
|
||||
.eqIfPresent(RecentDO::getIssueLat, reqVO.getIssueLat())
|
||||
.eqIfPresent(RecentDO::getIssueProvince, reqVO.getIssueProvince())
|
||||
.eqIfPresent(RecentDO::getIssueCity, reqVO.getIssueCity())
|
||||
.eqIfPresent(RecentDO::getIssueDistrict, reqVO.getIssueDistrict())
|
||||
.eqIfPresent(RecentDO::getIssueAddress, reqVO.getIssueAddress())
|
||||
.betweenIfPresent(RecentDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(RecentDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -14,7 +14,7 @@ import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.ADDRESS_NOT_EXISTS;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.ADDRESS_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 用户收件地址 Service 实现类
|
||||
|
||||
+1
@@ -38,6 +38,7 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU
|
||||
import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP;
|
||||
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getTerminal;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.*;
|
||||
|
||||
/**
|
||||
* 会员的认证 Service 接口
|
||||
|
||||
+2
-2
@@ -18,8 +18,8 @@ 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.member.enums.ErrorCodeConstants.GROUP_HAS_USER;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.GROUP_NOT_EXISTS;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.GROUP_HAS_USER;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.GROUP_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 用户分组 Service 实现类
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.*;
|
||||
|
||||
/**
|
||||
* 会员等级 Service 实现类
|
||||
|
||||
+2
-3
@@ -23,7 +23,7 @@ import java.util.Set;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.USER_POINT_NOT_ENOUGH;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.USER_POINT_NOT_ENOUGH;
|
||||
|
||||
|
||||
/**
|
||||
@@ -74,8 +74,7 @@ public class MemberPointRecordServiceImpl implements MemberPointRecordService {
|
||||
Integer userPoint = ObjectUtil.defaultIfNull(user.getPoint(), 0);
|
||||
int totalPoint = userPoint + point; // 用户变动后的积分
|
||||
if (totalPoint < 0) {
|
||||
log.error("[createPointRecord][userId({}) point({}) bizType({}) bizId({}) {}]", userId, point, bizType, bizId,
|
||||
USER_POINT_NOT_ENOUGH);
|
||||
log.error("[createPointRecord][userId({}) point({}) bizType({}) bizId({}) {}]", userId, point, bizType, bizId, USER_POINT_NOT_ENOUGH);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package cn.iocoder.yudao.module.member.service.recent;
|
||||
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.recent.vo.OperationPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.recent.vo.OperationSaveReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.recent.OperationDO;
|
||||
|
||||
/**
|
||||
* 朋友圈操作 Service 接口
|
||||
*
|
||||
* @author 聊天交友
|
||||
*/
|
||||
public interface OperationService {
|
||||
|
||||
/**
|
||||
* 创建朋友圈操作
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createOperation(@Valid OperationSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新朋友圈操作
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateOperation(@Valid OperationSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除朋友圈操作
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteOperation(Long id);
|
||||
|
||||
/**
|
||||
* 获得朋友圈操作
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 朋友圈操作
|
||||
*/
|
||||
OperationDO getOperation(Long id);
|
||||
|
||||
/**
|
||||
* 获得朋友圈操作分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 朋友圈操作分页
|
||||
*/
|
||||
PageResult<OperationDO> getOperationPage(OperationPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
package cn.iocoder.yudao.module.member.service.recent;
|
||||
|
||||
import cn.iocoder.yudao.module.member.controller.admin.recent.vo.OperationPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.recent.vo.OperationSaveReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.recent.OperationDO;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.recent.OperationMapper;
|
||||
import cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 朋友圈操作 Service 实现类
|
||||
*
|
||||
* @author 聊天交友
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class OperationServiceImpl implements OperationService {
|
||||
|
||||
@Resource
|
||||
private OperationMapper operationMapper;
|
||||
|
||||
@Override
|
||||
public Long createOperation(OperationSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
OperationDO operation = BeanUtils.toBean(createReqVO, OperationDO.class);
|
||||
operationMapper.insert(operation);
|
||||
// 返回
|
||||
return operation.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOperation(OperationSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateOperationExists(updateReqVO.getId());
|
||||
// 更新
|
||||
OperationDO updateObj = BeanUtils.toBean(updateReqVO, OperationDO.class);
|
||||
operationMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteOperation(Long id) {
|
||||
// 校验存在
|
||||
validateOperationExists(id);
|
||||
// 删除
|
||||
operationMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateOperationExists(Long id) {
|
||||
if (operationMapper.selectById(id) == null) {
|
||||
throw exception(MemberRecentErrorCode.OPERATION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationDO getOperation(Long id) {
|
||||
return operationMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<OperationDO> getOperationPage(OperationPageReqVO pageReqVO) {
|
||||
return operationMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.member.service.recent;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.recent.vo.*;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.recent.RecentDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 朋友圈 Service 接口
|
||||
*
|
||||
* @author 聊天交友
|
||||
*/
|
||||
public interface RecentService {
|
||||
|
||||
/**
|
||||
* 创建朋友圈
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createRecent(@Valid RecentSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新朋友圈
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateRecent(@Valid RecentSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除朋友圈
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteRecent(Long id);
|
||||
|
||||
/**
|
||||
* 获得朋友圈
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 朋友圈
|
||||
*/
|
||||
RecentDO getRecent(Long id);
|
||||
|
||||
/**
|
||||
* 获得朋友圈分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 朋友圈分页
|
||||
*/
|
||||
PageResult<RecentDO> getRecentPage(RecentPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
package cn.iocoder.yudao.module.member.service.recent;
|
||||
|
||||
import cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.recent.vo.*;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.recent.RecentDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.recent.RecentMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 朋友圈 Service 实现类
|
||||
*
|
||||
* @author 聊天交友
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class RecentServiceImpl implements RecentService {
|
||||
|
||||
@Resource
|
||||
private RecentMapper recentMapper;
|
||||
|
||||
@Override
|
||||
public Long createRecent(RecentSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
RecentDO recent = BeanUtils.toBean(createReqVO, RecentDO.class);
|
||||
recentMapper.insert(recent);
|
||||
// 返回
|
||||
return recent.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRecent(RecentSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateRecentExists(updateReqVO.getId());
|
||||
// 更新
|
||||
RecentDO updateObj = BeanUtils.toBean(updateReqVO, RecentDO.class);
|
||||
recentMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecent(Long id) {
|
||||
// 校验存在
|
||||
validateRecentExists(id);
|
||||
// 删除
|
||||
recentMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateRecentExists(Long id) {
|
||||
if (recentMapper.selectById(id) == null) {
|
||||
throw exception(MemberRecentErrorCode.RECENT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecentDO getRecent(Long id) {
|
||||
return recentMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<RecentDO> getRecentPage(RecentPageReqVO pageReqVO) {
|
||||
return recentMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -13,8 +13,8 @@ import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.SIGN_IN_CONFIG_EXISTS;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.SIGN_IN_CONFIG_NOT_EXISTS;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.SIGN_IN_CONFIG_EXISTS;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.SIGN_IN_CONFIG_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 签到规则 Service 实现类
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import java.util.Set;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.SIGN_IN_RECORD_TODAY_EXISTS;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.SIGN_IN_RECORD_TODAY_EXISTS;
|
||||
|
||||
/**
|
||||
* 签到记录 Service 实现类
|
||||
|
||||
+1
@@ -20,6 +20,7 @@ import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.*;
|
||||
|
||||
/**
|
||||
* 会员标签 Service 实现类
|
||||
|
||||
+1
@@ -38,6 +38,7 @@ import java.util.List;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.*;
|
||||
|
||||
/**
|
||||
* 会员 User Service 实现类
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEq
|
||||
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException;
|
||||
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId;
|
||||
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.ADDRESS_NOT_EXISTS;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.ADDRESS_NOT_EXISTS;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
|
||||
|
||||
+3
-2
@@ -21,13 +21,14 @@ import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgn
|
||||
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals;
|
||||
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException;
|
||||
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.GROUP_HAS_USER;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.GROUP_NOT_EXISTS;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.GROUP_HAS_USER;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.GROUP_NOT_EXISTS;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
// TODO 芋艿:完全 review 完,在去 review 单测
|
||||
|
||||
/**
|
||||
* {@link MemberGroupServiceImpl} 的单元测试类
|
||||
*
|
||||
|
||||
+1
@@ -23,6 +23,7 @@ import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEq
|
||||
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException;
|
||||
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.*;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
// TODO 芋艿:完全 review 完,在去 review 单测
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEq
|
||||
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException;
|
||||
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId;
|
||||
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.TAG_NOT_EXISTS;
|
||||
import static cn.iocoder.yudao.module.member.enums.MemberRecentErrorCode.TAG_NOT_EXISTS;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
// TODO 芋艿:完全 review 完,在去 review 单测
|
||||
|
||||
@@ -3,8 +3,8 @@ spring:
|
||||
name: yudao-server
|
||||
|
||||
profiles:
|
||||
active: prod
|
||||
# active: local
|
||||
# active: prod
|
||||
active: local
|
||||
|
||||
main:
|
||||
allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
|
||||
|
||||
Reference in new issue
Block a user