Documentation ¶
Index ¶
- type Journey
- type JourneyImpl
- func (db *JourneyImpl) AddCustomer(ctx context.Context, c model.Customer) (sql.Result, error)
- func (db *JourneyImpl) AddTicket(ctx context.Context, t *another_model.Ticket) (sql.Result, error)
- func (db *JourneyImpl) Begin(ctx context.Context, options *sql.TxOptions) *TxJourneyImpl
- func (db *JourneyImpl) DeleteCustomerByEmail(ctx context.Context, x map[string]interface{}) (sql.Result, error)
- func (db *JourneyImpl) DeleteCustomerByEmailOrIDList(ctx context.Context, x map[string]interface{}) (sql.Result, error)
- func (db *JourneyImpl) DeleteCustomerByID(ctx context.Context, ID uint64) (sql.Result, error)
- func (db *JourneyImpl) DeleteCustomerByIDList(ctx context.Context, IDList []uint64) (sql.Result, error)
- func (db *JourneyImpl) GetCustomerByID(ctx context.Context, ID uint64) (model.Customer, error)
- func (db *JourneyImpl) GetCustomerEmailsByName(ctx context.Context, name string) ([]string, error)
- func (db *JourneyImpl) GetCustomerNameByEmail(ctx context.Context, email string) (string, error)
- func (db *JourneyImpl) GetCustomersByNameAndEmail(ctx context.Context, name, email string, offset, limit uint64) ([]model.Customer, error)
- func (db *JourneyImpl) GetFirstFreeTicket(ctx context.Context) (*another_model.Ticket, error)
- func (db *JourneyImpl) GetTicketByID(ctx context.Context, ID uint64) (*another_model.Ticket, error)
- func (db *JourneyImpl) GetTicketGreaterThanPrice(ctx context.Context, payload *another_model.Ticket) (another_model.Ticket, error)
- func (db *JourneyImpl) GetTicketWhichTokenIsNotEqualTo(ctx context.Context, payload map[string]interface{}) (*another_model.Ticket, error)
- func (db *JourneyImpl) GetTicketsByCustomerID(ctx context.Context, customerID uint64) ([]*another_model.Ticket, error)
- func (db *JourneyImpl) GetTicketsByFrom(ctx context.Context, payload another_model.Ticket) ([]*another_model.Ticket, error)
- func (db *JourneyImpl) GetTicketsByIDListAndPrice(ctx context.Context, IDList []uint64, price float64) ([]*another_model.Ticket, error)
- func (db *JourneyImpl) GetTicketsByOffset(ctx context.Context, payload *another_model.Ticket) ([]*another_model.Ticket, error)
- func (db *JourneyImpl) GetTicketsLikeTea(ctx context.Context, payload map[string]interface{}) ([]another_model.Ticket, error)
- func (db *JourneyImpl) UpdateCustomerMemberIDByID(ctx context.Context, c *model.Customer) (sql.Result, error)
- func (db *JourneyImpl) UpdateCustomerMemberIDByIDList(ctx context.Context, c *model.Customer) (sql.Result, error)
- func (db *JourneyImpl) UpdateCustomerNameByEmail(ctx context.Context, name, email string) (sql.Result, error)
- func (db *JourneyImpl) UpdateCustomerNameByIDList(ctx context.Context, name string, idList []uint64) (sql.Result, error)
- type TxJourneyImpl
- func (tx *TxJourneyImpl) AddCustomer(ctx context.Context, c model.Customer) (sql.Result, error)
- func (tx *TxJourneyImpl) AddTicket(ctx context.Context, t *another_model.Ticket) (sql.Result, error)
- func (tx *TxJourneyImpl) Commit(ctx context.Context) error
- func (tx *TxJourneyImpl) DeleteCustomerByEmail(ctx context.Context, x map[string]interface{}) (sql.Result, error)
- func (tx *TxJourneyImpl) DeleteCustomerByEmailOrIDList(ctx context.Context, x map[string]interface{}) (sql.Result, error)
- func (tx *TxJourneyImpl) DeleteCustomerByID(ctx context.Context, ID uint64) (sql.Result, error)
- func (tx *TxJourneyImpl) DeleteCustomerByIDList(ctx context.Context, IDList []uint64) (sql.Result, error)
- func (tx *TxJourneyImpl) GetCustomerByID(ctx context.Context, ID uint64) (model.Customer, error)
- func (tx *TxJourneyImpl) GetCustomerEmailsByName(ctx context.Context, name string) ([]string, error)
- func (tx *TxJourneyImpl) GetCustomerNameByEmail(ctx context.Context, email string) (string, error)
- func (tx *TxJourneyImpl) GetCustomersByNameAndEmail(ctx context.Context, name, email string, offset, limit uint64) ([]model.Customer, error)
- func (tx *TxJourneyImpl) GetFirstFreeTicket(ctx context.Context) (*another_model.Ticket, error)
- func (tx *TxJourneyImpl) GetTicketByID(ctx context.Context, ID uint64) (*another_model.Ticket, error)
- func (tx *TxJourneyImpl) GetTicketGreaterThanPrice(ctx context.Context, payload *another_model.Ticket) (another_model.Ticket, error)
- func (tx *TxJourneyImpl) GetTicketWhichTokenIsNotEqualTo(ctx context.Context, payload map[string]interface{}) (*another_model.Ticket, error)
- func (tx *TxJourneyImpl) GetTicketsByCustomerID(ctx context.Context, customerID uint64) ([]*another_model.Ticket, error)
- func (tx *TxJourneyImpl) GetTicketsByFrom(ctx context.Context, payload another_model.Ticket) ([]*another_model.Ticket, error)
- func (tx *TxJourneyImpl) GetTicketsByIDListAndPrice(ctx context.Context, IDList []uint64, price float64) ([]*another_model.Ticket, error)
- func (tx *TxJourneyImpl) GetTicketsByOffset(ctx context.Context, payload *another_model.Ticket) ([]*another_model.Ticket, error)
- func (tx *TxJourneyImpl) GetTicketsLikeTea(ctx context.Context, payload map[string]interface{}) ([]another_model.Ticket, error)
- func (tx *TxJourneyImpl) Rollback(ctx context.Context) error
- func (tx *TxJourneyImpl) UpdateCustomerMemberIDByID(ctx context.Context, c *model.Customer) (sql.Result, error)
- func (tx *TxJourneyImpl) UpdateCustomerMemberIDByIDList(ctx context.Context, c *model.Customer) (sql.Result, error)
- func (tx *TxJourneyImpl) UpdateCustomerNameByEmail(ctx context.Context, name, email string) (sql.Result, error)
- func (tx *TxJourneyImpl) UpdateCustomerNameByIDList(ctx context.Context, name string, idList []uint64) (sql.Result, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Journey ¶
type Journey interface { // @Insert() AddCustomer(ctx context.Context, c model.Customer) (sql.Result, error) // @Insert( ) AddTicket(ctx context.Context, t *another_model.Ticket) (sql.Result, error) // @Update("UPDATE customer SET name = ? WHERE email = ?") UpdateCustomerNameByEmail(ctx context.Context, name, email string) (sql.Result, error) // @Update("UPDATE customer SET name = ? WHERE id in (?)") UpdateCustomerNameByIDList(ctx context.Context, name string, idList []uint64) (sql.Result, error) // @Delete("DELETE FROM customer WHERE id = ?") DeleteCustomerByID(ctx context.Context, ID uint64) (sql.Result, error) // @Delete("DELETE FROM customer WHERE id In (?)") DeleteCustomerByIDList(ctx context.Context, IDList []uint64) (sql.Result, error) // @Select("SELECT * FROM customer WHERE id = ?") GetCustomerByID(ctx context.Context, ID uint64) (model.Customer, error) /* @Select( "SELECT * FROM ticket WHERE id = ?" ) */ GetTicketByID(ctx context.Context, ID uint64) (*another_model.Ticket, error) /* @Select("SELECT * FROM ticket WHERE customer_id = ? ORDER BY id DESC LIMIT 10") */ GetTicketsByCustomerID(ctx context.Context, customerID uint64) ([]*another_model.Ticket, error) /* @Select("SELECT * FROM customer WHERE name = ? AND email = ? LIMIT ?, ?") */ GetCustomersByNameAndEmail(ctx context.Context, name, email string, offset, limit uint64) ([]model.Customer, error) // @Select("SELECT `email` FROM customer WHERE name = ? LIMIT 0, 3") GetCustomerEmailsByName(ctx context.Context, name string) ([]string, error) // @Select("SELECT name FROM `customer` WHERE email = ? LIMIT 1") GetCustomerNameByEmail(ctx context.Context, email string) (string, error) // @Select("SELECT * FROM ticket WHERE id IN (1, 2) AND price = 0 limit 1") GetFirstFreeTicket(ctx context.Context) (*another_model.Ticket, error) // @Select("SELECT * FROM ticket WHERE id IN (?) AND `price` > ? LIMIT 12") GetTicketsByIDListAndPrice(ctx context.Context, IDList []uint64, price float64) ([]*another_model.Ticket, error) // @Select("SELECT * FROM ticket WHERE tea like :tea AND id IN (:idList) limit :limit") GetTicketsLikeTea(ctx context.Context, payload map[string]interface{}) ([]another_model.Ticket, error) // @Select("SELECT * FROM ticket WHERE id in (1, 2, 3, 4, 5) limit :customer_id, 2") GetTicketsByOffset(ctx context.Context, payload *another_model.Ticket) ([]*another_model.Ticket, error) // @Select("SELECT * FROM ticket WHERE `from`=:from limit 2, :customer_id") GetTicketsByFrom(ctx context.Context, payload another_model.Ticket) ([]*another_model.Ticket, error) // @Select("SELECT * FROM ticket WHERE token!= :order AND id IN (:from) AND price > 0 limit 2, :limit") GetTicketWhichTokenIsNotEqualTo(ctx context.Context, payload map[string]interface{}) (*another_model.Ticket, error) // @Select("SELECT * FROM ticket WHERE price>:price AND id in (1, 2)") GetTicketGreaterThanPrice(ctx context.Context, payload *another_model.Ticket) (another_model.Ticket, error) // @Update("Update customer sET member_id= :member_id WHERE id = 1") UpdateCustomerMemberIDByID(ctx context.Context, c *model.Customer) (sql.Result, error) // @Update("Update customer sET member_id= :member_id WHERE id in (1, 2)") UpdateCustomerMemberIDByIDList(ctx context.Context, c *model.Customer) (sql.Result, error) // @Delete("Delete FroM customer where email= :email") DeleteCustomerByEmail(ctx context.Context, x map[string]interface{}) (sql.Result, error) // @Delete("Delete FroM customer where email= :email oR id In (:id_list)") DeleteCustomerByEmailOrIDList(ctx context.Context, x map[string]interface{}) (sql.Result, error) }
type JourneyImpl ¶
func NewJourney ¶
func NewJourney(db *sqlx.DB) *JourneyImpl
func (*JourneyImpl) AddCustomer ¶
func (*JourneyImpl) AddTicket ¶
func (db *JourneyImpl) AddTicket(ctx context.Context, t *another_model.Ticket) (sql.Result, error)
func (*JourneyImpl) Begin ¶
func (db *JourneyImpl) Begin(ctx context.Context, options *sql.TxOptions) *TxJourneyImpl
func (*JourneyImpl) DeleteCustomerByEmail ¶
func (*JourneyImpl) DeleteCustomerByEmailOrIDList ¶
func (*JourneyImpl) DeleteCustomerByID ¶
func (*JourneyImpl) DeleteCustomerByIDList ¶
func (*JourneyImpl) GetCustomerByID ¶
func (*JourneyImpl) GetCustomerEmailsByName ¶
func (*JourneyImpl) GetCustomerNameByEmail ¶
func (*JourneyImpl) GetCustomersByNameAndEmail ¶
func (*JourneyImpl) GetFirstFreeTicket ¶
func (db *JourneyImpl) GetFirstFreeTicket(ctx context.Context) (*another_model.Ticket, error)
func (*JourneyImpl) GetTicketByID ¶
func (db *JourneyImpl) GetTicketByID(ctx context.Context, ID uint64) (*another_model.Ticket, error)
func (*JourneyImpl) GetTicketGreaterThanPrice ¶
func (db *JourneyImpl) GetTicketGreaterThanPrice(ctx context.Context, payload *another_model.Ticket) (another_model.Ticket, error)
func (*JourneyImpl) GetTicketWhichTokenIsNotEqualTo ¶
func (db *JourneyImpl) GetTicketWhichTokenIsNotEqualTo(ctx context.Context, payload map[string]interface{}) (*another_model.Ticket, error)
func (*JourneyImpl) GetTicketsByCustomerID ¶
func (db *JourneyImpl) GetTicketsByCustomerID(ctx context.Context, customerID uint64) ([]*another_model.Ticket, error)
func (*JourneyImpl) GetTicketsByFrom ¶
func (db *JourneyImpl) GetTicketsByFrom(ctx context.Context, payload another_model.Ticket) ([]*another_model.Ticket, error)
func (*JourneyImpl) GetTicketsByIDListAndPrice ¶
func (db *JourneyImpl) GetTicketsByIDListAndPrice(ctx context.Context, IDList []uint64, price float64) ([]*another_model.Ticket, error)
func (*JourneyImpl) GetTicketsByOffset ¶
func (db *JourneyImpl) GetTicketsByOffset(ctx context.Context, payload *another_model.Ticket) ([]*another_model.Ticket, error)
func (*JourneyImpl) GetTicketsLikeTea ¶
func (db *JourneyImpl) GetTicketsLikeTea(ctx context.Context, payload map[string]interface{}) ([]another_model.Ticket, error)
func (*JourneyImpl) UpdateCustomerMemberIDByID ¶
func (*JourneyImpl) UpdateCustomerMemberIDByIDList ¶
func (*JourneyImpl) UpdateCustomerNameByEmail ¶
func (*JourneyImpl) UpdateCustomerNameByIDList ¶
type TxJourneyImpl ¶
func (*TxJourneyImpl) AddCustomer ¶
func (*TxJourneyImpl) AddTicket ¶
func (tx *TxJourneyImpl) AddTicket(ctx context.Context, t *another_model.Ticket) (sql.Result, error)
func (*TxJourneyImpl) DeleteCustomerByEmail ¶
func (*TxJourneyImpl) DeleteCustomerByEmailOrIDList ¶
func (*TxJourneyImpl) DeleteCustomerByID ¶
func (*TxJourneyImpl) DeleteCustomerByIDList ¶
func (*TxJourneyImpl) GetCustomerByID ¶
func (*TxJourneyImpl) GetCustomerEmailsByName ¶
func (*TxJourneyImpl) GetCustomerNameByEmail ¶
func (*TxJourneyImpl) GetCustomersByNameAndEmail ¶
func (*TxJourneyImpl) GetFirstFreeTicket ¶
func (tx *TxJourneyImpl) GetFirstFreeTicket(ctx context.Context) (*another_model.Ticket, error)
func (*TxJourneyImpl) GetTicketByID ¶
func (tx *TxJourneyImpl) GetTicketByID(ctx context.Context, ID uint64) (*another_model.Ticket, error)
func (*TxJourneyImpl) GetTicketGreaterThanPrice ¶
func (tx *TxJourneyImpl) GetTicketGreaterThanPrice(ctx context.Context, payload *another_model.Ticket) (another_model.Ticket, error)
func (*TxJourneyImpl) GetTicketWhichTokenIsNotEqualTo ¶
func (tx *TxJourneyImpl) GetTicketWhichTokenIsNotEqualTo(ctx context.Context, payload map[string]interface{}) (*another_model.Ticket, error)
func (*TxJourneyImpl) GetTicketsByCustomerID ¶
func (tx *TxJourneyImpl) GetTicketsByCustomerID(ctx context.Context, customerID uint64) ([]*another_model.Ticket, error)
func (*TxJourneyImpl) GetTicketsByFrom ¶
func (tx *TxJourneyImpl) GetTicketsByFrom(ctx context.Context, payload another_model.Ticket) ([]*another_model.Ticket, error)
func (*TxJourneyImpl) GetTicketsByIDListAndPrice ¶
func (tx *TxJourneyImpl) GetTicketsByIDListAndPrice(ctx context.Context, IDList []uint64, price float64) ([]*another_model.Ticket, error)
func (*TxJourneyImpl) GetTicketsByOffset ¶
func (tx *TxJourneyImpl) GetTicketsByOffset(ctx context.Context, payload *another_model.Ticket) ([]*another_model.Ticket, error)
func (*TxJourneyImpl) GetTicketsLikeTea ¶
func (tx *TxJourneyImpl) GetTicketsLikeTea(ctx context.Context, payload map[string]interface{}) ([]another_model.Ticket, error)
func (*TxJourneyImpl) UpdateCustomerMemberIDByID ¶
func (*TxJourneyImpl) UpdateCustomerMemberIDByIDList ¶
func (*TxJourneyImpl) UpdateCustomerNameByEmail ¶
func (*TxJourneyImpl) UpdateCustomerNameByIDList ¶
Click to show internal directories.
Click to hide internal directories.