mapper

package
v1.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2023 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Code generated by goctl. DO NOT EDIT.

Code generated by goctl. DO NOT EDIT.

Code generated by goctl. DO NOT EDIT.

Code generated by goctl. DO NOT EDIT.

Code generated by goctl. DO NOT EDIT.

Code generated by goctl. DO NOT EDIT.

Code generated by goctl. DO NOT EDIT.

Index

Constants

View Source
const (
	NotificationId             = "_id"
	CreateAt                   = "createAt"
	TargetUserId               = "targetUserId"
	IsRead                     = "isRead"
	UpdateAt                   = "updateAt"
	NotificationCollectionName = "notification"
)
View Source
const AdminCollectionName = "admin"
View Source
const ApplyCollectionName = "apply"
View Source
const CommunityCollectionName = "community"
View Source
const NewsCollectionName = "news"
View Source
const NoticeCollectionName = "notice"
View Source
const UserRoleCollectionName = "user_role"

Variables

View Source
var (
	ErrNotFound        = mon.ErrNotFound
	ErrInvalidObjectId = errors.New("invalid objectId")
)
View Source
var AdminSet = wire.NewSet(
	NewAdminModel,
)
View Source
var ApplySet = wire.NewSet(
	NewApplyModel,
)
View Source
var CommunitySet = wire.NewSet(
	NewCommunityModel,
)
View Source
var NewsSet = wire.NewSet(
	NewNewsModel,
)
View Source
var NoticeSet = wire.NewSet(
	NewNoticeModel,
)
View Source
var NotificationSet = wire.NewSet(
	NewNotificationModel,
)
View Source
var UserRoleSet = wire.NewSet(
	NewUserRoleModel,
)

Functions

func ToFindOptions

func ToFindOptions(page, size int64, sort map[string]int32) *options.FindOptions

Types

type AdminModel

type AdminModel interface {
	ListAdmin(ctx context.Context, query *system.ListAdminReq) ([]*db.Admin, int64, error)
	UpdateAdmin(ctx context.Context, req *system.UpdateAdminReq) error
	// contains filtered or unexported methods
}

AdminModel is an interface to be customized, add more methods here, and implement the added methods in customAdminModel.

func NewAdminModel

func NewAdminModel(config *config.Config) AdminModel

NewAdminModel returns a newsmodel for the mongo.

type ApplyModel

type ApplyModel interface {
	FindAllApplyByCommunityId(ctx context.Context, req *system.ListApplyReq) ([]*db.Apply, error)
	// contains filtered or unexported methods
}

ApplyModel is an interface to be customized, add more methods here, and implement the added methods in customApplyModel.

func NewApplyModel

func NewApplyModel(config *config.Config) ApplyModel

NewApplyModel returns a model for the mongo.

type CommunityModel

type CommunityModel interface {
	ListCommunity(ctx context.Context, req *system.ListCommunityReq) ([]*db.Community, int64, error)
	DeleteCommunity(ctx context.Context, id string) error
	InsertRoot(ctx context.Context, data *db.Community) error
	// contains filtered or unexported methods
}

CommunityModel is an interface to be customized, add more methods here, and implement the added methods in CustomCommunityModel.

func NewCommunityModel

func NewCommunityModel(config *config.Config) CommunityModel

NewCommunityModel returns a model for the mongo.

type CustomCommunityModel

type CustomCommunityModel struct {
	// contains filtered or unexported fields
}

func (CustomCommunityModel) Delete

func (m CustomCommunityModel) Delete(ctx context.Context, id string) (int64, error)

func (*CustomCommunityModel) DeleteCommunity

func (m *CustomCommunityModel) DeleteCommunity(ctx context.Context, id string) error

func (CustomCommunityModel) FindOne

func (m CustomCommunityModel) FindOne(ctx context.Context, id string) (*db.Community, error)

func (CustomCommunityModel) Insert

func (m CustomCommunityModel) Insert(ctx context.Context, data *db.Community) error

func (*CustomCommunityModel) InsertRoot added in v1.0.4

func (m *CustomCommunityModel) InsertRoot(ctx context.Context, data *db.Community) error

func (*CustomCommunityModel) ListCommunity

func (m *CustomCommunityModel) ListCommunity(ctx context.Context, req *system.ListCommunityReq) ([]*db.Community, int64, error)

func (CustomCommunityModel) Update

func (m CustomCommunityModel) Update(ctx context.Context, data *db.Community) (*mongo.UpdateResult, error)

type CustomUserRoleModel

type CustomUserRoleModel struct {
	// contains filtered or unexported fields
}

func (CustomUserRoleModel) Delete

func (m CustomUserRoleModel) Delete(ctx context.Context, id string) (int64, error)

func (CustomUserRoleModel) FindMany

func (m CustomUserRoleModel) FindMany(ctx context.Context, role string, communityId string) ([]*db.UserRole, error)

func (CustomUserRoleModel) FindOne

func (m CustomUserRoleModel) FindOne(ctx context.Context, id string) (*db.UserRole, error)

func (CustomUserRoleModel) Insert

func (m CustomUserRoleModel) Insert(ctx context.Context, data *db.UserRole) error

func (CustomUserRoleModel) Update

func (m CustomUserRoleModel) Update(ctx context.Context, data *db.UserRole) (*mongo.UpdateResult, error)

func (CustomUserRoleModel) Upsert

type NewsModel

type NewsModel interface {
	UpdateNews(ctx context.Context, req *system.UpdateNewsReq) error
	ListNews(ctx context.Context, req *system.ListNewsReq) ([]*db.News, int64, error)
	// contains filtered or unexported methods
}

NewsModel is an interface to be customized, add more methods here, and implement the added methods in customNewsModel.

func NewNewsModel

func NewNewsModel(config *config.Config) NewsModel

NewNewsModel returns a newsmodel for the mongo.

type NoticeModel

type NoticeModel interface {
	ListNotice(ctx context.Context, req *system.ListNoticeReq) ([]*db.Notice, int64, error)
	UpdateNotice(ctx context.Context, req *system.UpdateNoticeReq) error
	// contains filtered or unexported methods
}

NoticeModel is an interface to be customized, add more methods here, and implement the added methods in customNoticeModel.

func NewNoticeModel

func NewNoticeModel(config *config.Config) NoticeModel

NewNoticeModel returns a noticemodel for the mongo.

type NotificationModel added in v1.0.7

type NotificationModel interface {
	ListNotification(ctx context.Context, req *system.ListNotificationReq) ([]*db.Notification, int64, error)
	CleanNotification(ctx context.Context, userId string) error
	ReadNotification(ctx context.Context, notificationId string) error
	CountNotification(ctx context.Context, userId string) (int64, error)
	// contains filtered or unexported methods
}

NotificationModel is an interface to be customized, add more methods here, and implement the added methods in customNotificationModel.

func NewNotificationModel added in v1.0.7

func NewNotificationModel(config *config.Config) NotificationModel

NewNotificationModel returns a Notification-model for the mongo.

type UserRoleModel

type UserRoleModel interface {
	Upsert(ctx context.Context, data *db.UserRole) (*mongo.UpdateResult, error)
	FindMany(ctx context.Context, role string, communityId string) ([]*db.UserRole, error)
	// contains filtered or unexported methods
}

UserRoleModel is an interface to be customized, add more methods here, and implement the added methods in CustomUserRoleModel.

func NewUserRoleModel

func NewUserRoleModel(config *config.Config) UserRoleModel

NewUserRoleModel returns a model for the mongo.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL