|
12345678910111213141516171819202122232425262728293031 |
- package svc
-
- import (
- "applet/supply/db/model"
- "errors"
- "github.com/gin-gonic/gin"
- )
-
- func GetSupplyBasicSetting(c *gin.Context) (setting *model.SupplyBasicSetting, err error) {
- setting = &model.SupplyBasicSetting{}
- //get, _ := db.Db.Get(&setting)
- //if get {
- aliCloudChainFenXiaoAccessToken, aliCloudChainFenXiaoAppkey, aliCloudChainFenXiaoAppSecret, aliCloudChainAppkey, aliCloudChainAppSecret, aliCloudChainAccessToken := JudgeFenXiaoChannel(c)
- if aliCloudChainFenXiaoAccessToken != "" {
- setting.AliCloudChainFenXiaoAppkey = aliCloudChainFenXiaoAppkey
- setting.AliCloudChainFenXiaoAppsecret = aliCloudChainFenXiaoAppSecret
- setting.AliCloudChainFenXiaoAccesstoken = aliCloudChainFenXiaoAccessToken
- } else {
- err = errors.New("暂未配置《阿里巴巴云链精选》")
- return nil, err
- }
- if aliCloudChainAccessToken != "" {
- setting.AliCloudChainAppkey = aliCloudChainAppkey
- setting.AliCloudChainAppsecret = aliCloudChainAppSecret
- setting.AliCloudChainAccesstoken = aliCloudChainAccessToken
- } else {
- err = errors.New("暂未配置《阿里巴巴云链》")
- return nil, err
- }
- return
- }
|