feat: update

This commit is contained in:
rogeecn
2025-03-22 20:04:30 +08:00
parent ea6db56fb3
commit ea15a51556
4 changed files with 71 additions and 2 deletions

View File

@@ -150,7 +150,7 @@ func (m *postsModel) List(ctx context.Context, pagination *requests.Pagination,
}, nil
}
func (m *postsModel) IsUserBought(ctx context.Context, userId int64, postId int64) (bool, error) {
func (m *postsModel) IsUserBought(ctx context.Context, userId, postId int64) (bool, error) {
tbl := table.UserPosts
stmt := tbl.
SELECT(tbl.ID).
@@ -175,7 +175,7 @@ func (m *postsModel) IsUserBought(ctx context.Context, userId int64, postId int6
return userPost.ID > 0, nil
}
func (m *postsModel) Buy(ctx context.Context, userId int64, postId int64) error {
func (m *postsModel) Buy(ctx context.Context, userId, postId int64) error {
tbl := table.UserPosts
post, err := m.GetByID(ctx, postId)