Create & Init Project...

This commit is contained in:
2019-04-22 18:49:16 +08:00
commit fc4fa37393
25440 changed files with 4054998 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_test",
"go_library",
)
go_test(
name = "go_default_test",
srcs = [
"dao_test.go",
"mysql_test.go",
],
embed = [":go_default_library"],
rundir = ".",
tags = ["automanaged"],
deps = [
"//app/job/main/passport-game-data/conf:go_default_library",
"//app/job/main/passport-game-data/model:go_default_library",
"//vendor/github.com/smartystreets/goconvey/convey:go_default_library",
],
)
go_library(
name = "go_default_library",
srcs = [
"dao.go",
"mysql.go",
],
importpath = "go-common/app/job/main/passport-game-data/dao",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//app/job/main/passport-game-data/conf:go_default_library",
"//app/job/main/passport-game-data/model:go_default_library",
"//library/database/sql:go_default_library",
"//library/log:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1,48 @@
package dao
import (
"context"
"go-common/app/job/main/passport-game-data/conf"
"go-common/library/database/sql"
"go-common/library/log"
)
// Dao dao
type Dao struct {
c *conf.Config
localDB *sql.DB
cloudDB *sql.DB
}
// New new dao.
func New(c *conf.Config) (d *Dao) {
d = &Dao{
c: c,
localDB: sql.NewMySQL(c.DB.Local),
cloudDB: sql.NewMySQL(c.DB.Cloud),
}
return
}
// Ping check dao ok.
func (d *Dao) Ping(c context.Context) (err error) {
if err = d.localDB.Ping(c); err != nil {
log.Info("dao.localDB.Ping() error(%v)", err)
}
if err = d.cloudDB.Ping(c); err != nil {
log.Info("dao.cloudDB.Ping() error(%v)", err)
}
return
}
// Close close connections.
func (d *Dao) Close() (err error) {
if d.localDB != nil {
d.localDB.Close()
}
if d.cloudDB != nil {
d.cloudDB.Close()
}
return
}

View File

@@ -0,0 +1,20 @@
package dao
import (
"fmt"
"sync"
"go-common/app/job/main/passport-game-data/conf"
)
var (
once sync.Once
d *Dao
)
func startDao() {
if err := conf.Init(); err != nil {
panic(fmt.Sprintf("conf.Init() error(%v)", err))
}
d = New(conf.Conf)
}

View File

@@ -0,0 +1,240 @@
package dao
import (
"context"
"database/sql"
"fmt"
"strings"
"time"
"go-common/app/job/main/passport-game-data/model"
xsql "go-common/library/database/sql"
"go-common/library/log"
)
const (
_getAsoAccountRangeCloudSQL = "SELECT mid,userid,uname,pwd,salt,email,tel,country_id,mobile_verified,isleak,ctime,mtime FROM aso_account WHERE mtime>=? AND mtime<?"
_getAsoAccountsCloudSQL = "SELECT mid,userid,uname,pwd,salt,email,tel,country_id,mobile_verified,isleak,ctime,mtime FROM aso_account WHERE mid in(%s)"
_getRangeAsoAccountsLocalSQL = "SELECT mid,userid,uname,pwd,salt,email,tel,country_id,mobile_verified,isleak,modify_time FROM aso_account WHERE modify_time>=? AND modify_time<?"
_getAsoAccountsLocalSQL = "SELECT mid,userid,uname,pwd,salt,email,tel,country_id,mobile_verified,isleak,modify_time FROM aso_account WHERE mid in(%s)"
_updateAsoAccountCloudSQL = "UPDATE aso_account SET userid=?,uname=?,pwd=?,salt=?,email=?,tel=?,country_id=?,mobile_verified=?,isleak=? WHERE mid=? AND mtime=?"
_addIgnoreAsoAccountCloudSQL = "INSERT IGNORE INTO aso_account (mid,userid,uname,pwd,salt,email,tel,country_id,mobile_verified,isleak) VALUES(?,?,?,?,?,?,?,?,?,?)"
_addIgnoreAsoAccountsCloudSQL = "INSERT IGNORE INTO aso_account (mid,userid,uname,pwd,salt,email,tel,country_id,mobile_verified,isleak) VALUES %s"
)
// AddAsoAccountsCloud batch add aso account to cloud.
func (d *Dao) AddAsoAccountsCloud(c context.Context, vs []*model.AsoAccount) (err error) {
if len(vs) == 0 {
return
}
var args = make([]string, 0)
for _, v := range vs {
args = append(args, getValues(v))
}
s := fmt.Sprintf(_addIgnoreAsoAccountsCloudSQL, strings.Join(args, ","))
if _, err = d.cloudDB.Exec(c, s); err != nil {
log.Error("d.cloudDB.Exec(%s) error(%v)", s, err)
}
return
}
func getValues(a *model.AsoAccount) string {
email := "NULL"
tel := "NULL"
if len(a.Email) > 0 {
email = "'" + a.Email + "'"
}
if len(a.Tel) > 0 {
tel = "'" + a.Tel + "'"
}
return fmt.Sprintf(`(%d,'%s','%s','%s','%s',%s,%s,%d,%d,%d)`, a.Mid, a.UserID, a.Uname, a.Pwd, a.Salt, email, tel, a.CountryID, a.MobileVerified, a.Isleak)
}
// AsoAccountRangeCloud get aso account from cloud.
func (d *Dao) AsoAccountRangeCloud(c context.Context, st, ed time.Time) (res []*model.AsoAccount, err error) {
var rows *xsql.Rows
if rows, err = d.cloudDB.Query(c, _getAsoAccountRangeCloudSQL, st, ed); err != nil {
log.Error("get aso account range cloud, dao.cloudDB.Query(%s) error(%v)", _getAsoAccountRangeCloudSQL, err)
return
}
for rows.Next() {
a := new(model.AsoAccount)
var telPtr, emailPtr *string
if err = rows.Scan(&a.Mid, &a.UserID, &a.Uname, &a.Pwd, &a.Salt, &emailPtr, &telPtr, &a.CountryID, &a.MobileVerified, &a.Isleak, &a.Ctime, &a.Mtime); err != nil {
if err == xsql.ErrNoRows {
err = nil
res = nil
return
}
log.Error("row.Scan() error(%v)", err)
return
}
if telPtr != nil {
a.Tel = *telPtr
}
if emailPtr != nil {
a.Email = *emailPtr
}
res = append(res, a)
}
err = rows.Err()
return
}
// AsoAccountsCloud get aso accounts from cloud.
func (d *Dao) AsoAccountsCloud(c context.Context, vs []int64) (res []*model.AsoAccount, err error) {
if len(vs) == 0 {
return
}
var args = make([]string, 0, len(vs))
for _, v := range vs {
args = append(args, fmt.Sprintf(`'%d'`, v))
}
if len(args) == 0 {
return
}
s := fmt.Sprintf(_getAsoAccountsCloudSQL, strings.Join(args, ","))
var rows *xsql.Rows
if rows, err = d.cloudDB.Query(c, s); err != nil {
log.Error("get aso accounts cloud, dao.cloudDB.Query(%s) error(%v)", s, err)
return
}
for rows.Next() {
a := new(model.AsoAccount)
var telPtr, emailPtr *string
if err = rows.Scan(&a.Mid, &a.UserID, &a.Uname, &a.Pwd, &a.Salt, &emailPtr, &telPtr, &a.CountryID, &a.MobileVerified, &a.Isleak, &a.Ctime, &a.Mtime); err != nil {
if err == xsql.ErrNoRows {
err = nil
res = nil
return
}
log.Error("row.Scan() error(%v)", err)
return
}
if telPtr != nil {
a.Tel = *telPtr
}
if emailPtr != nil {
a.Email = *emailPtr
}
res = append(res, a)
}
err = rows.Err()
return
}
// AsoAccountRangeLocal get aso account from local range start and end time.
func (d *Dao) AsoAccountRangeLocal(c context.Context, st, ed time.Time) (res []*model.OriginAsoAccount, err error) {
var rows *xsql.Rows
if rows, err = d.localDB.Query(c, _getRangeAsoAccountsLocalSQL, st, ed); err != nil {
log.Error("get aso account range local, dao.localDB.Query(%s) error(%v)", _getRangeAsoAccountsLocalSQL, err)
return
}
for rows.Next() {
a := new(model.OriginAsoAccount)
var telPtr, emailPtr *string
if err = rows.Scan(&a.Mid, &a.UserID, &a.Uname, &a.Pwd, &a.Salt, &emailPtr, &telPtr, &a.CountryID, &a.MobileVerified, &a.Isleak, &a.Mtime); err != nil {
if err == xsql.ErrNoRows {
err = nil
res = nil
return
}
log.Error("row.Scan() error(%v)", err)
return
}
if telPtr != nil {
a.Tel = *telPtr
}
if emailPtr != nil {
a.Email = *emailPtr
}
res = append(res, a)
}
err = rows.Err()
return
}
// AsoAccountsLocal get aso accounts from origin.
func (d *Dao) AsoAccountsLocal(c context.Context, vs []int64) (res []*model.OriginAsoAccount, err error) {
if len(vs) == 0 {
return
}
var args = make([]string, 0, len(vs))
for _, v := range vs {
args = append(args, fmt.Sprintf(`'%d'`, v))
}
if len(args) == 0 {
return
}
s := fmt.Sprintf(_getAsoAccountsLocalSQL, strings.Join(args, ","))
var rows *xsql.Rows
if rows, err = d.localDB.Query(c, s); err != nil {
log.Error("get aso accounts local, dao.localDB.Query(%s) error(%v)", s, err)
return
}
for rows.Next() {
a := new(model.OriginAsoAccount)
var telPtr, emailPtr *string
if err = rows.Scan(&a.Mid, &a.UserID, &a.Uname, &a.Pwd, &a.Salt, &emailPtr, &telPtr, &a.CountryID, &a.MobileVerified, &a.Isleak, &a.Mtime); err != nil {
if err == xsql.ErrNoRows {
err = nil
res = nil
return
}
log.Error("row.Scan() error(%v)", err)
return
}
if telPtr != nil {
a.Tel = *telPtr
}
if emailPtr != nil {
a.Email = *emailPtr
}
res = append(res, a)
}
err = rows.Err()
return
}
// UpdateAsoAccountCloud update aso account.
func (d *Dao) UpdateAsoAccountCloud(c context.Context, a *model.AsoAccount, mt time.Time) (affected int64, err error) {
var telPtr, emailPtr *string
if a.Tel != "" {
telPtr = &a.Tel
}
if a.Email != "" {
emailPtr = &a.Email
}
var res sql.Result
if res, err = d.cloudDB.Exec(c, _updateAsoAccountCloudSQL, a.UserID, a.Uname, a.Pwd, a.Salt, emailPtr, telPtr, a.CountryID, a.MobileVerified, a.Isleak, a.Mid, mt); err != nil {
log.Error("failed to update aso account, dao.cloudDB.Exec(%s) email(%s) tel(%s) error(%v)", _updateAsoAccountCloudSQL, emailPtr, telPtr, err)
return
}
return res.RowsAffected()
}
// AddIgnoreAsoAccount add ignore aso account.
func (d *Dao) AddIgnoreAsoAccount(c context.Context, a *model.AsoAccount) (affected int64, err error) {
var res sql.Result
var telPtr, emailPtr *string
if a.Tel != "" {
telPtr = &a.Tel
}
if a.Email != "" {
emailPtr = &a.Email
}
if res, err = d.cloudDB.Exec(c, _addIgnoreAsoAccountCloudSQL, a.Mid, a.UserID, a.Uname, a.Pwd, a.Salt, emailPtr, telPtr, a.CountryID, a.MobileVerified, a.Isleak); err != nil {
log.Error("failed to add ignore aso account, dao.cloudDB.Exec(%s) email(%s) tel(%s) error(%s)", _addIgnoreAsoAccountCloudSQL, a.Email, a.Tel, err)
return
}
return res.RowsAffected()
}

View File

@@ -0,0 +1,418 @@
package dao
import (
"context"
"encoding/json"
"fmt"
"testing"
"time"
"go-common/app/job/main/passport-game-data/model"
. "github.com/smartystreets/goconvey/convey"
)
const (
_timeFormat = "2006-01-02 15:04:05"
)
var (
_loc = time.Now().Location()
)
func TestDao_AddAsoAccountsCloud(t *testing.T) {
once.Do(startDao)
Convey("batch add aso account to cloud", t, func() {
Convey("single", func() {
as := make([]*model.AsoAccount, 0)
a := &model.AsoAccount{
Mid: 12047569,
UserID: "bili_1710676855",
Uname: "Bili_12047569",
Pwd: "3686c9d96ae6896fe117319ba6c07087",
Salt: "pdMXF856",
Email: "62fe0d616162f56ecab3e12a2de83ea6",
Tel: "bdb27b0300e3984e48e7aea5c672a243",
CountryID: 1,
MobileVerified: 1,
Isleak: 0,
}
as = append(as, a)
err := d.AddAsoAccountsCloud(context.TODO(), as)
So(err, ShouldBeNil)
})
Convey("multiple", func() {
as := make([]*model.AsoAccount, 0)
a := &model.AsoAccount{
Mid: 12047569,
UserID: "bili_1710676855",
Uname: "Bili_12047569",
Pwd: "3686c9d96ae6896fe117319ba6c07087",
Salt: "pdMXF856",
Email: "62fe0d616162f56ecab3e12a2de83ea6",
Tel: "bdb27b0300e3984e48e7aea5c672a243",
CountryID: 1,
MobileVerified: 1,
Isleak: 0,
}
as = append(as, a)
as = append(as, a)
err := d.AddAsoAccountsCloud(context.TODO(), as)
So(err, ShouldBeNil)
})
})
}
func TestDao_AsoAccountRangeCloud(t *testing.T) {
once.Do(startDao)
Convey("get a aso account from cloud range start time and end time", t, func() {
Convey("when start time after end time", func() {
st, err := time.ParseInLocation(_timeFormat, "2018-01-22 12:50:41", _loc)
ed, err := time.ParseInLocation(_timeFormat, "2018-01-22 12:49:41", _loc)
So(err, ShouldBeNil)
res, err := d.AsoAccountRangeCloud(context.TODO(), st, ed)
So(err, ShouldBeNil)
So(len(res), ShouldEqual, 0)
})
Convey("when res is not empty", func() {
st, err := time.ParseInLocation(_timeFormat, "2018-01-22 12:50:41", _loc)
ed, err := time.ParseInLocation(_timeFormat, "2018-01-22 12:51:41", _loc)
So(err, ShouldBeNil)
res, err := d.AsoAccountRangeCloud(context.TODO(), st, ed)
So(err, ShouldBeNil)
So(len(res), ShouldBeGreaterThan, 0)
mid := int64(88888970)
ok := false
var target *model.AsoAccount
for _, a := range res {
if a.Mid == mid {
target = a
ok = true
break
}
}
So(ok, ShouldBeTrue)
So(target.Email, ShouldNotBeNil)
So(target.Tel, ShouldBeEmpty)
str, _ := json.Marshal(target)
t.Logf("res: %s", str)
})
})
}
func TestDao_AsoAccountRangeLocal(t *testing.T) {
once.Do(startDao)
Convey("get a aso account from local range start time and end time", t, func() {
Convey("when start time is after end time", func() {
st, err := time.ParseInLocation(_timeFormat, "2018-01-22 12:50:41", _loc)
ed, err := time.ParseInLocation(_timeFormat, "2018-01-22 12:49:41", _loc)
So(err, ShouldBeNil)
res, err := d.AsoAccountRangeLocal(context.TODO(), st, ed)
So(err, ShouldBeNil)
So(len(res), ShouldEqual, 0)
})
Convey("when res is not empty", func() {
st, err := time.ParseInLocation(_timeFormat, "2018-01-22 12:50:41", _loc)
ed, err := time.ParseInLocation(_timeFormat, "2018-01-22 12:51:41", _loc)
So(err, ShouldBeNil)
res, err := d.AsoAccountRangeLocal(context.TODO(), st, ed)
So(err, ShouldBeNil)
So(len(res), ShouldBeGreaterThan, 0)
mid := int64(88888970)
ok := false
var target *model.OriginAsoAccount
for _, a := range res {
if a.Mid == mid {
target = a
ok = true
break
}
}
So(ok, ShouldBeTrue)
So(target.Email, ShouldNotBeNil)
So(target.Tel, ShouldNotBeEmpty)
str, _ := json.Marshal(target)
t.Logf("res: %s", str)
})
})
}
func TestDao_AsoAccountsCloud(t *testing.T) {
once.Do(startDao)
Convey("get aso accounts from cloud", t, func() {
Convey("when res is empty", func() {
res, err := d.AsoAccountsCloud(context.TODO(), []int64{10000000000})
So(err, ShouldBeNil)
So(len(res), ShouldEqual, 0)
})
Convey("when res has single item", func() {
mids := []int64{88888970}
res, err := d.AsoAccountsCloud(context.TODO(), mids)
So(err, ShouldBeNil)
So(len(res), ShouldEqual, 1)
m := make(map[int64]*model.AsoAccount)
for _, a := range res {
m[a.Mid] = a
}
for _, mid := range mids {
a, ok := m[mid]
So(ok, ShouldBeTrue)
So(a.Email, ShouldBeEmpty)
So(a.Tel, ShouldNotBeEmpty)
str, _ := json.Marshal(a)
t.Logf("a: %s", str)
}
})
Convey("when res has multiple items", func() {
mids := []int64{88888970, 110000784}
res, err := d.AsoAccountsCloud(context.TODO(), mids)
So(err, ShouldBeNil)
So(len(res), ShouldEqual, 2)
m := make(map[int64]*model.AsoAccount)
for _, a := range res {
m[a.Mid] = a
}
for _, mid := range mids {
a, ok := m[mid]
So(ok, ShouldBeTrue)
So(a.Email, ShouldBeEmpty)
So(a.Tel, ShouldNotBeEmpty)
str, _ := json.Marshal(a)
t.Logf("a: %s", str)
}
})
})
}
func TestDao_AsoAccountsLocal(t *testing.T) {
once.Do(startDao)
Convey("get aso accounts from local", t, func() {
Convey("when res is empty", func() {
res, err := d.AsoAccountsCloud(context.TODO(), []int64{10000000000})
So(err, ShouldBeNil)
So(len(res), ShouldEqual, 0)
})
Convey("when res has single item", func() {
mids := []int64{88888970}
res, err := d.AsoAccountsCloud(context.TODO(), mids)
So(err, ShouldBeNil)
So(len(res), ShouldEqual, 1)
m := make(map[int64]*model.AsoAccount)
for _, a := range res {
m[a.Mid] = a
}
for _, mid := range mids {
a, ok := m[mid]
So(ok, ShouldBeTrue)
So(a.Email, ShouldNotBeNil)
So(a.Tel, ShouldBeEmpty)
str, _ := json.Marshal(a)
t.Logf("a: %s", str)
}
})
Convey("when res has multiple items", func() {
mids := []int64{88888970, 110000784}
res, err := d.AsoAccountsCloud(context.TODO(), mids)
So(err, ShouldBeNil)
So(len(res), ShouldEqual, 2)
m := make(map[int64]*model.AsoAccount)
for _, a := range res {
m[a.Mid] = a
}
for _, mid := range mids {
a, ok := m[mid]
So(ok, ShouldBeTrue)
So(a.Email, ShouldNotBeNil)
So(a.Tel, ShouldBeEmpty)
str, _ := json.Marshal(a)
t.Logf("a: %s", str)
}
})
})
}
func TestDao_UpdateAsoAccountCloud(t *testing.T) {
once.Do(startDao)
Convey("update aso account", t, func() {
Convey("when mtime matches", func() {
mid := int64(12047569)
as, err := d.AsoAccountsCloud(context.TODO(), []int64{mid})
So(err, ShouldBeNil)
So(len(as), ShouldEqual, 1)
account := as[0]
account.MobileVerified = 1 - account.MobileVerified
affected, err := d.UpdateAsoAccountCloud(context.TODO(), account, account.Mtime)
So(err, ShouldBeNil)
So(affected, ShouldEqual, 1)
})
Convey("when mtime not matches", func() {
mid := int64(12047569)
as, err := d.AsoAccountsCloud(context.TODO(), []int64{mid})
So(err, ShouldBeNil)
So(len(as), ShouldEqual, 1)
account := as[0]
account.MobileVerified = 1 - account.MobileVerified
affected, err := d.UpdateAsoAccountCloud(context.TODO(), account, time.Now())
So(err, ShouldBeNil)
So(affected, ShouldEqual, 0)
})
})
}
func TestDao_AddIgnoreAsoAccount(t *testing.T) {
once.Do(startDao)
Convey("add ignore a aso account when not exist", t, func() {
//Convey("when not exists", func() {
// account := &model.AsoAccount{
// Mid: 12047569,
// UserID: "bili_1710676855",
// Uname: "Bili_12047569",
// Pwd: "3686c9d96ae6896fe117319ba6c07087",
// Salt: "pdMXF856",
// Email: "62fe0d616162f56ecab3e12a2de83ea6",
// Tel: "bdb27b0300e3984e48e7aea5c672a243",
// CountryID: 1,
// MobileVerified: 1,
// Isleak: 0,
// }
// affected, err := d.AddIgnoreAsoAccount(context.TODO(), account)
// So(err, ShouldBeNil)
// So(affected, ShouldEqual, 1)
//})
Convey("when not exists", func() {
account := &model.AsoAccount{
Mid: 12047569,
UserID: "bili_1710676855",
Uname: "Bili_12047569",
Pwd: "3686c9d96ae6896fe117319ba6c07087",
Salt: "pdMXF856",
Email: "62fe0d616162f56ecab3e12a2de83ea6",
Tel: "bdb27b0300e3984e48e7aea5c672a243",
CountryID: 1,
MobileVerified: 1,
Isleak: 0,
}
affected, err := d.AddIgnoreAsoAccount(context.TODO(), account)
So(err, ShouldBeNil)
So(affected, ShouldEqual, 0)
})
})
}
const (
_pattern = "INSERT INTO aso_account (mid,userid,uname,pwd,salt,email,tel,country_id,mobile_verified,isleak) VALUES(%d,'%s','%s','%s','%s',%s,%s,%d,%d,%d) ON DUPLICATE KEY UPDATE userid='%s',uname='%s',pwd='%s',salt='%s',email=%s,tel=%s,country_id=%d,mobile_verified=%d,isleak=%d;"
)
func TestDao_AddAsoAccount(t *testing.T) {
oldStr := `{
"mid": 255554277,
"userid": "bili_93079136999",
"uname": "白又寻",
"pwd": "8489c2cbddb7ee1438698a4f21ee1d78",
"salt": "r0MHcs5M",
"email": "",
"tel": "ca6d0469ca340f67f4635425dcd11581",
"country_id": 1,
"mobile_verified": 2,
"isleak": 0,
"ctime": "2017-11-25T12:03:38+08:00",
"mtime": "2017-12-04T14:19:59+08:00"
}`
old := new(model.AsoAccount)
err := json.Unmarshal([]byte(oldStr), &old)
if err != nil {
t.Error(err)
t.FailNow()
}
sql := getSQL(old)
t.Logf("sql: %s", sql)
afterStr := `{
"mid": 255554277,
"userid": "bili_93079136999",
"uname": "白又寻",
"pwd": "5f064b2ddb4d8cd5f9e01507ab1d34c6",
"salt": "ggr58PEs",
"email": "",
"tel": "ca6d0469ca340f67f4635425dcd11581",
"country_id": 1,
"mobile_verified": 2,
"isleak": 0,
"ctime": "0001-01-01T00:00:00Z",
"mtime": "2017-11-25T19:14:20+08:00"
}`
after := new(model.AsoAccount)
err = json.Unmarshal([]byte(afterStr), &after)
if err != nil {
t.Error(err)
t.FailNow()
}
afterSQL := getSQL(after)
t.Logf("after sql: %s", afterSQL)
}
func getSQL(a *model.AsoAccount) string {
email := "NULL"
tel := "NULL"
if len(a.Email) > 0 {
email = "'" + a.Email + "'"
}
if len(a.Tel) > 0 {
tel = "'" + a.Tel + "'"
}
return fmt.Sprintf(_pattern, a.Mid, a.UserID, a.Uname, a.Pwd, a.Salt, email, tel, a.CountryID, a.MobileVerified, a.Isleak, a.UserID, a.Uname, a.Pwd, a.Salt, email, tel, a.CountryID, a.MobileVerified, a.Isleak)
}