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
- Variables
- func ToFindOptions(page, size int64, sort map[string]int32) *options.FindOptions
- type AdminModel
- type ApplyModel
- type CommunityModel
- type CustomCommunityModel
- func (m CustomCommunityModel) Delete(ctx context.Context, id string) (int64, error)
- func (m *CustomCommunityModel) DeleteCommunity(ctx context.Context, id string) error
- func (m CustomCommunityModel) FindOne(ctx context.Context, id string) (*db.Community, error)
- func (m CustomCommunityModel) Insert(ctx context.Context, data *db.Community) error
- func (m *CustomCommunityModel) InsertRoot(ctx context.Context, data *db.Community) error
- func (m *CustomCommunityModel) ListCommunity(ctx context.Context, req *system.ListCommunityReq) ([]*db.Community, int64, error)
- func (m CustomCommunityModel) Update(ctx context.Context, data *db.Community) (*mongo.UpdateResult, error)
- type CustomUserRoleModel
- func (m CustomUserRoleModel) Delete(ctx context.Context, id string) (int64, error)
- func (m CustomUserRoleModel) FindMany(ctx context.Context, role string, communityId string) ([]*db.UserRole, error)
- func (m CustomUserRoleModel) FindOne(ctx context.Context, id string) (*db.UserRole, error)
- func (m CustomUserRoleModel) Insert(ctx context.Context, data *db.UserRole) error
- func (m CustomUserRoleModel) Update(ctx context.Context, data *db.UserRole) (*mongo.UpdateResult, error)
- func (m CustomUserRoleModel) Upsert(ctx context.Context, data *db.UserRole) (*mongo.UpdateResult, error)
- type NewsModel
- type NoticeModel
- type NotificationModel
- type UserRoleModel
Constants ¶
const ( NotificationId = "_id" CreateAt = "createAt" TargetUserId = "targetUserId" IsRead = "isRead" UpdateAt = "updateAt" NotificationCollectionName = "notification" )
const AdminCollectionName = "admin"
const ApplyCollectionName = "apply"
const CommunityCollectionName = "community"
const NewsCollectionName = "news"
const NoticeCollectionName = "notice"
const UserRoleCollectionName = "user_role"
Variables ¶
var ( ErrNotFound = mon.ErrNotFound ErrInvalidObjectId = errors.New("invalid objectId") )
var AdminSet = wire.NewSet( NewAdminModel, )
var ApplySet = wire.NewSet( NewApplyModel, )
var CommunitySet = wire.NewSet( NewCommunityModel, )
var NewsSet = wire.NewSet( NewNewsModel, )
var NoticeSet = wire.NewSet( NewNoticeModel, )
var NotificationSet = wire.NewSet( NewNotificationModel, )
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) DeleteCommunity ¶
func (m *CustomCommunityModel) DeleteCommunity(ctx context.Context, id string) error
func (*CustomCommunityModel) InsertRoot ¶ added in v1.0.4
func (*CustomCommunityModel) ListCommunity ¶
func (m *CustomCommunityModel) ListCommunity(ctx context.Context, req *system.ListCommunityReq) ([]*db.Community, int64, error)
type CustomUserRoleModel ¶
type CustomUserRoleModel struct {
// contains filtered or unexported fields
}
func (CustomUserRoleModel) Upsert ¶
func (m CustomUserRoleModel) Upsert(ctx context.Context, data *db.UserRole) (*mongo.UpdateResult, error)
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 ¶
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.