db update

This commit is contained in:
Gordon 2023-01-17 17:46:33 +08:00
parent f538a86e10
commit 0a57d5a426

View File

@ -9,12 +9,15 @@ import (
) )
type GroupModelInterface interface { type GroupModelInterface interface {
//mysql
Create(ctx context.Context, groups []*Group) (err error) Create(ctx context.Context, groups []*Group) (err error)
Delete(ctx context.Context, groupIDs []string, tx ...*gorm.DB) (err error) Delete(ctx context.Context, groupIDs []string, tx ...*gorm.DB) (err error)
UpdateByMap(ctx context.Context, groupID string, args map[string]interface{}) (err error) UpdateByMap(ctx context.Context, groupID string, args map[string]interface{}) (err error)
Update(ctx context.Context, groups []*Group) (err error) Update(ctx context.Context, groups []*Group) (err error)
Find(ctx context.Context, groupIDs []string) (groups []*Group, err error) Find(ctx context.Context, groupIDs []string) (groups []*Group, err error)
Take(ctx context.Context, groupID string) (group *Group, err error) Take(ctx context.Context, groupID string) (group *Group, err error)
//mongo
} }
type Group struct { type Group struct {
GroupID string `gorm:"column:group_id;primary_key;size:64" json:"groupID" binding:"required"` GroupID string `gorm:"column:group_id;primary_key;size:64" json:"groupID" binding:"required"`