|
- package db
-
- import jcstypes "gitlink.org.cn/cloudream/jcs-pub/common/types"
-
- type PubShardsDB struct {
- *DB
- }
-
- func (db *DB) PubShards() *PubShardsDB {
- return &PubShardsDB{DB: db}
- }
-
- func (*PubShardsDB) Get(ctx SQLContext, publicShardStoreID jcstypes.PubShardsID) (*jcstypes.PubShards, error) {
- var cfg jcstypes.PubShards
- if err := ctx.First(&cfg, publicShardStoreID).Error; err != nil {
- return nil, err
- }
-
- return &cfg, nil
- }
-
- func (*PubShardsDB) Create(ctx SQLContext, cfg jcstypes.PubShards) error {
- return ctx.Create(&cfg).Error
- }
|