mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
566 B
23 lines
566 B
3 years ago
|
package dao
|
||
|
|
||
3 years ago
|
import "github.com/rocboss/paopao-ce/internal/model"
|
||
3 years ago
|
|
||
|
func (d *Dao) CreatePostContent(content *model.PostContent) (*model.PostContent, error) {
|
||
|
return content.Create(d.engine)
|
||
|
}
|
||
|
|
||
|
func (d *Dao) GetPostContentsByIDs(ids []int64) ([]*model.PostContent, error) {
|
||
|
return (&model.PostContent{}).List(d.engine, &model.ConditionsT{
|
||
|
"post_id IN ?": ids,
|
||
|
"ORDER": "sort ASC",
|
||
|
}, 0, 0)
|
||
|
}
|
||
|
|
||
|
func (d *Dao) GetPostContentByID(id int64) (*model.PostContent, error) {
|
||
|
return (&model.PostContent{
|
||
|
Model: &model.Model{
|
||
|
ID: id,
|
||
|
},
|
||
|
}).Get(d.engine)
|
||
|
}
|