|
@@ -1,12 +1,28 @@
|
|
|
package com.chelvc.cloud.maintain.controller;
|
|
|
|
|
|
+import com.chelvc.cloud.maintain.copier.ScoreCopier;
|
|
|
+import com.chelvc.cloud.maintain.vo.ScoreVO;
|
|
|
+import com.chelvc.cloud.maintain.vo.SignIndexVO;
|
|
|
+import com.chelvc.cloud.uc.api.constant.ScoreOrigin;
|
|
|
+import com.chelvc.cloud.uc.api.dto.ScoreDTO;
|
|
|
+import com.chelvc.cloud.uc.api.dto.SignDTO;
|
|
|
+import com.chelvc.cloud.uc.api.param.ScorePagingParam;
|
|
|
+import com.chelvc.cloud.uc.api.service.ScoreService;
|
|
|
import com.chelvc.cloud.uc.api.service.SignService;
|
|
|
import com.chelvc.framework.base.annotation.UnifiedResponseBody;
|
|
|
+import com.chelvc.framework.base.model.Pagination;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
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.RestController;
|
|
|
|
|
|
+import javax.validation.Valid;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
/**
|
|
|
* 签到接口
|
|
|
*
|
|
@@ -19,6 +35,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
public class SignController {
|
|
|
@DubboReference
|
|
|
private SignService signService;
|
|
|
+ @DubboReference
|
|
|
+ private ScoreService scoreService;
|
|
|
|
|
|
/**
|
|
|
* 用户签到
|
|
@@ -27,4 +45,22 @@ public class SignController {
|
|
|
public void sign() {
|
|
|
this.signService.sign();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 每日签到页面信息
|
|
|
+ *
|
|
|
+ * @return 每日签到页面信息
|
|
|
+ */
|
|
|
+ @GetMapping("/sign/index")
|
|
|
+ public SignIndexVO getCustomerSign() {
|
|
|
+ SignIndexVO sign = SignIndexVO.builder().build();
|
|
|
+ SignDTO todaySign = this.signService.getTodaySign();
|
|
|
+ if (ObjectUtils.isEmpty(todaySign) || todaySign.getSignDay() == null) {
|
|
|
+ sign.setSignDay(0);
|
|
|
+ } else {
|
|
|
+ sign.setSignDay(todaySign.getSignDay());
|
|
|
+ }
|
|
|
+ sign.setSignScore(this.scoreService.countScoreValue(ScoreOrigin.SIGN.name()));
|
|
|
+ return sign;
|
|
|
+ }
|
|
|
}
|