Documentation ¶
Index ¶
- Constants
- func AddMongoClient(builder *app.AppBuilder)
- func AddRepositories(builder *app.AppBuilder)
- func MongoStore(builder *app.AppBuilder)
- func NewMongoFollowRepository(c *di.Container) *hackathon.FollowRepository
- func NewMongoIdRepository(c *di.Container) *hackathon.IdRepository
- func NewMongoInterestRepository(c *di.Container) *interest.Repository
- func NewMongoProjectRepository(c *di.Container) *resume.ProjectRepository
- func NewMongoQ11eRepository(c *di.Container) *hackathon.Q11eRepository
- func NewMongoResumeRepository(c *di.Container) *hackathon.ResumeRepository
- func NewMongoRoleRepository(c *di.Container) *resume.RoleRepository
- func NewMongoUserRecommendRepository(c *di.Container) *hackathon.UserRecommendationRepository
- func NewMongoUserRepository(c *di.Container) *identity2.UserRepository
- type MongoFollowRepository
- func (r *MongoFollowRepository) CheckExistsByToAndFromAddr(ctx context.Context, fromUser primitive.ObjectID, toUser primitive.ObjectID) bool
- func (r *MongoFollowRepository) CheckIsFollowing(ctx context.Context, userId primitive.ObjectID, ids []primitive.ObjectID) map[primitive.ObjectID]bool
- func (r *MongoFollowRepository) CountUsers(ctx context.Context, userIds []primitive.ObjectID, isTo bool) map[primitive.ObjectID]int
- func (r *MongoFollowRepository) DeleteByToAndFrom(ctx context.Context, fromUser primitive.ObjectID, toUser primitive.ObjectID) bool
- func (r *MongoFollowRepository) GetFollowerCount(ctx context.Context, userIds []primitive.ObjectID) map[primitive.ObjectID]int
- func (r *MongoFollowRepository) GetFollowingCount(ctx context.Context, userIds []primitive.ObjectID) map[primitive.ObjectID]int
- func (r *MongoFollowRepository) GetFollowingUsers(ctx context.Context, userId primitive.ObjectID) []primitive.ObjectID
- func (r *MongoFollowRepository) GetListByFilter(ctx context.Context, userId primitive.ObjectID, key string) []hackathon.Follow
- type MongoIdRepository
- func (r *MongoIdRepository) CheckAddrs(ctx context.Context, addrs []string) []string
- func (r *MongoIdRepository) CheckExistsByAddrBaseAddrAndPltfm(ctx context.Context, address string, baseAddr string, ...) bool
- func (r *MongoIdRepository) GetListByAddress(ctx context.Context, address string) []hackathon.Id
- func (r *MongoIdRepository) GetListByBaseAddr(ctx context.Context, baseAddr string) []hackathon.Id
- func (r *MongoIdRepository) GetTen(ctx context.Context) []hackathon.Id
- type MongoInterestRepository
- func (r *MongoInterestRepository) CheckMany(ctx context.Context, userIds []primitive.ObjectID, targetId []string, ...) []interest.Interest
- func (r *MongoInterestRepository) DeleteBy(ctx context.Context, address primitive.ObjectID, targetId, targetType string) int
- func (r *MongoInterestRepository) GetManyByUsers(ctx context.Context, users []primitive.ObjectID, targetType string) []interest.Interest
- func (r *MongoInterestRepository) GetUsers(ctx context.Context, targetId []string, targetType string) []interest.Interest
- func (r *MongoInterestRepository) SetInterest(ctx context.Context, ins *interest.Interest) int
- type MongoQ11eRepository
- func (r *MongoQ11eRepository) CheckAndGetExistsByUser(ctx context.Context, userId primitive.ObjectID) (bool, *hackathon.Q11e)
- func (r *MongoQ11eRepository) GetByUserId(ctx context.Context, userId primitive.ObjectID) *hackathon.Q11e
- func (r *MongoQ11eRepository) GetManyByUsers(ctx context.Context, userIds []primitive.ObjectID) []hackathon.Q11e
- type MongoRepositoryBase
- func (mr *MongoRepositoryBase[TEntity]) Collection(ctx context.Context) *mongodb.Collection[TEntity]
- func (mr *MongoRepositoryBase[TEntity]) Count(ctx context.Context) int64
- func (mr *MongoRepositoryBase[TEntity]) Delete(ctx context.Context, id primitive.ObjectID) int
- func (mr *MongoRepositoryBase[TEntity]) DeleteMany(ctx context.Context, ids []primitive.ObjectID) int
- func (mr *MongoRepositoryBase[TEntity]) Exists(ctx context.Context, id primitive.ObjectID) bool
- func (mr *MongoRepositoryBase[TEntity]) ExistsByField(ctx context.Context, field string, v any) bool
- func (mr *MongoRepositoryBase[TEntity]) FilterCount(ctx context.Context, filter bson.D) int64
- func (mr *MongoRepositoryBase[TEntity]) Find(ctx context.Context, filter bson.D, opts ...*options.FindOptions) []TEntity
- func (mr *MongoRepositoryBase[TEntity]) FindByRegex(ctx context.Context, field, regex string, p *x.PageAndSort) []TEntity
- func (mr *MongoRepositoryBase[TEntity]) FindOne(ctx context.Context, filter bson.D, opts ...*options.FindOneOptions) *TEntity
- func (mr *MongoRepositoryBase[TEntity]) FirstOrDefault(ctx context.Context, id primitive.ObjectID) *TEntity
- func (mr *MongoRepositoryBase[TEntity]) Get(ctx context.Context, id primitive.ObjectID) *TEntity
- func (mr *MongoRepositoryBase[TEntity]) GetAll(ctx context.Context) []TEntity
- func (mr *MongoRepositoryBase[TEntity]) GetCollection(ctx context.Context, name string) *mongo.Collection
- func (mr *MongoRepositoryBase[TEntity]) GetList(ctx context.Context, filter bson.D, page int64, pageSize int64, ...) ([]TEntity, int64)
- func (mr *MongoRepositoryBase[TEntity]) GetMany(ctx context.Context, ids []primitive.ObjectID) []TEntity
- func (mr *MongoRepositoryBase[TEntity]) GetPagedList(ctx context.Context, p *x.PageAndSort) ([]TEntity, int64)
- func (mr *MongoRepositoryBase[TEntity]) Insert(ctx context.Context, entity *TEntity) primitive.ObjectID
- func (mr *MongoRepositoryBase[TEntity]) InsertMany(ctx context.Context, entitis []TEntity, ignoreErr bool) []primitive.ObjectID
- func (mr *MongoRepositoryBase[TEntiy]) MaxOrder(ctx context.Context, field string, v any) float64
- func (mr *MongoRepositoryBase[TEntity]) MaxOrderMany(ctx context.Context, field string, v any) map[any]float64
- func (mr *MongoRepositoryBase[TEntity]) ParseSort(p *x.PageAndSort) bson.D
- func (mr *MongoRepositoryBase[TEntity]) Set(ctx context.Context, id primitive.ObjectID, enitty *TEntity) int
- func (mr *MongoRepositoryBase[TEntity]) Update(ctx context.Context, id primitive.ObjectID, entity *TEntity) int
- func (mr *MongoRepositoryBase[TEntity]) UpsertByField(ctx context.Context, field string, fieldValue any, newObj *TEntity) primitive.ObjectID
- type MongoResumeProjectRepository
- type MongoResumeRepository
- type MongoResumeRoleRepository
- type MongoTransactionContext
- type MongoUserRecommendRepository
- type MongoUserRepository
- func (m *MongoUserRepository) Find(ctx context.Context, address common.Address) *identity2.User
- func (m *MongoUserRepository) GetManyByAddr(ctx context.Context, addresses []common.Address) []identity2.User
- func (m *MongoUserRepository) GetManyPlatforms(ctx context.Context, userIds []primitive.ObjectID) []identity2.UserPlatform
- func (m *MongoUserRepository) GetPlatforms(ctx context.Context, userId primitive.ObjectID) []identity2.UserPlatform
- func (m *MongoUserRepository) GetUsers(ctx context.Context, q *string, platform *identity2.UserPlatformType, ...) []identity2.User
- func (m *MongoUserRepository) LinkPlatform(ctx context.Context, p *identity2.UserPlatform)
- func (m *MongoUserRepository) UnlinkPlatform(ctx context.Context, userId primitive.ObjectID, address common.Address, ...) int
Constants ¶
View Source
const FollowCollectionName = "follow"
View Source
const IdCollectionName = "id"
View Source
const InterestsCollectionName = "interests"
View Source
const Q11eCollectionName = "q11e"
View Source
const ResumeCollectionName = "resume"
Variables ¶
This section is empty.
Functions ¶
func AddMongoClient ¶
func AddMongoClient(builder *app.AppBuilder)
func AddRepositories ¶
func AddRepositories(builder *app.AppBuilder)
func MongoStore ¶
func MongoStore(builder *app.AppBuilder)
func NewMongoFollowRepository ¶
func NewMongoFollowRepository(c *di.Container) *hackathon.FollowRepository
func NewMongoIdRepository ¶
func NewMongoIdRepository(c *di.Container) *hackathon.IdRepository
func NewMongoInterestRepository ¶
func NewMongoInterestRepository(c *di.Container) *interest.Repository
func NewMongoProjectRepository ¶
func NewMongoProjectRepository(c *di.Container) *resume.ProjectRepository
func NewMongoQ11eRepository ¶
func NewMongoQ11eRepository(c *di.Container) *hackathon.Q11eRepository
func NewMongoResumeRepository ¶
func NewMongoResumeRepository(c *di.Container) *hackathon.ResumeRepository
func NewMongoRoleRepository ¶
func NewMongoRoleRepository(c *di.Container) *resume.RoleRepository
func NewMongoUserRecommendRepository ¶
func NewMongoUserRecommendRepository(c *di.Container) *hackathon.UserRecommendationRepository
func NewMongoUserRepository ¶
func NewMongoUserRepository(c *di.Container) *identity2.UserRepository
Types ¶
type MongoFollowRepository ¶
type MongoFollowRepository struct { *MongoRepositoryBase[hackathon.Follow] }
func (*MongoFollowRepository) CheckExistsByToAndFromAddr ¶
func (*MongoFollowRepository) CheckIsFollowing ¶
func (*MongoFollowRepository) CountUsers ¶
func (*MongoFollowRepository) DeleteByToAndFrom ¶
func (*MongoFollowRepository) GetFollowerCount ¶
func (*MongoFollowRepository) GetFollowingCount ¶
func (r *MongoFollowRepository) GetFollowingCount(ctx context.Context, userIds []primitive.ObjectID) map[primitive.ObjectID]int
GetFollowingCount 获取关注数
func (*MongoFollowRepository) GetFollowingUsers ¶
func (*MongoFollowRepository) GetListByFilter ¶
type MongoIdRepository ¶
type MongoIdRepository struct { *MongoRepositoryBase[hackathon.Id] }
func (*MongoIdRepository) CheckAddrs ¶
func (r *MongoIdRepository) CheckAddrs(ctx context.Context, addrs []string) []string
func (*MongoIdRepository) CheckExistsByAddrBaseAddrAndPltfm ¶
func (r *MongoIdRepository) CheckExistsByAddrBaseAddrAndPltfm(ctx context.Context, address string, baseAddr string, platform hackathon.PlatformType) bool
func (*MongoIdRepository) GetListByAddress ¶
func (*MongoIdRepository) GetListByBaseAddr ¶
type MongoInterestRepository ¶
type MongoInterestRepository struct { *MongoRepositoryBase[interest.Interest] }
func (*MongoInterestRepository) GetManyByUsers ¶
func (*MongoInterestRepository) SetInterest ¶
type MongoQ11eRepository ¶
type MongoQ11eRepository struct { *MongoRepositoryBase[hackathon.Q11e] }
func (*MongoQ11eRepository) CheckAndGetExistsByUser ¶
func (*MongoQ11eRepository) GetByUserId ¶
func (*MongoQ11eRepository) GetManyByUsers ¶
type MongoRepositoryBase ¶
type MongoRepositoryBase[TEntity any] struct { Options *mongodb.MongoOptions CollectionName string }
func MongoRepositoryResolver ¶
func MongoRepositoryResolver[TEntity any](collectionName string) *MongoRepositoryBase[TEntity]
func NewMongoRepositoryBase ¶
func NewMongoRepositoryBase[TEntiy any](collectionName string) *MongoRepositoryBase[TEntiy]
func (*MongoRepositoryBase[TEntity]) Collection ¶
func (mr *MongoRepositoryBase[TEntity]) Collection(ctx context.Context) *mongodb.Collection[TEntity]
func (*MongoRepositoryBase[TEntity]) Count ¶
func (mr *MongoRepositoryBase[TEntity]) Count(ctx context.Context) int64
Count count
func (*MongoRepositoryBase[TEntity]) DeleteMany ¶
func (*MongoRepositoryBase[TEntity]) ExistsByField ¶
func (*MongoRepositoryBase[TEntity]) FilterCount ¶
FilterCount count
func (*MongoRepositoryBase[TEntity]) Find ¶
func (mr *MongoRepositoryBase[TEntity]) Find(ctx context.Context, filter bson.D, opts ...*options.FindOptions) []TEntity
func (*MongoRepositoryBase[TEntity]) FindByRegex ¶
func (mr *MongoRepositoryBase[TEntity]) FindByRegex(ctx context.Context, field, regex string, p *x.PageAndSort) []TEntity
FindByRegex 通过string类型字段进行字符串匹配
func (*MongoRepositoryBase[TEntity]) FindOne ¶
func (mr *MongoRepositoryBase[TEntity]) FindOne(ctx context.Context, filter bson.D, opts ...*options.FindOneOptions) *TEntity
func (*MongoRepositoryBase[TEntity]) FirstOrDefault ¶
func (mr *MongoRepositoryBase[TEntity]) FirstOrDefault(ctx context.Context, id primitive.ObjectID) *TEntity
func (*MongoRepositoryBase[TEntity]) Get ¶
func (mr *MongoRepositoryBase[TEntity]) Get(ctx context.Context, id primitive.ObjectID) *TEntity
func (*MongoRepositoryBase[TEntity]) GetAll ¶
func (mr *MongoRepositoryBase[TEntity]) GetAll(ctx context.Context) []TEntity
func (*MongoRepositoryBase[TEntity]) GetCollection ¶
func (mr *MongoRepositoryBase[TEntity]) GetCollection(ctx context.Context, name string) *mongo.Collection
func (*MongoRepositoryBase[TEntity]) GetList ¶
func (mr *MongoRepositoryBase[TEntity]) GetList(ctx context.Context, filter bson.D, page int64, pageSize int64, opt *options.FindOptions) ([]TEntity, int64)
func (*MongoRepositoryBase[TEntity]) GetMany ¶
func (mr *MongoRepositoryBase[TEntity]) GetMany(ctx context.Context, ids []primitive.ObjectID) []TEntity
func (*MongoRepositoryBase[TEntity]) GetPagedList ¶
func (mr *MongoRepositoryBase[TEntity]) GetPagedList(ctx context.Context, p *x.PageAndSort) ([]TEntity, int64)
func (*MongoRepositoryBase[TEntity]) Insert ¶
func (mr *MongoRepositoryBase[TEntity]) Insert(ctx context.Context, entity *TEntity) primitive.ObjectID
func (*MongoRepositoryBase[TEntity]) InsertMany ¶
func (*MongoRepositoryBase[TEntity]) MaxOrderMany ¶
func (*MongoRepositoryBase[TEntity]) ParseSort ¶
func (mr *MongoRepositoryBase[TEntity]) ParseSort(p *x.PageAndSort) bson.D
func (*MongoRepositoryBase[TEntity]) UpsertByField ¶
func (mr *MongoRepositoryBase[TEntity]) UpsertByField(ctx context.Context, field string, fieldValue any, newObj *TEntity) primitive.ObjectID
Upsert By Field
type MongoResumeProjectRepository ¶
type MongoResumeProjectRepository struct { *MongoRepositoryBase[resume.Project] }
type MongoResumeRepository ¶
type MongoResumeRepository struct { *MongoRepositoryBase[hackathon.Resume] }
func (*MongoResumeRepository) CheckExists ¶
func (*MongoResumeRepository) GetByUserId ¶
type MongoResumeRoleRepository ¶
type MongoResumeRoleRepository struct { *MongoRepositoryBase[resume.Role] }
type MongoTransactionContext ¶
type MongoTransactionContext struct {
// contains filtered or unexported fields
}
func NewMongoTransactionContext ¶
func NewMongoTransactionContext(ctx mongo.SessionContext) MongoTransactionContext
type MongoUserRecommendRepository ¶
type MongoUserRecommendRepository struct { *MongoRepositoryBase[hackathon.UserRecommendation] }
type MongoUserRepository ¶
type MongoUserRepository struct { *MongoRepositoryBase[identity2.User] }
func (*MongoUserRepository) GetManyByAddr ¶
func (*MongoUserRepository) GetManyPlatforms ¶
func (m *MongoUserRepository) GetManyPlatforms(ctx context.Context, userIds []primitive.ObjectID) []identity2.UserPlatform
func (*MongoUserRepository) GetPlatforms ¶
func (m *MongoUserRepository) GetPlatforms(ctx context.Context, userId primitive.ObjectID) []identity2.UserPlatform
func (*MongoUserRepository) GetUsers ¶
func (m *MongoUserRepository) GetUsers(ctx context.Context, q *string, platform *identity2.UserPlatformType, p *x.PageAndSort) []identity2.User
func (*MongoUserRepository) LinkPlatform ¶
func (m *MongoUserRepository) LinkPlatform(ctx context.Context, p *identity2.UserPlatform)
func (*MongoUserRepository) UnlinkPlatform ¶
Click to show internal directories.
Click to hide internal directories.