parent
db1f44305d
commit
9d262e8e7f
@ -0,0 +1,55 @@
|
|||||||
|
package cn.iocoder.yudao.module.member.controller.app.signin;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
|
import cn.iocoder.yudao.module.member.convert.signin.MemberSignInRecordConvert;
|
||||||
|
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO;
|
||||||
|
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.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述 :用户签到相关信息接口
|
||||||
|
* Author :xiaqing
|
||||||
|
* Date :2023-09-15 09:02
|
||||||
|
*/
|
||||||
|
@Tag(name = "签到APP - 签到")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/member/signin")
|
||||||
|
public class AppMemberSignInController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
MemberSignInRecordService signInRecordService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述 :获取个人签到信息
|
||||||
|
* Author :xiaqing
|
||||||
|
* Date :2023-09-15 12:56:47
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Operation(summary = "个人签到信息")
|
||||||
|
@GetMapping("/get-summary")
|
||||||
|
public CommonResult getUserSummary(){
|
||||||
|
return CommonResult.success(signInRecordService.getUserSummary(SecurityFrameworkUtils.getLoginUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述 :用户签到
|
||||||
|
* Author :xiaqing
|
||||||
|
* Date :2023-09-15 09:20:58
|
||||||
|
*/
|
||||||
|
@Operation(summary = "会员签到")
|
||||||
|
@PostMapping("/create")
|
||||||
|
public CommonResult create(){
|
||||||
|
MemberSignInRecordDO recordDO = signInRecordService.create(SecurityFrameworkUtils.getLoginUserId());
|
||||||
|
return CommonResult.success(MemberSignInRecordConvert.INSTANCE.coverRecordToAppRecordVo(recordDO));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
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)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
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 ;
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue