feat: send

This commit is contained in:
Rogee
2025-05-21 21:31:48 +08:00
parent 998941511f
commit 5798b01376

View File

@@ -228,8 +228,11 @@ func (m *postsModel) SendTo(ctx context.Context, postId, userId int64) error {
// add record to user_posts // add record to user_posts
tbl := table.UserPosts tbl := table.UserPosts
stmt := tbl.INSERT(tbl.MutableColumns).MODEL(model.UserPosts{ stmt := tbl.INSERT(tbl.MutableColumns).MODEL(model.UserPosts{
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
UserID: userId, UserID: userId,
PostID: postId, PostID: postId,
Price: -1,
}) })
m.log.Infof("sql: %s", stmt.DebugSql()) m.log.Infof("sql: %s", stmt.DebugSql())
if _, err := stmt.ExecContext(ctx, db); err != nil { if _, err := stmt.ExecContext(ctx, db); err != nil {