|
|
@ -1,6 +1,6 @@
|
|
|
|
// Code generated by Yesql. DO NOT EDIT.
|
|
|
|
// Code generated by Yesql. DO NOT EDIT.
|
|
|
|
// versions:
|
|
|
|
// versions:
|
|
|
|
// - Yesql v1.5.0
|
|
|
|
// - Yesql v1.8.0
|
|
|
|
|
|
|
|
|
|
|
|
package cc
|
|
|
|
package cc
|
|
|
|
|
|
|
|
|
|
|
@ -8,7 +8,7 @@ import (
|
|
|
|
"context"
|
|
|
|
"context"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/alimy/yesql"
|
|
|
|
"github.com/alimy/yesql"
|
|
|
|
"github.com/jmoiron/sqlx"
|
|
|
|
"github.com/bitbus/sqlx"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
const (
|
|
|
@ -178,6 +178,26 @@ const (
|
|
|
|
_Wallet_NewPostBill = `INSERT INTO @wallet_statement (post_id, user_id, change_amount, balance_snapshot, reason, created_on) VALUES (?, ?, ?, ?, ?, ?)`
|
|
|
|
_Wallet_NewPostBill = `INSERT INTO @wallet_statement (post_id, user_id, change_amount, balance_snapshot, reason, created_on) VALUES (?, ?, ?, ?, ?, ?)`
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// PreparexContext enhances the Conn interface with context.
|
|
|
|
|
|
|
|
type PreparexContext interface {
|
|
|
|
|
|
|
|
// PrepareContext prepares a statement.
|
|
|
|
|
|
|
|
// The provided context is used for the preparation of the statement, not for
|
|
|
|
|
|
|
|
// the execution of the statement.
|
|
|
|
|
|
|
|
PreparexContext(ctx context.Context, query string) (*sqlx.Stmt, error)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// PrepareNamedContext returns an sqlx.NamedStmt
|
|
|
|
|
|
|
|
PrepareNamedContext(ctx context.Context, query string) (*sqlx.NamedStmt, error)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Rebind rebind query to adapte SQL Driver
|
|
|
|
|
|
|
|
Rebind(query string) string
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// PreparexBuilder preparex builder interface for sqlx
|
|
|
|
|
|
|
|
type PreparexBuilder interface {
|
|
|
|
|
|
|
|
PreparexContext
|
|
|
|
|
|
|
|
QueryHook(query string) string
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type Yesql struct {
|
|
|
|
type Yesql struct {
|
|
|
|
TagsFromNames string `yesql:"tags_from_names"`
|
|
|
|
TagsFromNames string `yesql:"tags_from_names"`
|
|
|
|
UpdateTagQuote *sqlx.Stmt `yesql:"update_tag_quote"`
|
|
|
|
UpdateTagQuote *sqlx.Stmt `yesql:"update_tag_quote"`
|
|
|
@ -425,7 +445,7 @@ type Wallet struct {
|
|
|
|
NewPostBill *sqlx.Stmt `yesql:"new_post_bill"`
|
|
|
|
NewPostBill *sqlx.Stmt `yesql:"new_post_bill"`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildYesql(p yesql.PreparexBuilder, ctx ...context.Context) (obj *Yesql, err error) {
|
|
|
|
func BuildYesql(p PreparexBuilder, ctx ...context.Context) (obj *Yesql, err error) {
|
|
|
|
var c context.Context
|
|
|
|
var c context.Context
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
c = ctx[0]
|
|
|
|
c = ctx[0]
|
|
|
@ -441,7 +461,7 @@ func BuildYesql(p yesql.PreparexBuilder, ctx ...context.Context) (obj *Yesql, er
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildAuthorizationManage(p yesql.PreparexBuilder, ctx ...context.Context) (obj *AuthorizationManage, err error) {
|
|
|
|
func BuildAuthorizationManage(p PreparexBuilder, ctx ...context.Context) (obj *AuthorizationManage, err error) {
|
|
|
|
var c context.Context
|
|
|
|
var c context.Context
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
c = ctx[0]
|
|
|
|
c = ctx[0]
|
|
|
@ -461,7 +481,7 @@ func BuildAuthorizationManage(p yesql.PreparexBuilder, ctx ...context.Context) (
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildComment(p yesql.PreparexBuilder, ctx ...context.Context) (obj *Comment, err error) {
|
|
|
|
func BuildComment(p PreparexBuilder, ctx ...context.Context) (obj *Comment, err error) {
|
|
|
|
var c context.Context
|
|
|
|
var c context.Context
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
c = ctx[0]
|
|
|
|
c = ctx[0]
|
|
|
@ -489,7 +509,7 @@ func BuildComment(p yesql.PreparexBuilder, ctx ...context.Context) (obj *Comment
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildCommentManage(p yesql.PreparexBuilder, ctx ...context.Context) (obj *CommentManage, err error) {
|
|
|
|
func BuildCommentManage(p PreparexBuilder, ctx ...context.Context) (obj *CommentManage, err error) {
|
|
|
|
var c context.Context
|
|
|
|
var c context.Context
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
c = ctx[0]
|
|
|
|
c = ctx[0]
|
|
|
@ -539,7 +559,7 @@ func BuildCommentManage(p yesql.PreparexBuilder, ctx ...context.Context) (obj *C
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildContactManager(p yesql.PreparexBuilder, ctx ...context.Context) (obj *ContactManager, err error) {
|
|
|
|
func BuildContactManager(p PreparexBuilder, ctx ...context.Context) (obj *ContactManager, err error) {
|
|
|
|
var c context.Context
|
|
|
|
var c context.Context
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
c = ctx[0]
|
|
|
|
c = ctx[0]
|
|
|
@ -586,7 +606,7 @@ func BuildContactManager(p yesql.PreparexBuilder, ctx ...context.Context) (obj *
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildFollowingManager(p yesql.PreparexBuilder, ctx ...context.Context) (obj *FollowingManager, err error) {
|
|
|
|
func BuildFollowingManager(p PreparexBuilder, ctx ...context.Context) (obj *FollowingManager, err error) {
|
|
|
|
var c context.Context
|
|
|
|
var c context.Context
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
c = ctx[0]
|
|
|
|
c = ctx[0]
|
|
|
@ -618,7 +638,7 @@ func BuildFollowingManager(p yesql.PreparexBuilder, ctx ...context.Context) (obj
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildMessage(p yesql.PreparexBuilder, ctx ...context.Context) (obj *Message, err error) {
|
|
|
|
func BuildMessage(p PreparexBuilder, ctx ...context.Context) (obj *Message, err error) {
|
|
|
|
var c context.Context
|
|
|
|
var c context.Context
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
c = ctx[0]
|
|
|
|
c = ctx[0]
|
|
|
@ -647,7 +667,7 @@ func BuildMessage(p yesql.PreparexBuilder, ctx ...context.Context) (obj *Message
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildSecurity(p yesql.PreparexBuilder, ctx ...context.Context) (obj *Security, err error) {
|
|
|
|
func BuildSecurity(p PreparexBuilder, ctx ...context.Context) (obj *Security, err error) {
|
|
|
|
var c context.Context
|
|
|
|
var c context.Context
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
c = ctx[0]
|
|
|
|
c = ctx[0]
|
|
|
@ -667,7 +687,7 @@ func BuildSecurity(p yesql.PreparexBuilder, ctx ...context.Context) (obj *Securi
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildShipIndex(p yesql.PreparexBuilder, ctx ...context.Context) (obj *ShipIndex, err error) {
|
|
|
|
func BuildShipIndex(p PreparexBuilder, ctx ...context.Context) (obj *ShipIndex, err error) {
|
|
|
|
var c context.Context
|
|
|
|
var c context.Context
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
c = ctx[0]
|
|
|
|
c = ctx[0]
|
|
|
@ -693,14 +713,14 @@ func BuildShipIndex(p yesql.PreparexBuilder, ctx ...context.Context) (obj *ShipI
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildShipIndexA(p yesql.PreparexBuilder) (obj *ShipIndexA, err error) {
|
|
|
|
func BuildShipIndexA(p PreparexBuilder) (obj *ShipIndexA, err error) {
|
|
|
|
obj = &ShipIndexA{
|
|
|
|
obj = &ShipIndexA{
|
|
|
|
UserInfo: p.QueryHook(_ShipIndexA_UserInfo),
|
|
|
|
UserInfo: p.QueryHook(_ShipIndexA_UserInfo),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildSimpleIndex(p yesql.PreparexBuilder, ctx ...context.Context) (obj *SimpleIndex, err error) {
|
|
|
|
func BuildSimpleIndex(p PreparexBuilder, ctx ...context.Context) (obj *SimpleIndex, err error) {
|
|
|
|
var c context.Context
|
|
|
|
var c context.Context
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
c = ctx[0]
|
|
|
|
c = ctx[0]
|
|
|
@ -717,14 +737,14 @@ func BuildSimpleIndex(p yesql.PreparexBuilder, ctx ...context.Context) (obj *Sim
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildSimpleIndexA(p yesql.PreparexBuilder) (obj *SimpleIndexA, err error) {
|
|
|
|
func BuildSimpleIndexA(p PreparexBuilder) (obj *SimpleIndexA, err error) {
|
|
|
|
obj = &SimpleIndexA{
|
|
|
|
obj = &SimpleIndexA{
|
|
|
|
UserInfo: p.QueryHook(_SimpleIndexA_UserInfo),
|
|
|
|
UserInfo: p.QueryHook(_SimpleIndexA_UserInfo),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildTopicA(p yesql.PreparexBuilder, ctx ...context.Context) (obj *TopicA, err error) {
|
|
|
|
func BuildTopicA(p PreparexBuilder, ctx ...context.Context) (obj *TopicA, err error) {
|
|
|
|
var c context.Context
|
|
|
|
var c context.Context
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
c = ctx[0]
|
|
|
|
c = ctx[0]
|
|
|
@ -756,7 +776,7 @@ func BuildTopicA(p yesql.PreparexBuilder, ctx ...context.Context) (obj *TopicA,
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildTweet(p yesql.PreparexBuilder, ctx ...context.Context) (obj *Tweet, err error) {
|
|
|
|
func BuildTweet(p PreparexBuilder, ctx ...context.Context) (obj *Tweet, err error) {
|
|
|
|
var c context.Context
|
|
|
|
var c context.Context
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
c = ctx[0]
|
|
|
|
c = ctx[0]
|
|
|
@ -860,7 +880,7 @@ func BuildTweet(p yesql.PreparexBuilder, ctx ...context.Context) (obj *Tweet, er
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildTweetA(p yesql.PreparexBuilder) (obj *TweetA, err error) {
|
|
|
|
func BuildTweetA(p PreparexBuilder) (obj *TweetA, err error) {
|
|
|
|
obj = &TweetA{
|
|
|
|
obj = &TweetA{
|
|
|
|
AttachmentByTweetId: p.QueryHook(_TweetA_AttachmentByTweetId),
|
|
|
|
AttachmentByTweetId: p.QueryHook(_TweetA_AttachmentByTweetId),
|
|
|
|
FavoriteByTweetId: p.QueryHook(_TweetA_FavoriteByTweetId),
|
|
|
|
FavoriteByTweetId: p.QueryHook(_TweetA_FavoriteByTweetId),
|
|
|
@ -878,7 +898,7 @@ func BuildTweetA(p yesql.PreparexBuilder) (obj *TweetA, err error) {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildTweetHelp(p yesql.PreparexBuilder) (obj *TweetHelp, err error) {
|
|
|
|
func BuildTweetHelp(p PreparexBuilder) (obj *TweetHelp, err error) {
|
|
|
|
obj = &TweetHelp{
|
|
|
|
obj = &TweetHelp{
|
|
|
|
GetPostContentByIds: p.QueryHook(_TweetHelp_GetPostContentByIds),
|
|
|
|
GetPostContentByIds: p.QueryHook(_TweetHelp_GetPostContentByIds),
|
|
|
|
GetUsersByIds: p.QueryHook(_TweetHelp_GetUsersByIds),
|
|
|
|
GetUsersByIds: p.QueryHook(_TweetHelp_GetUsersByIds),
|
|
|
@ -886,14 +906,14 @@ func BuildTweetHelp(p yesql.PreparexBuilder) (obj *TweetHelp, err error) {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildTweetHelpA(p yesql.PreparexBuilder) (obj *TweetHelpA, err error) {
|
|
|
|
func BuildTweetHelpA(p PreparexBuilder) (obj *TweetHelpA, err error) {
|
|
|
|
obj = &TweetHelpA{
|
|
|
|
obj = &TweetHelpA{
|
|
|
|
UserInfo: p.QueryHook(_TweetHelpA_UserInfo),
|
|
|
|
UserInfo: p.QueryHook(_TweetHelpA_UserInfo),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildTweetManage(p yesql.PreparexBuilder, ctx ...context.Context) (obj *TweetManage, err error) {
|
|
|
|
func BuildTweetManage(p PreparexBuilder, ctx ...context.Context) (obj *TweetManage, err error) {
|
|
|
|
var c context.Context
|
|
|
|
var c context.Context
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
c = ctx[0]
|
|
|
|
c = ctx[0]
|
|
|
@ -959,14 +979,14 @@ func BuildTweetManage(p yesql.PreparexBuilder, ctx ...context.Context) (obj *Twe
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildTweetManageA(p yesql.PreparexBuilder) (obj *TweetManageA, err error) {
|
|
|
|
func BuildTweetManageA(p PreparexBuilder) (obj *TweetManageA, err error) {
|
|
|
|
obj = &TweetManageA{
|
|
|
|
obj = &TweetManageA{
|
|
|
|
UserInfo: p.QueryHook(_TweetManageA_UserInfo),
|
|
|
|
UserInfo: p.QueryHook(_TweetManageA_UserInfo),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildUserManage(p yesql.PreparexBuilder, ctx ...context.Context) (obj *UserManage, err error) {
|
|
|
|
func BuildUserManage(p PreparexBuilder, ctx ...context.Context) (obj *UserManage, err error) {
|
|
|
|
var c context.Context
|
|
|
|
var c context.Context
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
c = ctx[0]
|
|
|
|
c = ctx[0]
|
|
|
@ -1000,7 +1020,7 @@ func BuildUserManage(p yesql.PreparexBuilder, ctx ...context.Context) (obj *User
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func BuildWallet(p yesql.PreparexBuilder, ctx ...context.Context) (obj *Wallet, err error) {
|
|
|
|
func BuildWallet(p PreparexBuilder, ctx ...context.Context) (obj *Wallet, err error) {
|
|
|
|
var c context.Context
|
|
|
|
var c context.Context
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
if len(ctx) > 0 && ctx[0] != nil {
|
|
|
|
c = ctx[0]
|
|
|
|
c = ctx[0]
|
|
|
|