| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374 |
- package dao
- import (
- "runtime/debug"
- "bet24.com/database"
- "bet24.com/log"
- )
- // 平台信息列表
- type (
- platformInfoList_in struct {
- PartnerID int //渠道ID
- }
- platformInfo struct {
- PartnerID int //合作商ID
- Version string //版本
- Download string //下载
- }
- platformInfoList_out struct {
- RecordCount int //记录数
- List []platformInfo
- }
- platformInfoList struct {
- database.Trans_base
- In platformInfoList_in
- Out platformInfoList_out
- }
- )
- func NewPlatformInfoList() *platformInfoList {
- return &platformInfoList{}
- }
- func (this *platformInfoList) DoAction(ch chan<- interface{}) {
- defer func() {
- if err := recover(); err != nil {
- log.Release("transaction recover fail %v", err)
- log.Release("%s", debug.Stack())
- }
- if ch != nil {
- ch <- this
- }
- }()
- statement := database.NewStatement()
- statement.SetNeedReturnValue(false)
- statement.SetOpenRecordSet(true)
- statement.SetProcName("Manage_PlatformInfo_GetList")
- statement.AddParamter("@PartnerID", database.AdParamInput, database.AdInteger, 4, this.In.PartnerID)
- sqlstring := statement.GenSql()
- retRows := CenterDB.ExecSql(sqlstring)
- rowLen := len(retRows)
- if rowLen <= 0 {
- this.State = false
- return
- }
- this.State = true
- this.Out.List = make([]platformInfo, rowLen)
- for i := 0; i < rowLen; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.PartnerID = int((*ret[0].(*interface{})).(int64))
- out.Version = (*ret[1].(*interface{})).(string)
- out.Download = (*ret[2].(*interface{})).(string)
- }
- }
- // 平台信息修改
- type (
- platformInfoUp_in struct {
- OpUserID int //操作员ID
- OpUserName string //操作员名称
- PartnerID int //渠道ID
- Version string //本版
- IpAddress string //IP地址
- Download string //下注地址
- }
- platformInfoUp_out struct {
- RetCode int //操作结果
- ErrorMsg string //操作描述
- }
- platformInfoUp struct {
- database.Trans_base
- In platformInfoUp_in
- Out platformInfoUp_out
- }
- )
- func NewPlatformInfoUp() *platformInfoUp {
- return &platformInfoUp{}
- }
- func (this *platformInfoUp) DoAction(ch chan<- interface{}) {
- defer func() {
- if err := recover(); err != nil {
- log.Release("transaction recover fail %v", err)
- log.Release("%s", debug.Stack())
- }
- if ch != nil {
- ch <- this
- }
- }()
- statement := database.NewStatement()
- statement.SetNeedReturnValue(false)
- statement.SetOpenRecordSet(true)
- statement.SetProcName("Manage_PlatformInfo_Update")
- statement.AddParamter("@OpUserID", database.AdParamInput, database.AdInteger, 4, this.In.OpUserID)
- statement.AddParamter("@OpUserName", database.AdParamInput, database.AdVarChar, 32, this.In.OpUserName)
- statement.AddParamter("@PartnerID", database.AdParamInput, database.AdInteger, 4, this.In.PartnerID)
- statement.AddParamter("@Version", database.AdParamInput, database.AdVarChar, 16, this.In.Version)
- statement.AddParamter("@IPAddress", database.AdParamInput, database.AdVarChar, 16, this.In.IpAddress)
- statement.AddParamter("@Download", database.AdParamInput, database.AdVarChar, 128, this.In.Download)
- sqlstring := statement.GenSql()
- retRows := CenterDB.ExecSql(sqlstring)
- rowLen := len(retRows)
- if rowLen <= 0 {
- this.State = false
- return
- }
- this.Out.RetCode = 1
- }
- // 平台配置信息
- type (
- platformConfig_out struct {
- RegGoldSend int // 注册赠送金币
- DailyTransferAmount int // 日转账限额
- BindFacebook int // 绑定Facebook
- BindMobile int // 绑定手机号
- IsCouponTask int // 是否开启红包券任务
- UpgradeAPK int // 升级APK
- SurchargeRate int // 提现手续费比率
- FreeSurchargeTimes int // 免手续费提取次数
- TotalAmount int // 可提取总金额
- DailyNoAuditAmount int // 日无审核提现金额
- DailyNoAuditTimes int // 日无审核提现次数
- DailyMaxTimes int // 日最多提现次数
- MinWithdrawAmount int // 提现最小金额
- }
- platformConfig struct {
- database.Trans_base
- Out platformConfig_out
- }
- )
- func NewPlatformConfig() *platformConfig {
- return &platformConfig{}
- }
- func (this *platformConfig) DoAction(ch chan<- interface{}) {
- defer func() {
- if err := recover(); err != nil {
- log.Error("transaction recover err %v", err)
- log.Error("%s", debug.Stack())
- }
- if ch != nil {
- ch <- this
- }
- }()
- statement := database.NewStatement()
- statement.SetNeedReturnValue(false)
- statement.SetOpenRecordSet(true)
- statement.SetProcName("Manage_PlatformConfig_GetInfo")
- sqlstring := statement.GenSql()
- retRows := CenterDB.ExecSql(sqlstring)
- if len(retRows) <= 0 {
- this.State = false
- return
- }
- this.State = true
- ret := retRows[0]
- this.Out.RegGoldSend = int((*ret[0].(*interface{})).(int64))
- this.Out.DailyTransferAmount = int((*ret[1].(*interface{})).(int64))
- this.Out.BindFacebook = int((*ret[2].(*interface{})).(int64))
- this.Out.BindMobile = int((*ret[3].(*interface{})).(int64))
- this.Out.UpgradeAPK = int((*ret[4].(*interface{})).(int64))
- this.Out.IsCouponTask = int((*ret[5].(*interface{})).(int64))
- }
- // 修改平台配置
- type (
- platformConfigUp_in struct {
- OpUserID int // 操作员ID
- OpUserName string // 操作员名称
- RegGoldSend int // 注册赠送金币
- DailyTransferAmount int // 日转账限额
- BindFacebook int // 绑定Facebook
- BindMobile int // 绑定手机号
- UpgradeAPK int // 升级APK
- IpAddress string
- }
- platformConfigUp_out struct {
- RetCode int
- ErrorMsg string
- }
- platformConfigUp struct {
- database.Trans_base
- In platformConfigUp_in
- Out platformConfigUp_out
- }
- )
- func NewPlatformConfigUp() *platformConfigUp {
- return &platformConfigUp{}
- }
- func (this *platformConfigUp) DoAction(ch chan<- interface{}) {
- defer func() {
- if err := recover(); err != nil {
- log.Error("transaction recover err %v", err)
- log.Error("%s", debug.Stack())
- }
- if ch != nil {
- ch <- this
- }
- }()
- statement := database.NewStatement()
- statement.SetNeedReturnValue(false)
- statement.SetOpenRecordSet(true)
- statement.SetProcName("Manage_PlatformConfig_Update")
- statement.AddParamter("@OpUserID", database.AdParamInput, database.AdInteger, 4, this.In.OpUserID)
- statement.AddParamter("@OpUserName", database.AdParamInput, database.AdVarChar, 32, this.In.OpUserName)
- statement.AddParamter("@RegGoldSend", database.AdParamInput, database.AdInteger, 4, this.In.RegGoldSend)
- statement.AddParamter("@DailyTransferAmount", database.AdParamInput, database.AdInteger, 4, this.In.DailyTransferAmount)
- statement.AddParamter("@BindFacebook", database.AdParamInput, database.AdInteger, 4, this.In.BindFacebook)
- statement.AddParamter("@BindMobile", database.AdParamInput, database.AdInteger, 4, this.In.BindMobile)
- statement.AddParamter("@UpgradeAPK", database.AdParamInput, database.AdInteger, 4, this.In.UpgradeAPK)
- statement.AddParamter("@IPAddress", database.AdParamInput, database.AdVarChar, 16, this.In.IpAddress)
- statement.AddParamter("@RetCode", database.AdParamOutput, database.AdInteger, 4, this.Out.RetCode)
- sqlstring := statement.GenSql()
- retRows := CenterDB.ExecSql(sqlstring)
- if len(retRows) <= 0 {
- this.State = false
- return
- }
- this.State = true
- this.Out.RetCode = int((*retRows[0][0].(*interface{})).(int64))
- if this.Out.RetCode == 1 {
- this.Out.ErrorMsg = "修改配置成功"
- } else {
- this.Out.ErrorMsg = "修改配置失败"
- }
- }
- // 添加平台配置log操作记录
- type (
- addLog_in struct {
- OpUserID int // 管理员用户ID(AdminUserID)
- OpUserName string // 管理员名称(AdminUserName)
- Memo string // 管理员备注(Memo)
- IPAddress string // IP地址(IPAddress)
- KeyName string // 配置的key
- Eq int // 修改的下标位置(Eq)
- }
- platformConfigLog struct {
- database.Trans_base
- In addLog_in
- }
- )
- func NewPlatformConfigLog() *platformConfigLog {
- return &platformConfigLog{}
- }
- func (this *platformConfigLog) DoAction(ch chan<- interface{}) {
- defer func() {
- if err := recover(); err != nil {
- log.Error("PlatformConfig.addLog transaction recover err %v", err)
- log.Error("%s", debug.Stack())
- }
- if ch != nil {
- ch <- this
- }
- }()
- statement := database.NewStatement()
- statement.SetNeedReturnValue(false)
- statement.SetOpenRecordSet(false)
- statement.SetProcName("Manage_PlatformConfig_Log")
- statement.AddParamter("@OpUserID", database.AdParamInput, database.AdInteger, 4, this.In.OpUserID)
- statement.AddParamter("@OpUserName", database.AdParamInput, database.AdVarChar, 32, this.In.OpUserName)
- statement.AddParamter("@Memo", database.AdParamInput, database.AdNVarChar, 128, this.In.Memo)
- statement.AddParamter("@IPAddress", database.AdParamInput, database.AdVarChar, 15, this.In.IPAddress)
- statement.AddParamter("@KeyName", database.AdParamInput, database.AdVarChar, 64, this.In.KeyName)
- statement.AddParamter("@Eq", database.AdParamInput, database.AdInteger, 4, this.In.Eq)
- sqlstring := statement.GenSql()
- //log.Debug(sqlstring)
- CenterDB.ExecSql(sqlstring)
- this.State = true
- }
- // 获取平台配置的操作记录列表
- type (
- getList_in struct {
- OpUserID int // 操作用户ID
- KeyName string // 配置的key
- }
- getList_out struct {
- AdminUserName string // 管理员名称(AdminUserName)
- Memo string // 管理员备注(Memo)
- KeyName string // 配置的key
- Eq int // 修改的下标位置(Eq)
- Crdate string // 创建时间(Crdate)
- }
- platformConfigGetList struct {
- database.Trans_base
- In getList_in
- Out []getList_out
- }
- )
- func NewPlatformConfigGetList() *platformConfigGetList {
- return &platformConfigGetList{}
- }
- func (this *platformConfigGetList) DoAction(ch chan<- interface{}) {
- defer func() {
- if err := recover(); err != nil {
- log.Error("PlatformConfig.GetList transaction recover err %v", err)
- log.Error("%s", debug.Stack())
- }
- if ch != nil {
- ch <- this
- }
- }()
- statement := database.NewStatement()
- statement.SetNeedReturnValue(false)
- statement.SetOpenRecordSet(false)
- statement.SetProcName("Manage_PlatformConfig_GetList")
- statement.AddParamter("@OpUserID", database.AdParamInput, database.AdInteger, 4, this.In.OpUserID)
- statement.AddParamter("@KeyName", database.AdParamInput, database.AdVarChar, 64, this.In.KeyName)
- sqlString := statement.GenSql()
- retRows := CenterDB.ExecSql(sqlString)
- rowLen := len(retRows)
- if rowLen <= 0 {
- this.State = false
- return
- }
- this.State = true
- this.Out = make([]getList_out, rowLen)
- for i := 0; i < rowLen; i++ {
- ret := retRows[i]
- out := &this.Out[i]
- out.AdminUserName = (*ret[0].(*interface{})).(string)
- out.Memo = (*ret[1].(*interface{})).(string)
- out.KeyName = (*ret[2].(*interface{})).(string)
- out.Eq = int((*ret[3].(*interface{})).(int64))
- out.Crdate = (*ret[4].(*interface{})).(string)
- }
- }
|