| | |
| | | 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; |
| | |
| | | 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); |