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>
This commit is contained in:
2026-06-05 01:54:59 +08:00
parent ec2c5a6dac
commit d48293be44
28 changed files with 1653 additions and 159 deletions
+2 -2
View File
@@ -6,14 +6,14 @@ import (
"github.com/gin-gonic/gin"
)
func ProfileApi(ctx *gin.Context, action string) (res any, err error) {
func ProfileApi(ctx *gin.Context, action string, targetUserID int) (res any, err error) {
switch action {
case "cardRanking":
res, err = cardRanking()
case "liveCnt":
res, err = liveCnt()
case "profileInfo":
res, err = profileInfo(ctx)
res, err = profileInfo(ctx, targetUserID)
default:
err = fmt.Errorf("unimplemented action: profile: %s", action)
}