spark-server/internal/module/meta/logic/enums_friend.go
DESKTOP-L8OUL9F\gfl0034 ce9c7a13aa feat: 互相关注后自动成为好友
一方关注只记关注。双方互关时写入已有双向好友边;取消关注若不再互关只删好友边,不删消息。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-18 21:51:18 +08:00

43 lines
1.6 KiB
Go

package logic
import (
friendentity "spark-server/internal/module/friend/entity"
"spark-server/internal/module/meta/entity"
"spark-server/internal/pkg/i18n"
)
func relationKind(lang i18n.Lang) []entity.Item {
return []entity.Item{
item(lang, "relation_kind", "none", int(friendentity.RelationNone)),
item(lang, "relation_kind", "friend", int(friendentity.RelationFriend)),
item(lang, "relation_kind", "block", int(friendentity.RelationBlock)),
}
}
func friendRequestStatus(lang i18n.Lang) []entity.Item {
return []entity.Item{
item(lang, "friend_request_status", "pending", int(friendentity.RequestPending)),
item(lang, "friend_request_status", "accepted", int(friendentity.RequestAccepted)),
item(lang, "friend_request_status", "rejected", int(friendentity.RequestRejected)),
}
}
func friendSource(lang i18n.Lang) []entity.Item {
return []entity.Item{
item(lang, "friend_source", "unknown", int(friendentity.SourceUnknown)),
item(lang, "friend_source", "qrcode", int(friendentity.SourceQRCode)),
item(lang, "friend_source", "email", int(friendentity.SourceEmail)),
item(lang, "friend_source", "spark_id", int(friendentity.SourceSparkID)),
item(lang, "friend_source", "follow", int(friendentity.SourceFollow)),
}
}
func reportReason(lang i18n.Lang) []entity.Item {
return []entity.Item{
item(lang, "report_reason", "spam", int(friendentity.ReportSpam)),
item(lang, "report_reason", "harassment", int(friendentity.ReportHarassment)),
item(lang, "report_reason", "fake", int(friendentity.ReportFake)),
item(lang, "report_reason", "other", int(friendentity.ReportOther)),
}
}