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.
Index ¶
- Constants
- Variables
- func ToFindOptions(page, size int64, sort map[string]int32) *options.FindOptions
- type Admin
- type AdminModel
- type Apply
- type ApplyModel
- type Community
- type CommunityModel
- type CustomCommunityModel
- func (m CustomCommunityModel) Delete(ctx context.Context, id string) (int64, error)
- func (c CustomCommunityModel) DeleteCommunity(ctx context.Context, id string) error
- func (m CustomCommunityModel) FindOne(ctx context.Context, id string) (*Community, error)
- func (m CustomCommunityModel) Insert(ctx context.Context, data *Community) error
- func (c CustomCommunityModel) ListCommunity(ctx context.Context, req *pb.ListCommunityReq) ([]*Community, int64, error)
- func (m CustomCommunityModel) Update(ctx context.Context, data *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) ([]*UserRole, error)
- func (m CustomUserRoleModel) FindOne(ctx context.Context, id string) (*UserRole, error)
- func (m CustomUserRoleModel) Insert(ctx context.Context, data *UserRole) error
- func (m CustomUserRoleModel) Update(ctx context.Context, data *UserRole) (*mongo.UpdateResult, error)
- func (m CustomUserRoleModel) Upsert(ctx context.Context, data *UserRole) (*mongo.UpdateResult, error)
- type News
- type NewsModel
- type Notice
- type NoticeModel
- type Role
- type UserRole
- type UserRoleModel
Constants ¶
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") )
Functions ¶
func ToFindOptions ¶
func ToFindOptions(page, size int64, sort map[string]int32) *options.FindOptions
Types ¶
type Admin ¶
type Admin struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` CommunityId string `bson:"communityId,omitempty" json:"communityId,omitempty"` Name string `bson:"name,omitempty" json:"name,omitempty"` Title string `bson:"title,omitempty" json:"title,omitempty"` Phone string `bson:"phone,omitempty" json:"phone,omitempty"` Wechat string `bson:"wechat,omitempty" json:"wechat,omitempty"` AvatarUrl string `bson:"avatarUrl,omitempty" json:"avatarUrl,omitempty"` UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"` CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"` }
type AdminModel ¶
type AdminModel interface { ListAdmin(ctx context.Context, query *pb.ListAdminReq) ([]*Admin, int64, error) UpdateAdmin(ctx context.Context, req *pb.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(url, db, collection string, c cache.CacheConf) AdminModel
NewAdminModel returns a newsmodel for the mongo.
type Apply ¶ added in v1.2.2
type Apply struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` ApplicantId string `bson:"applicantId,omitempty" json:"applicantId,omitempty"` CommunityId string `bson:"communityId,omitempty" json:"communityId,omitempty"` UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"` CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"` }
type ApplyModel ¶ added in v1.2.2
type ApplyModel interface { FindAllApplyByCommunityId(ctx context.Context, req *pb.ListApplyReq) ([]*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 ¶ added in v1.2.2
func NewApplyModel(url, db, collection string) ApplyModel
NewApplyModel returns a model for the mongo.
type Community ¶
type Community struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` Name string `bson:"name,omitempty" json:"name,omitempty"` ParentId primitive.ObjectID `bson:"parentId,omitempty" json:"parent_id,omitempty"` UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"` CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"` }
type CommunityModel ¶
type CommunityModel interface { ListCommunity(ctx context.Context, req *pb.ListCommunityReq) ([]*Community, int64, error) DeleteCommunity(ctx context.Context, id string) 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(url, db, collection string, c cache.CacheConf) CommunityModel
NewCommunityModel returns a model for the mongo.
type CustomCommunityModel ¶
type CustomCommunityModel struct {
// contains filtered or unexported fields
}
func (CustomCommunityModel) DeleteCommunity ¶
func (c CustomCommunityModel) DeleteCommunity(ctx context.Context, id string) error
func (CustomCommunityModel) ListCommunity ¶
func (c CustomCommunityModel) ListCommunity(ctx context.Context, req *pb.ListCommunityReq) ([]*Community, int64, error)
type CustomUserRoleModel ¶
type CustomUserRoleModel struct {
// contains filtered or unexported fields
}
func (CustomUserRoleModel) Upsert ¶
func (m CustomUserRoleModel) Upsert(ctx context.Context, data *UserRole) (*mongo.UpdateResult, error)
type News ¶
type News struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` CommunityId string `bson:"communityId,omitempty" json:"communityId,omitempty"` ImageUrl string `bson:"imageUrl,omitempty" json:"imageUrl,omitempty"` LinkUrl string `bson:"linkUrl,omitempty" json:"linkUrl,omitempty"` Type string `bson:"type,omitempty" json:"type,omitempty"` IsPublic int64 `bson:"isPublic,omitempty" json:"isPublic,omitempty"` UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"` CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"` }
type NewsModel ¶
type NewsModel interface { UpdateNews(ctx context.Context, req *pb.UpdateNewsReq) error ListNews(ctx context.Context, req *pb.ListNewsReq) ([]*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.
type Notice ¶
type Notice struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` CommunityId string `bson:"communityId,omitempty" json:"communityId,omitempty"` Text string `bson:"text,omitempty" json:"text,omitempty"` UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"` CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"` }
type NoticeModel ¶
type NoticeModel interface { ListNotice(ctx context.Context, req *pb.ListNoticeReq) ([]*Notice, int64, error) UpdateNotice(ctx context.Context, req *pb.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(url, db, collection string, c cache.CacheConf) NoticeModel
NewNoticeModel returns a noticemodel for the mongo.
type UserRoleModel ¶
type UserRoleModel interface { Upsert(ctx context.Context, data *UserRole) (*mongo.UpdateResult, error) FindMany(ctx context.Context, role string, communityId string) ([]*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(url, db, collection string, c cache.CacheConf) UserRoleModel
NewUserRoleModel returns a model for the mongo.
Source Files ¶
- admin_model.go
- admin_model_gen.go
- admin_types.go
- apply_model.go
- apply_model_gen.go
- apply_types.go
- community_model.go
- community_model_gen.go
- community_types.go
- error.go
- news_model.go
- news_model_gen.go
- news_types.go
- notice_model.go
- notice_model_gen.go
- notice_types.go
- user_role_model.go
- user_role_model_gen.go
- user_role_types.go
- util.go