From 87130c2acc89e446201d96b26ea7aa3858f7395c Mon Sep 17 00:00:00 2001 From: dengbiao Date: Tue, 18 Jun 2024 16:07:20 +0800 Subject: [PATCH] update --- src/dao/installment_payment_list_dao.go | 5 +++++ src/dao/installment_payment_scheme_dao.go | 5 +++++ ...stallment_payment_scheme_with_goods_dao.go | 5 +++++ .../super_cloud_issuance_user_robot_dao.go | 7 ++++-- src/implement/installment_payment_list_db.go | 14 ++++++++++++ .../installment_payment_scheme_db.go | 14 ++++++++++++ ...nstallment_payment_scheme_with_goods_db.go | 14 ++++++++++++ .../super_cloud_issuance_user_robot_db.go | 14 +++++++----- src/models/installment_payment_list.go | 15 +++++++++++++ src/models/installment_payment_scheme.go | 9 ++++++++ .../installment_payment_scheme_with_goods.go | 10 +++++++++ .../db_super_cloud_issuance_robot_records.go | 15 +++++++++++++ .../model/super_cloud_issuance_basic.go | 15 +++++++++++++ .../model/super_cloud_issuance_master.go | 14 ++++++++++++ .../super_cloud_issuance_master_buy_ord.go | 22 +++++++++++++++++++ .../model/super_cloud_issuance_robot.go | 15 +++++++++++++ .../super_cloud_issuance_robot_records.go | 8 +++++++ src/models/official/model/user_app_list.go | 8 +++++++ src/models/official/model/user_app_member.go | 8 +++++++ 19 files changed, 209 insertions(+), 8 deletions(-) create mode 100644 src/dao/installment_payment_list_dao.go create mode 100644 src/dao/installment_payment_scheme_dao.go create mode 100644 src/dao/installment_payment_scheme_with_goods_dao.go create mode 100644 src/implement/installment_payment_list_db.go create mode 100644 src/implement/installment_payment_scheme_db.go create mode 100644 src/implement/installment_payment_scheme_with_goods_db.go create mode 100644 src/models/installment_payment_list.go create mode 100644 src/models/installment_payment_scheme.go create mode 100644 src/models/installment_payment_scheme_with_goods.go create mode 100644 src/models/official/db_super_cloud_issuance_robot_records.go create mode 100644 src/models/official/model/super_cloud_issuance_basic.go create mode 100644 src/models/official/model/super_cloud_issuance_master.go create mode 100644 src/models/official/model/super_cloud_issuance_master_buy_ord.go create mode 100644 src/models/official/model/super_cloud_issuance_robot.go create mode 100644 src/models/official/model/super_cloud_issuance_robot_records.go create mode 100644 src/models/official/model/user_app_list.go create mode 100644 src/models/official/model/user_app_member.go diff --git a/src/dao/installment_payment_list_dao.go b/src/dao/installment_payment_list_dao.go new file mode 100644 index 0000000..6e863e3 --- /dev/null +++ b/src/dao/installment_payment_list_dao.go @@ -0,0 +1,5 @@ +package dao + +type InstallmentPaymentListDao interface { + //TODO:: You can add specific method definitions here +} diff --git a/src/dao/installment_payment_scheme_dao.go b/src/dao/installment_payment_scheme_dao.go new file mode 100644 index 0000000..c741136 --- /dev/null +++ b/src/dao/installment_payment_scheme_dao.go @@ -0,0 +1,5 @@ +package dao + +type InstallmentPaymentSchemeDao interface { + //TODO:: You can add specific method definitions here +} diff --git a/src/dao/installment_payment_scheme_with_goods_dao.go b/src/dao/installment_payment_scheme_with_goods_dao.go new file mode 100644 index 0000000..9d7faa3 --- /dev/null +++ b/src/dao/installment_payment_scheme_with_goods_dao.go @@ -0,0 +1,5 @@ +package dao + +type InstallmentPaymentSchemeWithGoodsDao interface { + //TODO:: You can add specific method definitions here +} diff --git a/src/dao/super_cloud_issuance_user_robot_dao.go b/src/dao/super_cloud_issuance_user_robot_dao.go index 11dde92..78dd8bc 100644 --- a/src/dao/super_cloud_issuance_user_robot_dao.go +++ b/src/dao/super_cloud_issuance_user_robot_dao.go @@ -1,10 +1,13 @@ package dao -import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" +import ( + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" + "xorm.io/xorm" +) type SuperCloudIssuanceUserRobotDao interface { GetSuperCloudIssuanceUserRobot() (m *models.SuperCloudIssuanceUserRobot, err error) SaveSuperCloudIssuanceUserRobot(id interface{}, m *models.SuperCloudIssuanceUserRobot, forceColums ...string) (affected int64, err error) GetCloudIssuanceUserFreeRobot() (m *models.SuperCloudIssuanceUserRobot, err error) - InsertCloudIssuanceUserRobot(m *models.SuperCloudIssuanceUserRobot) (id int, err error) + InsertCloudIssuanceUserRobot(m *models.SuperCloudIssuanceUserRobot, officialDb *xorm.Engine) (id int, err error) } diff --git a/src/implement/installment_payment_list_db.go b/src/implement/installment_payment_list_db.go new file mode 100644 index 0000000..f6a4431 --- /dev/null +++ b/src/implement/installment_payment_list_db.go @@ -0,0 +1,14 @@ +package implement + +import ( + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" + "xorm.io/xorm" +) + +type InstallmentPaymentListDb struct { + Db *xorm.Engine +} + +func NewInstallmentPaymentListDb(engine *xorm.Engine) dao.InstallmentPaymentListDao { + return &InstallmentPaymentListDb{Db: engine} +} diff --git a/src/implement/installment_payment_scheme_db.go b/src/implement/installment_payment_scheme_db.go new file mode 100644 index 0000000..f795254 --- /dev/null +++ b/src/implement/installment_payment_scheme_db.go @@ -0,0 +1,14 @@ +package implement + +import ( + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" + "xorm.io/xorm" +) + +type InstallmentPaymentSchemeDb struct { + Db *xorm.Engine +} + +func NewInstallmentPaymentSchemeDb(engine *xorm.Engine) dao.InstallmentPaymentSchemeDao { + return &InstallmentPaymentSchemeDb{Db: engine} +} diff --git a/src/implement/installment_payment_scheme_with_goods_db.go b/src/implement/installment_payment_scheme_with_goods_db.go new file mode 100644 index 0000000..6bd1965 --- /dev/null +++ b/src/implement/installment_payment_scheme_with_goods_db.go @@ -0,0 +1,14 @@ +package implement + +import ( + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" + "xorm.io/xorm" +) + +type InstallmentPaymentSchemeWithGoodsDb struct { + Db *xorm.Engine +} + +func NewInstallmentPaymentSchemeWithGoodsDb(engine *xorm.Engine) dao.InstallmentPaymentSchemeWithGoodsDao { + return &InstallmentPaymentSchemeWithGoodsDb{Db: engine} +} diff --git a/src/implement/super_cloud_issuance_user_robot_db.go b/src/implement/super_cloud_issuance_user_robot_db.go index 4a1451c..7714b96 100644 --- a/src/implement/super_cloud_issuance_user_robot_db.go +++ b/src/implement/super_cloud_issuance_user_robot_db.go @@ -3,6 +3,8 @@ package implement import ( "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" + db "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models/official" + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models/official/model" "code.fnuoos.com/go_rely_warehouse/zyos_model.git/super_cloud_issuance/enum" zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" "strconv" @@ -24,17 +26,17 @@ type SuperCloudIssuanceUserRobotDb struct { MasterId string `json:"master_id"` } -func (superCloudIssuanceUserRobotDb *SuperCloudIssuanceUserRobotDb) InsertCloudIssuanceUserRobot(m *models.SuperCloudIssuanceUserRobot) (id int, err error) { - _, err = cloudIssuanceUserRobotDb.Db.InsertOne(m) +func (superCloudIssuanceUserRobotDb *SuperCloudIssuanceUserRobotDb) InsertCloudIssuanceUserRobot(m *models.SuperCloudIssuanceUserRobot, officialDb *xorm.Engine) (id int, err error) { + _, err = superCloudIssuanceUserRobotDb.Db.InsertOne(m) if err != nil { return 0, err } id = m.Id - //顺便新增一份数据到总后台的 `cloud_issuance_robot_records` 表 - db.CloudIssuanceRobotRecordsInsert(&model2.CloudIssuanceRobotRecords{ - MasterId: cloudIssuanceUserRobotDb.MasterId, + //顺便新增一份数据到总后台的 `super_cloud_issuance_robot_records` 表 + db.CloudIssuanceRobotRecordsInsert(officialDb, &model.SuperCloudIssuanceRobotRecords{ + MasterId: superCloudIssuanceUserRobotDb.MasterId, RobotId: strconv.Itoa(m.RobotId), - Uid: cloudIssuanceUserRobotDb.Uid, + Uid: superCloudIssuanceUserRobotDb.Uid, }) return id, nil } diff --git a/src/models/installment_payment_list.go b/src/models/installment_payment_list.go new file mode 100644 index 0000000..de65be9 --- /dev/null +++ b/src/models/installment_payment_list.go @@ -0,0 +1,15 @@ +package models + +type InstallmentPaymentList struct { + Id int `json:"id" xorm:"not null pk autoincr INT(11)"` + Uid int `json:"uid" xorm:"not null default 0 comment('uid') INT(11)"` + GoodsId int `json:"goods_id" xorm:"not null default 0 comment('商品ID') INT(11)"` + OrdId int64 `json:"ord_id" xorm:"not null default 0 comment('订单ID') BIGINT(20)"` + TotalAmount string `json:"total_amount" xorm:"not null default 0.00 comment('总金额') DECIMAL(12,2)"` + InstallmentNums int `json:"installment_nums" xorm:"not null default 0 comment('分期数') TINYINT(3)"` + AlreadyRepaidInstallmentNums int `json:"already_repaid_installment_nums" xorm:"not null default 0 comment('已换分期数') TINYINT(3)"` + RepaymentAmountPerInstallment string `json:"repayment_amount_per_installment" xorm:"not null default 0.00 comment('每期还款金额') DECIMAL(12,2)"` + IsRepaidOff int `json:"is_repaid_off" xorm:"not null default 0 comment('是否已偿还完(0:未偿还完 1:已偿还完)') TINYINT(1)"` + CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"` + UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('更新时间') DATETIME"` +} diff --git a/src/models/installment_payment_scheme.go b/src/models/installment_payment_scheme.go new file mode 100644 index 0000000..175cd83 --- /dev/null +++ b/src/models/installment_payment_scheme.go @@ -0,0 +1,9 @@ +package models + +type InstallmentPaymentScheme struct { + Id int `json:"id" xorm:"not null pk autoincr INT(11)"` + Name string `json:"name" xorm:"not null default '' comment('方案名称') CHAR(50)"` + InstallmentNums int `json:"installment_nums" xorm:"not null default 0 comment('分期数') TINYINT(3)"` + CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"` + UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('更新时间') DATETIME"` +} diff --git a/src/models/installment_payment_scheme_with_goods.go b/src/models/installment_payment_scheme_with_goods.go new file mode 100644 index 0000000..928623d --- /dev/null +++ b/src/models/installment_payment_scheme_with_goods.go @@ -0,0 +1,10 @@ +package models + +type InstallmentPaymentSchemeWithGoods struct { + Id int `json:"id" xorm:"not null pk autoincr INT(11)"` + GoodsId int `json:"goods_id" xorm:"not null default 0 comment('商品id') INT(11)"` + SchemeId int `json:"scheme_id" xorm:"not null default 0 comment('方案id') INT(11)"` + Pvd int `json:"pvd" xorm:"not null default 1 comment('平台(1:自营商城)') TINYINT(3)"` + CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"` + UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('更新时间') DATETIME"` +} diff --git a/src/models/official/db_super_cloud_issuance_robot_records.go b/src/models/official/db_super_cloud_issuance_robot_records.go new file mode 100644 index 0000000..f1ac972 --- /dev/null +++ b/src/models/official/db_super_cloud_issuance_robot_records.go @@ -0,0 +1,15 @@ +package db + +import ( + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models/official/model" + "xorm.io/xorm" +) + +// CloudIssuanceRobotRecordsInsert 插入单条数据 +func CloudIssuanceRobotRecordsInsert(officialDb *xorm.Engine, CloudIssuanceRobotRecords *model.SuperCloudIssuanceRobotRecords) (int, error) { + _, err := officialDb.InsertOne(CloudIssuanceRobotRecords) + if err != nil { + return 0, err + } + return CloudIssuanceRobotRecords.Id, nil +} diff --git a/src/models/official/model/super_cloud_issuance_basic.go b/src/models/official/model/super_cloud_issuance_basic.go new file mode 100644 index 0000000..55fe03c --- /dev/null +++ b/src/models/official/model/super_cloud_issuance_basic.go @@ -0,0 +1,15 @@ +package model + +import "time" + +type SuperCloudIssuanceBasic struct { + Id int `json:"id"` + ImageNumsLimitIssuanceOnCircleOfFriends int `json:"image_nums_limit_issuance_on_circle_of_friends"` + ImageNumsLimitIssuanceOnGroups int `json:"image_nums_limit_issuance_on_groups"` + BindNums int `json:"bind_nums"` + FollowGroupUserNums int `json:"follow_group_user_nums"` + FollowGroupBindNums int `json:"follow_group_bind_nums"` + FollowGroupRelayNums int `json:"follow_group_relay_nums"` + CreateAt time.Time `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP comment('创建时间') TIMESTAMP"` + UpdateAt time.Time `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP comment('更新时间') TIMESTAMP"` +} diff --git a/src/models/official/model/super_cloud_issuance_master.go b/src/models/official/model/super_cloud_issuance_master.go new file mode 100644 index 0000000..5d964c2 --- /dev/null +++ b/src/models/official/model/super_cloud_issuance_master.go @@ -0,0 +1,14 @@ +package model + +import "time" + +type SuperCloudIssuanceMaster struct { + Id int `json:"id"` + MasterId int `json:"master_id"` + Amount string `json:"amount"` + CreditAmount string `json:"credit_amount"` + Memo string `json:"memo"` + State int `json:"state"` + CreateAt time.Time `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP comment('创建时间') TIMESTAMP"` + UpdateAt time.Time `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP comment('更新时间') TIMESTAMP"` +} diff --git a/src/models/official/model/super_cloud_issuance_master_buy_ord.go b/src/models/official/model/super_cloud_issuance_master_buy_ord.go new file mode 100644 index 0000000..52f77bb --- /dev/null +++ b/src/models/official/model/super_cloud_issuance_master_buy_ord.go @@ -0,0 +1,22 @@ +package model + +import "time" + +type SuperCloudIssuanceMasterBuyOrd struct { + Id int `json:"id"` + OrdId string `json:"ord_id"` + MasterId int `json:"master_id"` + Nickname string `json:"nickname"` + Phone int64 `json:"phone"` + Uid int `json:"uid"` + UserPhone string `json:"user_phone"` + RobotId int `json:"robot_id"` + Month int `json:"month"` + CostPrice string `json:"cost_price"` + BeforeBalance string `json:"before_balance"` + Balance string `json:"balance"` + Memo string `json:"memo"` + State int `json:"state"` + CreateAt time.Time `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP comment('创建时间') TIMESTAMP"` + UpdateAt time.Time `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP comment('更新时间') TIMESTAMP"` +} diff --git a/src/models/official/model/super_cloud_issuance_robot.go b/src/models/official/model/super_cloud_issuance_robot.go new file mode 100644 index 0000000..b65ad8c --- /dev/null +++ b/src/models/official/model/super_cloud_issuance_robot.go @@ -0,0 +1,15 @@ +package model + +import "time" + +type SuperCloudIssuanceRobot struct { + Id int `json:"id"` + Name string `json:"name"` + Price string `json:"price"` + Type int32 `json:"type"` + State int32 `json:"state"` + Sort int `json:"sort"` + Memo string `json:"memo"` + CreateAt time.Time `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP comment('创建时间') TIMESTAMP"` + UpdateAt time.Time `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP comment('更新时间') TIMESTAMP"` +} diff --git a/src/models/official/model/super_cloud_issuance_robot_records.go b/src/models/official/model/super_cloud_issuance_robot_records.go new file mode 100644 index 0000000..7b2dd44 --- /dev/null +++ b/src/models/official/model/super_cloud_issuance_robot_records.go @@ -0,0 +1,8 @@ +package model + +type SuperCloudIssuanceRobotRecords struct { + Id int `json:"id"` + MasterId string `json:"master_id"` + RobotId string `json:"robot_id"` + Uid int `json:"uid"` +} diff --git a/src/models/official/model/user_app_list.go b/src/models/official/model/user_app_list.go new file mode 100644 index 0000000..5d23804 --- /dev/null +++ b/src/models/official/model/user_app_list.go @@ -0,0 +1,8 @@ +package model + +type UserAppList struct { + Id int `json:"id" xorm:"int(11) NOT NULL "` + Uuid int64 `json:"uuid" xorm:"int(10) NOT NULL "` + AppId int64 `json:"app_id" xorm:"int(10) NOT NULL "` + Name string `json:"name" xorm:"varchar(255) DEFAULT '' "` +} diff --git a/src/models/official/model/user_app_member.go b/src/models/official/model/user_app_member.go new file mode 100644 index 0000000..9a07379 --- /dev/null +++ b/src/models/official/model/user_app_member.go @@ -0,0 +1,8 @@ +package model + +type UserAppMember struct { + Id int `json:"id" xorm:"int(11) NOT NULL "` + Uuid int64 `json:"uuid" xorm:"int(10) NOT NULL "` + Uid int64 `json:"uid" xorm:"int(10) NOT NULL "` + Phone int64 `json:"phone" xorm:"int(10) NOT NULL "` +}