Ver código fonte

Merge remote-tracking branch 'origin/master'

master
huangjiajun 1 mês atrás
pai
commit
885b29fae8
4 arquivos alterados com 84 adições e 0 exclusões
  1. +19
    -0
      src/models/official/db_zhios_alipay_config.go
  2. +44
    -0
      src/models/official/db_zhios_alipay_master_auth.go
  3. +11
    -0
      src/models/official/model/zhios_alipay_config.go
  4. +10
    -0
      src/models/official/model/zhios_alipay_master_auth.go

+ 19
- 0
src/models/official/db_zhios_alipay_config.go Ver arquivo

@@ -0,0 +1,19 @@
package db

import (
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models/official/model"
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx"
"xorm.io/xorm"
)

func ZhiosAlipayConfigGet(officialDb *xorm.Engine) (m *model.ZhiosAlipayConfig, err error) {
m = new(model.ZhiosAlipayConfig)
has, err := officialDb.Where("id >= 1").Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

+ 44
- 0
src/models/official/db_zhios_alipay_master_auth.go Ver arquivo

@@ -0,0 +1,44 @@
package db

import (
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models/official/model"
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx"
"xorm.io/xorm"
)

// ZhiosAlipayMasterAuthInsert 插入单条数据
func ZhiosAlipayMasterAuthInsert(officialDb *xorm.Engine, ZhiosAlipayMasterAuth *model.ZhiosAlipayMasterAuth) (int, error) {
_, err := officialDb.InsertOne(ZhiosAlipayMasterAuth)
if err != nil {
return 0, err
}
return ZhiosAlipayMasterAuth.Id, nil
}

func GetZhiosAlipayMasterAuth(officialDb *xorm.Engine, masterId int, date string) (m *model.ZhiosAlipayMasterAuth, err error) {
m = new(model.ZhiosAlipayMasterAuth)
has, err := officialDb.Where("master_id =?", masterId).And("date =?", date).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

func ZhiosAlipayMasterAuthUpdate(officialDb *xorm.Engine, id interface{}, m *model.ZhiosAlipayMasterAuth, forceColums ...string) (int64, error) {
var (
affected int64
err error
)
if forceColums != nil {
affected, err = officialDb.Where("id=?", id).Cols(forceColums...).Update(m)
} else {
affected, err = officialDb.Where("id=?", id).Update(m)
}
if err != nil {
return 0, err
}
return affected, nil
}

+ 11
- 0
src/models/official/model/zhios_alipay_config.go Ver arquivo

@@ -0,0 +1,11 @@
package model

type ZhiosAlipayConfig struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
OpenAlipayAppid string `json:"open_alipay_appid" xorm:"not null default '' comment('支付宝开放平台-第三方应用-appid') VARCHAR(255)"`
OpenAlipayAesKey string `json:"open_alipay_aes_key" xorm:"not null default '' comment('支付宝开放平台-第三方应用-接口内容加密-aesKey') VARCHAR(255)"`
OpenAlipayAppPrivateKey string `json:"open_alipay_app_private_key" xorm:"not null default '' comment('支付宝开放平台-第三方应用-接口加签-应用私钥') VARCHAR(255)"`
OpenAlipayAppPublicKey string `json:"open_alipay_app_public_key" xorm:"not null default '' comment('支付宝开放平台-第三方应用-接口加签-应用公钥') VARCHAR(255)"`
OpenAlipayPublicKey string `json:"open_alipay_public_key" xorm:"not null default '' comment('支付宝开放平台-第三方应用-接口加签-支付宝公钥') VARCHAR(255)"`
JsapiPayNotifyUrl string `json:"jsapi_pay_notify_url" xorm:"not null default '' comment('支付宝开放平台-jsapi支付-异步通知"') VARCHAR(255)"`
}

+ 10
- 0
src/models/official/model/zhios_alipay_master_auth.go Ver arquivo

@@ -0,0 +1,10 @@
package model

type ZhiosAlipayMasterAuth struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
MasterId string `json:"master_id" xorm:"not null default '' comment('站长id') CHAR(50)"`
OpenAppletAppid string `json:"open_applet_appid" xorm:"not null default '' comment('支付宝-小程序-appid') CHAR(50)"`
JsapiPayAppAuthToken string `json:"jsapi_pay_app_auth_token" xorm:"not null default '' comment('支付宝开放平台-jsapi支付-app_auth_token') VARCHAR(255)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

Carregando…
Cancelar
Salvar