From 891cc747f689abcd43281d9a52affd14f81edeac Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 13 Sep 2024 14:34:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/super/dao/sms_money_dao.go | 5 ++++ src/super/dao/sms_num_list_dao.go | 7 +++++ src/super/dao/sms_record_dao.go | 5 ++++ src/super/implement/sms_money_implement.go | 14 ++++++++++ src/super/implement/sms_num_list_implement.go | 24 +++++++++++++++++ src/super/implement/sms_record_implement.go | 14 ++++++++++ src/super/model/sms_money.go | 11 ++++++++ src/super/model/sms_num_list.go | 7 +++++ src/super/model/sms_record.go | 27 +++++++++++++++++++ 9 files changed, 114 insertions(+) create mode 100644 src/super/dao/sms_money_dao.go create mode 100644 src/super/dao/sms_num_list_dao.go create mode 100644 src/super/dao/sms_record_dao.go create mode 100644 src/super/implement/sms_money_implement.go create mode 100644 src/super/implement/sms_num_list_implement.go create mode 100644 src/super/implement/sms_record_implement.go create mode 100644 src/super/model/sms_money.go create mode 100644 src/super/model/sms_num_list.go create mode 100644 src/super/model/sms_record.go diff --git a/src/super/dao/sms_money_dao.go b/src/super/dao/sms_money_dao.go new file mode 100644 index 0000000..6d4e141 --- /dev/null +++ b/src/super/dao/sms_money_dao.go @@ -0,0 +1,5 @@ +package dao + +type SmsMoneyDao interface { + //TODO:: You can add specific method definitions here +} diff --git a/src/super/dao/sms_num_list_dao.go b/src/super/dao/sms_num_list_dao.go new file mode 100644 index 0000000..19d375b --- /dev/null +++ b/src/super/dao/sms_num_list_dao.go @@ -0,0 +1,7 @@ +package dao + +import "code.fnuoos.com/zhimeng/model.git/src/super/model" + +type SmsNumListDao interface { + GetSmsNum(uid interface{}) *model.SmsNumList +} diff --git a/src/super/dao/sms_record_dao.go b/src/super/dao/sms_record_dao.go new file mode 100644 index 0000000..f3f4e7a --- /dev/null +++ b/src/super/dao/sms_record_dao.go @@ -0,0 +1,5 @@ +package dao + +type SmsRecordDao interface { + //TODO:: You can add specific method definitions here +} diff --git a/src/super/implement/sms_money_implement.go b/src/super/implement/sms_money_implement.go new file mode 100644 index 0000000..397319d --- /dev/null +++ b/src/super/implement/sms_money_implement.go @@ -0,0 +1,14 @@ +package implement + +import ( + "code.fnuoos.com/zhimeng/model.git/src/super/dao" + "xorm.io/xorm" +) + +func NewSmsMoneyDb(engine *xorm.Engine) dao.SmsMoneyDao { + return &SmsMoneyDb{Db: engine} +} + +type SmsMoneyDb struct { + Db *xorm.Engine +} diff --git a/src/super/implement/sms_num_list_implement.go b/src/super/implement/sms_num_list_implement.go new file mode 100644 index 0000000..6b1539c --- /dev/null +++ b/src/super/implement/sms_num_list_implement.go @@ -0,0 +1,24 @@ +package implement + +import ( + "code.fnuoos.com/zhimeng/model.git/src/super/dao" + "code.fnuoos.com/zhimeng/model.git/src/super/model" + "xorm.io/xorm" +) + +func NewSmsNumListDb(engine *xorm.Engine) dao.SmsNumListDao { + return &SmsNumListDb{Db: engine} +} + +type SmsNumListDb struct { + Db *xorm.Engine +} + +func (s SmsNumListDb) GetSmsNum(uid interface{}) *model.SmsNumList { + var data model.SmsNumList + get, err := s.Db.Where("uid=? ", uid).Get(&data) + if get == false || err != nil { + return nil + } + return &data +} diff --git a/src/super/implement/sms_record_implement.go b/src/super/implement/sms_record_implement.go new file mode 100644 index 0000000..bb5252a --- /dev/null +++ b/src/super/implement/sms_record_implement.go @@ -0,0 +1,14 @@ +package implement + +import ( + "code.fnuoos.com/zhimeng/model.git/src/super/dao" + "xorm.io/xorm" +) + +func NewSmsRecordDb(engine *xorm.Engine) dao.SmsRecordDao { + return &SmsRecordDb{Db: engine} +} + +type SmsRecordDb struct { + Db *xorm.Engine +} diff --git a/src/super/model/sms_money.go b/src/super/model/sms_money.go new file mode 100644 index 0000000..c964010 --- /dev/null +++ b/src/super/model/sms_money.go @@ -0,0 +1,11 @@ +package model + +type SmsMoney struct { + Id int `json:"id" xorm:"not null pk autoincr INT(11)"` + Money float64 `json:"money" xorm:"default 0.00 comment('金额') DOUBLE(11,2)"` + Num int `json:"num" xorm:"default 0 comment('短信条数') INT(11)"` + Hide int `json:"hide" xorm:"default 0 comment('0否 1是') INT(1)"` + Sort int `json:"sort" xorm:"default 0 comment('排序') INT(11)"` + UpdateTime int `json:"update_time" xorm:"default 0 comment('修改时间') INT(11)"` + Time int `json:"time" xorm:"default 0 comment('创建时间') INT(11)"` +} diff --git a/src/super/model/sms_num_list.go b/src/super/model/sms_num_list.go new file mode 100644 index 0000000..e1280d9 --- /dev/null +++ b/src/super/model/sms_num_list.go @@ -0,0 +1,7 @@ +package model + +type SmsNumList struct { + Id int `json:"id" xorm:"not null pk autoincr INT(11)"` + Uid int `json:"uid" xorm:"default 0 comment('用户') INT(11)"` + Num int `json:"num" xorm:"default 0 comment('短信条数') INT(11)"` +} diff --git a/src/super/model/sms_record.go b/src/super/model/sms_record.go new file mode 100644 index 0000000..18e90ac --- /dev/null +++ b/src/super/model/sms_record.go @@ -0,0 +1,27 @@ +package model + +import ( + "time" +) + +type SmsRecord struct { + Id int `json:"id" xorm:"not null pk autoincr INT(11)"` + OrdId string `json:"ord_id" xorm:"not null default '' comment('订单id') VARCHAR(100)"` + Uid int `json:"uid" xorm:"not null default 0 comment('主用户id') INT(11)"` + Phone string `json:"phone" xorm:"not null default '0' comment('主账号-手机号码') VARCHAR(20)"` + Nickname string `json:"nickname" xorm:"not null default '' comment('主账号-昵称') VARCHAR(255)"` + Amount string `json:"amount" xorm:"not null default '0' comment('充值金额') VARCHAR(255)"` + CostPrice string `json:"cost_price" xorm:"not null default '0' comment('付费价格') VARCHAR(255)"` + Balance string `json:"balance" xorm:"not null default '0' comment('当前余额(充值完当前余额)') VARCHAR(255)"` + PayWay int `json:"pay_way" xorm:"not null default 1 comment('支付方式(1:支付宝 2:微信 3:余额)') TINYINT(1)"` + State int `json:"state" xorm:"not null default 0 comment('状态(0:待付款 1:已付款 2:付款失败)') TINYINT(2)"` + Memo string `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(255)"` + CreateAt time.Time `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP comment('创建时间') DATETIME"` + UpdateAt time.Time `json:"update_at" xorm:"default CURRENT_TIMESTAMP comment('更新时间') DATETIME"` + TradeNo string `json:"trade_no" xorm:"not null default '' comment('支付平台(支付宝/微信)订单号') VARCHAR(100)"` + Type int `json:"type" xorm:"default 0 comment('0收入 1支出') INT(1)"` + OrdType string `json:"ord_type" xorm:"comment('订单类型') VARCHAR(255)"` + SubUid int `json:"sub_uid" xorm:"default 0 INT(11)"` + Fee string `json:"fee" xorm:"VARCHAR(255)"` + Ext string `json:"ext" xorm:"TEXT"` +}