go_dreamfactory/modules/story/model_story.go
2022-07-06 19:50:05 +08:00

36 lines
888 B
Go

package story
import (
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
)
const ( //Redis
TableStory core.SqlTable = "story"
)
type ModelStory struct {
modules.MCompModel
moduleStory *Story
}
func (this *ModelStory) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
err = this.MCompModel.Init(service, module, comp, options)
this.moduleStory = module.(*Story)
this.TableName = string(TableStory)
return
}
// 获取章节信息
func (this *ModelStory) getStoryList(uid string) (storys []*pb.DBStory, err error) {
storys = make([]*pb.DBStory, 0)
err = this.GetList(uid, &storys)
return
}
// 修改章节信息
func (this *ModelStory) modifyStoryData(uid string, objid string, data map[string]interface{}) error {
return this.moduleStory.modelStory.ChangeList(uid, objid, data)
}