- 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>
45 lines
1.0 KiB
Go
45 lines
1.0 KiB
Go
package login
|
|
|
|
import (
|
|
loginapischema "honoka-chan/internal/schema/api/login"
|
|
"honoka-chan/internal/session"
|
|
"time"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func loginTopInfoOnce(ctx *gin.Context) (res any, err error) {
|
|
ss := session.Get(ctx)
|
|
|
|
res = loginapischema.TopInfoOnceResp{
|
|
Result: loginapischema.TopInfoOnceData{
|
|
NewAchievementCnt: 0,
|
|
UnaccomplishedAchievementCnt: 0,
|
|
LiveDailyRewardExist: false,
|
|
TrainingEnergy: 10,
|
|
TrainingEnergyMax: 10,
|
|
Notification: loginapischema.Notification{
|
|
Push: false,
|
|
Lp: false,
|
|
UpdateInfo: false,
|
|
Campaign: false,
|
|
Live: false,
|
|
Lbonus: false,
|
|
Event: false,
|
|
Secretbox: false,
|
|
Birthday: ss.UserPref.HasBirthDate(),
|
|
},
|
|
OpenArena: true,
|
|
CostumeStatus: true,
|
|
OpenAccessory: true,
|
|
ArenaSiSkillUniqueCheck: true,
|
|
OpenV98: true,
|
|
},
|
|
Status: 200,
|
|
CommandNum: false,
|
|
TimeStamp: time.Now().Unix(),
|
|
}
|
|
|
|
return res, err
|
|
}
|