webui: Add user birthday settings
- Store birth month and day in user_pref with default 10/18 - Migrate existing user_pref rows to fill missing birthday fields - Expose birthday editing in the webui profile page - Replace hardcoded birthday values in user info, top info, and product list responses - Fix birthday month/day field alignment in the profile form Signed-off-by: Sean Du <do4suki@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@ package user
|
||||
|
||||
import (
|
||||
userapischema "honoka-chan/internal/schema/api/user"
|
||||
userschema "honoka-chan/internal/schema/user"
|
||||
"honoka-chan/internal/session"
|
||||
"time"
|
||||
|
||||
@@ -12,7 +13,13 @@ func userInfo(ctx *gin.Context) (res any, err error) {
|
||||
ss := session.Get(ctx)
|
||||
|
||||
res = userapischema.InfoResp{
|
||||
Result: ss.GetUserInfo(),
|
||||
Result: userschema.UserInfoData{
|
||||
User: ss.GetUserInfo(),
|
||||
Birth: userschema.Birth{
|
||||
BirthMonth: ss.UserPref.EffectiveBirthMonth(),
|
||||
BirthDay: ss.UserPref.EffectiveBirthDay(),
|
||||
},
|
||||
},
|
||||
Status: 200,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
|
||||
Reference in New Issue
Block a user