Files
YumeMichi d48293be44 Implement friend APIs and target profile support
- Add friend search/list/request/requestCancel/response/expel handlers and schemas
- Store friend relationships in user_friend and backfill default friend links at startup
- Auto-add the default user as a friend for newly created accounts
- Support target user_id in /api profile requests and return target profile data
- Make profile accessory_info optional to avoid zero-value accessory payloads
- Update login topInfo friend counters from friend relationship state

Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-05 01:54:59 +08:00

26 lines
601 B
Go

package startup
import (
"honoka-chan/internal/handler/ghome/account"
usermodel "honoka-chan/internal/model/user"
"log"
)
const (
defaultPassword = "klsbgames"
)
func CreateDefaultUser() {
_, code, msg, created, err := account.AddUser(usermodel.DefaultSystemPhone, defaultPassword, true)
if err != nil {
log.Fatalln("默认用户创建失败:", err.Error())
}
if code != 0 {
log.Fatalf("默认用户创建失败: code=%d msg=%s", code, msg)
}
if created {
log.Printf("默认用户创建成功, 账号: %s, 密码: %s\n", usermodel.DefaultSystemPhone, defaultPassword)
return
}
}