123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- package dps
- import (
- "git.sxidc.com/service-supports/dps-sdk/client"
- "git.sxidc.com/service-supports/fslog"
- )
- func Insert(req *client.InsertRequest, tx client.Transaction) error {
- var statement string
- var err error
- if tx == nil {
- statement, err = dpsClient.Insert(req)
- } else {
- statement, err = tx.InsertTx(req)
- }
- if err != nil {
- return err
- }
- fslog.Info(statement)
- return nil
- }
- func InsertBatch(req *client.InsertBatchRequest, tx client.Transaction) error {
- var statement string
- var err error
- if tx == nil {
- statement, err = dpsClient.InsertBatch(req)
- } else {
- statement, err = tx.InsertBatchTx(req)
- }
- if err != nil {
- return err
- }
- fslog.Info(statement)
- return nil
- }
- func Delete(req *client.DeleteRequest, tx client.Transaction) error {
- var statement string
- var err error
- if tx == nil {
- statement, err = dpsClient.Delete(req)
- } else {
- statement, err = tx.DeleteTx(req)
- }
- if err != nil {
- return err
- }
- fslog.Info(statement)
- return nil
- }
- func DeleteWhere(req *client.DeleteWhereRequest, tx client.Transaction) error {
- var statement string
- var err error
- if tx == nil {
- statement, err = dpsClient.DeleteWhere(req)
- } else {
- statement, err = tx.DeleteWhereTx(req)
- }
- if err != nil {
- return err
- }
- fslog.Info(statement)
- return nil
- }
- func Update(req *client.UpdateRequest, tx client.Transaction) error {
- var statement string
- var err error
- if tx == nil {
- statement, err = dpsClient.Update(req)
- } else {
- statement, err = tx.UpdateTx(req)
- }
- if err != nil {
- return err
- }
- fslog.Info(statement)
- return nil
- }
- func UpdateWhere(req *client.UpdateWhereRequest, tx client.Transaction) error {
- var statement string
- var err error
- if tx == nil {
- statement, err = dpsClient.UpdateWhere(req)
- } else {
- statement, err = tx.UpdateWhereTx(req)
- }
- if err != nil {
- return err
- }
- fslog.Info(statement)
- return nil
- }
- func Replay(req *client.ReplayRequest) error {
- var statement string
- var err error
- statement, err = dpsClient.Replay(req)
- if err != nil {
- return err
- }
- fslog.Info(statement)
- return nil
- }
|