Documentation ¶
Index ¶
- Constants
- Variables
- func GetOwners(address string, tokenId int) []string
- type CourseDetail
- type EventInput
- type EventItem
- type EventMatchedItem
- type Follow
- type FollowRepository
- type FollowerList
- type FollowingList
- type HackathonManager
- func (hm *HackathonManager) AutoSendEnsoulSbt(ctx context.Context, toAddressStr string, tokenIdStr string) bool
- func (hm *HackathonManager) CheckFollowExists(ctx context.Context, fromUser primitive.ObjectID, toUser primitive.ObjectID) bool
- func (hm *HackathonManager) DeleteFollow(ctx context.Context, fromUser primitive.ObjectID, toUser primitive.ObjectID) bool
- func (hm *HackathonManager) GetFollower(ctx context.Context, userId primitive.ObjectID, ...) []FollowerList
- func (hm *HackathonManager) GetFollowing(ctx context.Context, userId primitive.ObjectID, ...) []FollowingList
- func (hm *HackathonManager) GetIdListByAddr(ctx context.Context, address string) []Id
- func (hm *HackathonManager) GetIdSbtDetail(ctx context.Context, address string) *IdSbtDetail
- func (hm *HackathonManager) GetNewIdList(ctx context.Context) []Id
- func (hm *HackathonManager) GetQ11e(ctx context.Context, userId primitive.ObjectID) *Q11e
- func (hm *HackathonManager) GetResumeByAddr(ctx context.Context, userId primitive.ObjectID, address string, ...) *Resume
- func (hm *HackathonManager) GetSbtDetail(ctx context.Context, address string, tokenId int) *SbtDetail
- func (hm *HackathonManager) Insert(ctx context.Context, userId primitive.ObjectID, address string, data string) primitive.ObjectID
- func (hm *HackathonManager) InsertFollow(ctx context.Context, fromUser primitive.ObjectID, toUser primitive.ObjectID) bool
- func (hm *HackathonManager) PutQ11e(ctx context.Context, input *Q11e) primitive.ObjectID
- func (hm *HackathonManager) RunRecommendations(ctx context.Context, userId primitive.ObjectID) *UserRecommendation
- func (hm *HackathonManager) SayHello(ctx context.Context) string
- func (hm *HackathonManager) ValidateDeSchoolId(ctx context.Context, address string, baseAddress string, lensHandle string, ...) bool
- type HackathonOptions
- type Id
- type IdRepository
- type IdSbtDetail
- type MbtiType
- type NMetadata
- type NftByWalletOutput
- type NftMetaData
- type NftMetaDataOutput
- type NftOwnerOutput
- type NftOwnerResult
- type PlatformType
- type Q11e
- type Q11eRepository
- type Resume
- type ResumeContent
- type ResumeRepository
- type SbtDetail
- type SbtInWallet
- type UserEventItem
- type UserItem
- type UserRecommendation
- type UserRecommendationRepository
Constants ¶
View Source
const ( BoothPlatform = 0 DeSchoolPlatform = 1 LensPlatform = 2 CyberConnectPlatform = 3 )
View Source
const TargetTypeLink3Event = "link3_event" // link3 event
Variables ¶
View Source
var MBTI_MATCHING_MAP = [16][16]int{
{8, 8, 8, 10, 8, 10, 8, 8, 2, 2, 2, 2, 2, 2, 2, 2},
{8, 8, 10, 8, 10, 8, 8, 8, 2, 2, 2, 2, 2, 2, 2, 2},
{8, 10, 8, 8, 8, 8, 8, 10, 2, 2, 2, 2, 2, 2, 2, 2},
{10, 8, 8, 8, 8, 8, 8, 8, 10, 2, 2, 2, 2, 2, 2, 2},
{8, 10, 8, 8, 8, 8, 8, 10, 6, 6, 6, 6, 4, 4, 4, 4},
{10, 8, 8, 8, 8, 8, 10, 8, 6, 6, 6, 6, 6, 6, 6, 6},
{8, 8, 8, 8, 8, 10, 8, 8, 6, 6, 6, 6, 4, 4, 4, 10},
{8, 8, 10, 8, 10, 8, 8, 8, 6, 6, 6, 6, 4, 4, 4, 4},
{2, 2, 2, 10, 6, 6, 6, 6, 4, 4, 4, 4, 6, 10, 6, 10},
{2, 2, 2, 2, 6, 6, 6, 6, 4, 4, 4, 4, 10, 6, 10, 6},
{2, 2, 2, 2, 6, 6, 6, 6, 4, 4, 4, 4, 6, 10, 6, 10},
{2, 2, 2, 2, 6, 6, 6, 6, 4, 4, 4, 4, 10, 6, 10, 6},
{2, 2, 2, 2, 4, 6, 4, 4, 6, 10, 6, 10, 8, 8, 8, 8},
{2, 2, 2, 2, 4, 6, 4, 4, 10, 6, 10, 6, 8, 8, 8, 8},
{2, 2, 2, 2, 4, 6, 4, 4, 6, 10, 6, 10, 8, 8, 8, 8},
{2, 2, 2, 2, 4, 6, 10, 4, 10, 6, 10, 6, 8, 8, 8, 8},
}
Functions ¶
Types ¶
type CourseDetail ¶
type CourseDetail struct { Id string `json:"id"` Title string `json:"title"` Description string `json:"description"` SeriesId string `json:"seriesId"` CoverImage string `json:"coverImage"` CreatorId string `json:"creatorId"` CreatedAt time.Time `json:"createdAt"` }
func RecommendCourses ¶
func RecommendCourses(ctx context.Context, labels []string) []*CourseDetail
type EventInput ¶
type EventMatchedItem ¶
type EventMatchedItem struct { Id string `json:"id"` IsEnabled bool `json:"isEnabled"` Interested []string `json:"interested"` Matched *UserEventItem `json:"matchedUsers"` Following *UserEventItem `json:"followingUsers"` Courses []*CourseDetail `json:"courses"` Registrants *UserEventItem `json:"registrants"` HasInterested bool `json:"hasInterested"` }
func MatchEvents ¶
func MatchEvents(ctx context.Context, input EventInput) []*EventMatchedItem
func NewItem ¶
func NewItem() *EventMatchedItem
func (*EventMatchedItem) IsMatched ¶
func (e *EventMatchedItem) IsMatched() bool
type FollowRepository ¶
type FollowRepository interface { ddd.Repository[Follow] CheckExistsByToAndFromAddr(ctx context.Context, fromUser primitive.ObjectID, toUser primitive.ObjectID) bool GetListByFilter(ctx context.Context, userId primitive.ObjectID, key string) []Follow DeleteByToAndFrom(ctx context.Context, fromUser primitive.ObjectID, toUser primitive.ObjectID) bool GetFollowingUsers(ctx context.Context, userId primitive.ObjectID) []primitive.ObjectID GetFollowingCount(ctx context.Context, userIds []primitive.ObjectID) map[primitive.ObjectID]int GetFollowerCount(ctx context.Context, userIds []primitive.ObjectID) map[primitive.ObjectID]int CheckIsFollowing(ctx context.Context, userId primitive.ObjectID, ids []primitive.ObjectID) map[primitive.ObjectID]bool }
type FollowerList ¶
type FollowingList ¶
type HackathonManager ¶
type HackathonManager struct {
// contains filtered or unexported fields
}
func NewHackathonManager ¶
func NewHackathonManager(c *di.Container) *HackathonManager
func (*HackathonManager) AutoSendEnsoulSbt ¶
func (hm *HackathonManager) AutoSendEnsoulSbt(ctx context.Context, toAddressStr string, tokenIdStr string) bool
自动发放一枚 Ensoul SBT
func (*HackathonManager) CheckFollowExists ¶
func (hm *HackathonManager) CheckFollowExists(ctx context.Context, fromUser primitive.ObjectID, toUser primitive.ObjectID) bool
查询双人关系
func (*HackathonManager) DeleteFollow ¶
func (hm *HackathonManager) DeleteFollow(ctx context.Context, fromUser primitive.ObjectID, toUser primitive.ObjectID) bool
删除
func (*HackathonManager) GetFollower ¶
func (hm *HackathonManager) GetFollower(ctx context.Context, userId primitive.ObjectID, vistorUserId primitive.ObjectID) []FollowerList
查询粉丝列表
func (*HackathonManager) GetFollowing ¶
func (hm *HackathonManager) GetFollowing(ctx context.Context, userId primitive.ObjectID, vistorUserId primitive.ObjectID) []FollowingList
查询偶像列表
func (*HackathonManager) GetIdListByAddr ¶
func (hm *HackathonManager) GetIdListByAddr(ctx context.Context, address string) []Id
获取所有链接过的身份列表
func (*HackathonManager) GetIdSbtDetail ¶
func (hm *HackathonManager) GetIdSbtDetail(ctx context.Context, address string) *IdSbtDetail
获取一个 ID 的 SBT 信息
func (*HackathonManager) GetNewIdList ¶
func (hm *HackathonManager) GetNewIdList(ctx context.Context) []Id
获取新用户
func (*HackathonManager) GetResumeByAddr ¶
func (hm *HackathonManager) GetResumeByAddr(ctx context.Context, userId primitive.ObjectID, address string, nonAutoGen bool) *Resume
查询用户简历
func (*HackathonManager) GetSbtDetail ¶
func (hm *HackathonManager) GetSbtDetail(ctx context.Context, address string, tokenId int) *SbtDetail
获取 SBT 的详情信息
func (*HackathonManager) Insert ¶
func (hm *HackathonManager) Insert(ctx context.Context, userId primitive.ObjectID, address string, data string) primitive.ObjectID
更新用户简历
func (*HackathonManager) InsertFollow ¶
func (hm *HackathonManager) InsertFollow(ctx context.Context, fromUser primitive.ObjectID, toUser primitive.ObjectID) bool
添加关系
func (*HackathonManager) RunRecommendations ¶
func (hm *HackathonManager) RunRecommendations(ctx context.Context, userId primitive.ObjectID) *UserRecommendation
func (*HackathonManager) SayHello ¶
func (hm *HackathonManager) SayHello(ctx context.Context) string
Ping 专用
func (*HackathonManager) ValidateDeSchoolId ¶
func (hm *HackathonManager) ValidateDeSchoolId(ctx context.Context, address string, baseAddress string, lensHandle string, platform int) bool
链接验证 DeSchool ID
type HackathonOptions ¶
type Id ¶
type Id struct { Platform PlatformType `bson:"platform" json:"platform"` Address string `bson:"address" json:"address"` BaseAddress string `bson:"baseAddress" json:"baseAddress"` LensHandle string `bson:"lensHandle" json:"lensHandle"` ddd.AuditEntityBase `bson:",inline"` }
type IdRepository ¶
type IdRepository interface { ddd.Repository[Id] GetListByAddress(ctx context.Context, address string) []Id CheckExistsByAddrBaseAddrAndPltfm(ctx context.Context, address string, baseAddr string, platform PlatformType) bool GetListByBaseAddr(ctx context.Context, baseAddr string) []Id GetTen(ctx context.Context) []Id CheckAddrs(ctx context.Context, addrs []string) []string }
type IdSbtDetail ¶
type IdSbtDetail struct { Abilities [6]int `json:"ability"` Sbts []SbtInWallet `json:"sbts"` }
type MbtiType ¶
type MbtiType int
const ( INFP MbtiType = 0 ENFP MbtiType = 1 INFJ MbtiType = 2 ENFJ MbtiType = 3 INTJ MbtiType = 4 ENTJ MbtiType = 5 INTP MbtiType = 6 ENTP MbtiType = 7 ISFP MbtiType = 8 ESFP MbtiType = 9 ISTP MbtiType = 10 ESTP MbtiType = 11 ISFJ MbtiType = 12 ESFJ MbtiType = 13 ISTJ MbtiType = 14 ESTJ MbtiType = 15 UnKnown MbtiType = -1 )
type NftByWalletOutput ¶
type NftByWalletOutput struct { Total int `json:"total"` Result []SbtInWallet `json:"result"` }
func GetNftByWallet ¶
func GetNftByWallet(address string) *NftByWalletOutput
type NftMetaData ¶
type NftMetaDataOutput ¶
type NftMetaDataOutput struct { Address string `json:"token_address"` TokenId string `json:"token_id"` ContractType string `json:"contract_type"` NormalizedMetadata NftMetaData `json:"normalized_metadata"` }
func GetNftMetadata ¶
func GetNftMetadata(address string, tokenId int) *NftMetaDataOutput
type NftOwnerOutput ¶
type NftOwnerOutput struct {
Result []NftOwnerResult `json:"result"`
}
type NftOwnerResult ¶
type NftOwnerResult struct {
OwnerOf string `json:"owner_of"`
}
type PlatformType ¶
type PlatformType int
type Q11e ¶
type Q11e struct { ddd.EntityBase `bson:",inline"` UserId primitive.ObjectID `bson:"userId"` Goals []string `bson:"goals"` Interests []string `bson:"interests"` Pref1 string `bson:"pref1"` Pref2 string `bson:"pref2"` Pref3 string `bson:"pref3"` Mbti int `bson:"mbti"` Address string `json:"address"` }
type Q11eRepository ¶
type ResumeContent ¶
type ResumeRepository ¶
type SbtDetail ¶
type SbtDetail struct { Metadata *NftMetaDataOutput Owners []string }
type SbtInWallet ¶
type UserEventItem ¶
type UserRecommendation ¶
type UserRecommendation struct { ddd.EntityBase `bson:",inline" json:"ddd.EntityBase"` UserId primitive.ObjectID `bson:"userId"` TargetId primitive.ObjectID `bson:"targetId"` Reasons []string `bson:"reasons"` CreatedAt time.Time `bson:"used"` Score int `bson:"score"` FromAddr string `bson:"fromAddr"` ToAddr string `bson:"toAddr"` }
type UserRecommendationRepository ¶
type UserRecommendationRepository interface { ddd.Repository[UserRecommendation] GetUsers(ctx context.Context, userId primitive.ObjectID) []primitive.ObjectID }
Source Files ¶
- events.go
- follow_model_repo.go
- follow_service.go
- id_model_repo.go
- id_service.go
- main.go
- moralis_model.go
- moralis_service.go
- options_model.go
- ping_service.go
- q11e_model_repo.go
- q11e_service.go
- recommendation_model_repo.go
- recommendation_service.go
- resume_model_repo.go
- resume_service.go
- sbt_model.go
- sbt_service.go
Click to show internal directories.
Click to hide internal directories.