增加提取castile到游戏的逻辑。
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
package model
|
||||
|
||||
import "github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
var _ NhCastileTokenLogModel = (*customNhCastileTokenLogModel)(nil)
|
||||
|
||||
@@ -9,7 +13,8 @@ type (
|
||||
// and implement the added methods in customNhCastileTokenLogModel.
|
||||
NhCastileTokenLogModel interface {
|
||||
nhCastileTokenLogModel
|
||||
withSession(session sqlx.Session) NhCastileTokenLogModel
|
||||
WithSession(session sqlx.Session) NhCastileTokenLogModel
|
||||
UpdateStatus(ctx context.Context, status uint, id uint) error
|
||||
}
|
||||
|
||||
customNhCastileTokenLogModel struct {
|
||||
@@ -24,6 +29,12 @@ func NewNhCastileTokenLogModel(conn sqlx.SqlConn) NhCastileTokenLogModel {
|
||||
}
|
||||
}
|
||||
|
||||
func (m *customNhCastileTokenLogModel) withSession(session sqlx.Session) NhCastileTokenLogModel {
|
||||
func (m *customNhCastileTokenLogModel) WithSession(session sqlx.Session) NhCastileTokenLogModel {
|
||||
return NewNhCastileTokenLogModel(sqlx.NewSqlConnFromSession(session))
|
||||
}
|
||||
|
||||
func (m *customNhCastileTokenLogModel) UpdateStatus(ctx context.Context, status uint, id uint) error {
|
||||
query := fmt.Sprintf("update %s set `callback_status` = ? where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, query, status, id)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user