From 1bb2010dc0ed73b1bf8fc8d936a11ee72222927e Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sat, 21 Oct 2023 01:11:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=BE=E5=88=B0=E8=AE=B0=E5=BD=95=EF=BC=9A?= =?UTF-8?q?=E5=AE=8C=E5=96=84=20review=20=E6=8F=90=E5=88=B0=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/signin/AppMemberSignInController.java | 33 ------------------- .../AppMemberSignInRecordController.java | 13 +------- .../vo/AppMemberSignInRecordRespVO.java | 24 -------------- .../vo/AppMemberSignInSummaryRespVO.java | 21 ------------ .../signin/MemberSignInRecordService.java | 6 ++-- .../signin/MemberSignInRecordServiceImpl.java | 6 ++-- 6 files changed, 7 insertions(+), 96 deletions(-) delete mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/signin/AppMemberSignInController.java delete mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/signin/vo/AppMemberSignInRecordRespVO.java delete mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/signin/vo/AppMemberSignInSummaryRespVO.java diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/signin/AppMemberSignInController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/signin/AppMemberSignInController.java deleted file mode 100644 index ec5e0a4a80..0000000000 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/signin/AppMemberSignInController.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.iocoder.yudao.module.member.controller.app.signin; - -import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.module.member.service.signin.MemberSignInRecordService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; - -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; - -// TODO @xiaqing:sign-in -@Tag(name = "签到APP - 签到") -@RestController -@RequestMapping("/member/signin") -public class AppMemberSignInController { - - @Resource - private MemberSignInRecordService signInRecordService; - - // TODO @xiaqing:泛型: - // TODO @xiaqing:合并到 AppMemberSignInRecordController 的 getSignInRecordSummary 里哈。 - @Operation(summary = "个人签到信息") - @GetMapping("/get-summary") - public CommonResult getUserSummary() { - return success(signInRecordService.getSignInRecordSummary(getLoginUserId())); - } - -} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/signin/AppMemberSignInRecordController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/signin/AppMemberSignInRecordController.java index fa07d85ec3..2f7afa0429 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/signin/AppMemberSignInRecordController.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/signin/AppMemberSignInRecordController.java @@ -31,22 +31,11 @@ public class AppMemberSignInRecordController { @Resource private MemberSignInRecordService signInRecordService; - // TODO 芋艿:临时 mock => UserSignController.getUserInfo @GetMapping("/get-summary") @Operation(summary = "获得个人签到统计") @PreAuthenticated public CommonResult getSignInRecordSummary() { - AppMemberSignInRecordSummaryRespVO respVO = new AppMemberSignInRecordSummaryRespVO(); - if (false) { - respVO.setTotalDay(100); - respVO.setContinuousDay(5); - respVO.setTodaySignIn(true); - } else { - respVO.setTotalDay(100); - respVO.setContinuousDay(10); - respVO.setTodaySignIn(false); - } - return success(respVO); + return success(signInRecordService.getSignInRecordSummary(getLoginUserId())); } @PostMapping("/create") diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/signin/vo/AppMemberSignInRecordRespVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/signin/vo/AppMemberSignInRecordRespVO.java deleted file mode 100644 index c31e365ec1..0000000000 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/signin/vo/AppMemberSignInRecordRespVO.java +++ /dev/null @@ -1,24 +0,0 @@ -package cn.iocoder.yudao.module.member.controller.app.signin.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.time.LocalDateTime; - -@Schema(description = "用户签到积分 Response VO") -@Data -public class AppMemberSignInRecordRespVO { - - @Schema(description = "第几天签到", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - private Integer day; - - @Schema(description = "签到的积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") - private Integer point; - - @Schema(description = "签到的经验", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") - private Integer experience; - - @Schema(description = "签到时间", requiredMode = Schema.RequiredMode.REQUIRED) - private LocalDateTime createTime; - -} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/signin/vo/AppMemberSignInSummaryRespVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/signin/vo/AppMemberSignInSummaryRespVO.java deleted file mode 100644 index 55eaddbdd1..0000000000 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/signin/vo/AppMemberSignInSummaryRespVO.java +++ /dev/null @@ -1,21 +0,0 @@ -package cn.iocoder.yudao.module.member.controller.app.signin.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.time.LocalDateTime; - -@Schema(description = "用户签到统计信息 Response VO") -@Data -public class AppMemberSignInSummaryRespVO { - - @Schema(description = "持续签到天数", requiredMode = Schema.RequiredMode.REQUIRED, example = "5") - private Integer continuousDay; - - @Schema(description = "总签到天数", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") - private Integer totalDay; - - @Schema(description = "当天是否签到", requiredMode = Schema.RequiredMode.REQUIRED,example = "true") - private Boolean todaySignIn ; - -} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordService.java index 4f1c365e03..b22ceed1a6 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordService.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordService.java @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.member.service.signin; import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.member.controller.admin.signin.vo.record.MemberSignInRecordPageReqVO; -import cn.iocoder.yudao.module.member.controller.app.signin.vo.AppMemberSignInSummaryRespVO; +import cn.iocoder.yudao.module.member.controller.app.signin.vo.record.AppMemberSignInRecordSummaryRespVO; import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO; /** @@ -24,7 +24,7 @@ public interface MemberSignInRecordService { /** * 【会员】获得签到记录分页 * - * @param userId 用户编号 + * @param userId 用户编号 * @param pageParam 分页查询 * @return 签到记录分页 */ @@ -44,7 +44,7 @@ public interface MemberSignInRecordService { * @param userId 用户编号 * @return 个人签到统计信息 */ - AppMemberSignInSummaryRespVO getSignInRecordSummary(Long userId); + AppMemberSignInRecordSummaryRespVO getSignInRecordSummary(Long userId); } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java index 7656780c23..586e60ac44 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java @@ -10,7 +10,7 @@ import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.module.member.api.user.MemberUserApi; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.member.controller.admin.signin.vo.record.MemberSignInRecordPageReqVO; -import cn.iocoder.yudao.module.member.controller.app.signin.vo.AppMemberSignInSummaryRespVO; +import cn.iocoder.yudao.module.member.controller.app.signin.vo.record.AppMemberSignInRecordSummaryRespVO; import cn.iocoder.yudao.module.member.convert.signin.MemberSignInRecordConvert; import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO; import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO; @@ -56,9 +56,9 @@ public class MemberSignInRecordServiceImpl implements MemberSignInRecordService private MemberUserApi memberUserApi; @Override - public AppMemberSignInSummaryRespVO getSignInRecordSummary(Long userId) { + public AppMemberSignInRecordSummaryRespVO getSignInRecordSummary(Long userId) { // 1. 初始化默认返回信息 - AppMemberSignInSummaryRespVO vo = new AppMemberSignInSummaryRespVO(); + AppMemberSignInRecordSummaryRespVO vo = new AppMemberSignInRecordSummaryRespVO(); vo.setTotalDay(0); vo.setContinuousDay(0); vo.setTodaySignIn(false);