Commit 2c7799e2 authored by shiyu's avatar shiyu

签到分享3

parent bc3ef257
......@@ -29,6 +29,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
......@@ -330,10 +331,12 @@ public class UserSigninServiceImpl implements UserSigninService {
map.put("userName", user.getNickname());
map.put("avatar", user.getAvatar());
LocalDate today = LocalDate.now();
map.put("year", today.getYear() + "年");
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM月dd日");
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd");
String formattedDate = today.format(formatter);
map.put("date", formattedDate);
DayOfWeek dayOfWeek = today.getDayOfWeek();
String weekDay = dayOfWeek.getDisplayName(java.time.format.TextStyle.FULL, java.util.Locale.CHINESE);
map.put("weekDay", weekDay);
return Result.success(map);
} catch (Exception e) {
logger.error("获取分享信息失败 error : {}", e);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment