无关风月
2024-11-15 353cf91d3679e68d9b8c07652e4f7791d606dbd4
xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/controller/client/ClientAppUserTreeController.java
@@ -32,6 +32,7 @@
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.temporal.ChronoUnit;
@@ -424,6 +425,10 @@
        Long userId = loginUser.getUserid();
        // 给用户加10能量
        AppUser byId = appUserService.getById(userId);
        if (byId.getSignTime()!=null
                && byId.getSignTime().toLocalDate().equals(LocalDate.now())){
        return R.fail("您今日已签到");
        }
        byId.setEnergyValue(byId.getEnergyValue()+10);
        byId.setSignTime(LocalDateTime.now());
        byId.setTotalEnergyValue(byId.getTotalEnergyValue()+10);