|
@@ -0,0 +1,57 @@
|
|
|
+package com.citu.module.menduner.reward.controller.app.sigin;
|
|
|
+
|
|
|
+import com.citu.framework.common.pojo.CommonResult;
|
|
|
+import com.citu.framework.common.pojo.PageParam;
|
|
|
+import com.citu.framework.common.pojo.PageResult;
|
|
|
+import com.citu.framework.security.core.annotations.PreAuthenticated;
|
|
|
+import com.citu.module.menduner.reward.controller.app.sigin.record.AppSignInRecordRespVO;
|
|
|
+import com.citu.module.menduner.reward.controller.app.sigin.record.AppSignInRecordSummaryRespVO;
|
|
|
+import com.citu.module.menduner.reward.convert.SignInRecordConvert;
|
|
|
+import com.citu.module.menduner.reward.dal.dataobject.signin.SignInRecordDO;
|
|
|
+import com.citu.module.menduner.reward.service.signin.SignInRecordService;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+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;
|
|
|
+
|
|
|
+import static com.citu.framework.common.pojo.CommonResult.success;
|
|
|
+import static com.citu.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
|
|
+
|
|
|
+@Tag(name = "求职者 - 签到记录")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/menduner/reward/sign-in/record")
|
|
|
+@Validated
|
|
|
+public class AppSignInRecordController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private SignInRecordService signInRecordService;
|
|
|
+
|
|
|
+ @GetMapping("/get-summary")
|
|
|
+ @Operation(summary = "获得个人签到统计")
|
|
|
+ @PreAuthenticated
|
|
|
+ public CommonResult<AppSignInRecordSummaryRespVO> getSignInRecordSummary() {
|
|
|
+ return success(signInRecordService.getSignInRecordSummary(getLoginUserId()));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/create")
|
|
|
+ @Operation(summary = "签到")
|
|
|
+ @PreAuthenticated
|
|
|
+ public CommonResult<AppSignInRecordRespVO> createSignInRecord() {
|
|
|
+ SignInRecordDO recordDO = signInRecordService.createSignRecord(getLoginUserId());
|
|
|
+ return success(SignInRecordConvert.INSTANCE.coverRecordToAppRecordVo(recordDO));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/page")
|
|
|
+ @Operation(summary = "获得签到记录分页")
|
|
|
+ @PreAuthenticated
|
|
|
+ public CommonResult<PageResult<AppSignInRecordRespVO>> getSignRecordPage(PageParam pageParam) {
|
|
|
+ PageResult<SignInRecordDO> pageResult = signInRecordService.getSignRecordPage(getLoginUserId(), pageParam);
|
|
|
+ return success(SignInRecordConvert.INSTANCE.convertPage02(pageResult));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|