소스 검색

rebuid 精简 app.conf

abiao 5 년 전
부모
커밋
f1fa5de732

+ 1 - 1
go/gopath/src/fohow.com/Makefile

@@ -1,7 +1,7 @@
 all: build  
 
 build:
-	go build -o fohowmall.com ./main.go
+	go build -o winhamall.com ./main.go
 
 clean:
 	go clean -i ./...

+ 0 - 19
go/gopath/src/fohow.com/apps/controllers/cron_controller/sync_balance.go

@@ -4,9 +4,6 @@ import (
 	"crypto/md5"
 	"fmt"
 	"io"
-	"net/http"
-	"net/url"
-	"strconv"
 	"time"
 
 	"github.com/astaxie/beego"
@@ -59,22 +56,6 @@ func syncBalance() {
 	beego.BeeLogger.Warn("********** Cron task - handle syncBalance end   at: %s********", time.Now())
 }
 
-func syncOne(syncData SyncData) bool {
-	form := url.Values{}
-	form.Add("unionId", syncData.UnionId)
-	form.Add("amount", strconv.FormatInt(syncData.Amount, 10))
-	form.Add("timestamp", strconv.FormatInt(syncData.CreatedAt.Unix(), 10))
-	form.Add("signature", syncData.Sign())
-	apiUrl := beego.AppConfig.String("D5CApiHost") + "/v1/labi/cjhd/sync_balance"
-	resp, err := http.PostForm(apiUrl, form)
-	if err != nil {
-		beego.BeeLogger.Error("********** Cron task - handle syncBalance Http Error %s:  ********", err)
-	}
-	defer resp.Body.Close()
-	beego.BeeLogger.Debug("********** Cron task - handle syncBalance end   at:  ********", resp)
-	return resp.StatusCode == 201
-}
-
 //提现打款的定时任务
 func takeCash() {
 	//选择出已审批通过的提现中订单

+ 0 - 218
go/gopath/src/fohow.com/apps/helpers/exchange_platform_helper.go

@@ -1,218 +0,0 @@
-package helpers
-
-import (
-	"crypto/aes"
-	"crypto/cipher"
-	"crypto/rand"
-	"encoding/base64"
-	"encoding/json"
-	"fmt"
-	"github.com/astaxie/beego"
-	"io"
-	"fohow.com/libs/tool"
-	"net/url"
-)
-
-type CheckResult struct {
-	RetCode string `json:"ret_code"`
-	RetMsg  string `json:"ret_msg"`
-	Balance int64  `json:"balance"`
-}
-
-type ExchangeResult struct {
-	RetCode string `json:"ret_code"`
-	RetMsg  string `json:"ret_msg"`
-	TradeNo string `json:"trade_no"`
-}
-
-type AnalyseResult struct {
-	RetCode string `json:"ret_code"`
-	RetMsg  string `json:"ret_msg"`
-	Normal  int64  `json:"normal"`
-}
-
-const (
-	EXTYPE_TONGDUI = "0"
-	EXTYPE_ZHIFU   = "1"
-
-	RETURN_URL = "/v1/mall/labi/return"
-
-	ANALYSE_URL = "/v1/mall/labi/analyse"
-
-	NORMAL_NO_REGIST       = 5 //比d5c先注册
-	NORMAL_WAITING_CHECK   = 4 //待检测用户,文章分享及代金券任务获取都正常,非投资人
-	UNNORMAL               = 3 //对接接口通讯或代码异常报错
-	UNNORMAL_ARTICLE_SHARE = 2 //文章分享获取代金券不正常
-	UNNORMAL_POINT_TASK    = 1 //代金券任务获取代金券不正常
-	NORMAL                 = 0 //是第五创投资用户
-)
-
-func GetCheckPlatformMallBalance(secret, tel, checkUrl string) *CheckResult {
-
-	if len(secret) < 16 {
-		beego.BeeLogger.Error("helpers.GetCheckPlatformMallBalance(). Check len(secret)<16 error.")
-		return nil
-	}
-	key := []byte(secret) //秘钥
-	params := fmt.Sprintf("tel=%s", tel)
-	signData := []byte(params)
-	block, err := aes.NewCipher(key)
-	if err != nil {
-		beego.BeeLogger.Error("helpers.GetCheckPlatformMallBalance(). Check aes newCipher err:%s", err)
-		return nil
-	}
-	// The IV needs to be unique, but not secure. Therefore it's common to
-	// include it at the beginning of the ciphertext.
-	ciphertext := make([]byte, aes.BlockSize+len(signData))
-	iv := ciphertext[:aes.BlockSize]
-	if _, err := io.ReadFull(rand.Reader, iv); err != nil {
-		beego.BeeLogger.Error("Check read iv err:%s", err)
-		return nil
-	}
-
-	stream := cipher.NewCFBEncrypter(block, iv)
-	stream.XORKeyStream(ciphertext[aes.BlockSize:], signData)
-	base64Str := base64.StdEncoding.EncodeToString(ciphertext)
-	encodeParams := url.QueryEscape(base64Str)
-
-	httpUrl := fmt.Sprintf("%s?params=%s", checkUrl, encodeParams)
-	resp := tool.HttpCall(httpUrl, "GET", nil, nil)
-	beego.BeeLogger.Warn("helpers.GetCheckPlatformMallBalance(). check resp: %s", resp)
-
-	var result CheckResult
-	errMarsha := json.Unmarshal([]byte(resp), &result)
-	if errMarsha != nil {
-		beego.BeeLogger.Warn("helpers.GetCheckPlatformMallBalance(). Unmarshal(resp) err: %s", errMarsha)
-		return nil
-	}
-	return &result
-}
-
-func ExchangePlatformMallBalance(platformCount int64, secret, tel, exchangeUrl, exType string) *ExchangeResult {
-	if platformCount <= 0 {
-		return nil
-	}
-	key := []byte(secret) //秘钥
-	params := fmt.Sprintf("count=%d&tel=%s&extype=%s", platformCount, tel, exType)
-	signData := []byte(params)
-	block, err := aes.NewCipher(key)
-	if err != nil {
-		beego.BeeLogger.Error("exchange aes newCipher err:%s", err)
-		return nil
-	}
-	// The IV needs to be unique, but not secure. Therefore it's common to
-	// include it at the beginning of the ciphertext.
-	ciphertext := make([]byte, aes.BlockSize+len(signData))
-	iv := ciphertext[:aes.BlockSize]
-	if _, err := io.ReadFull(rand.Reader, iv); err != nil {
-		beego.BeeLogger.Error("exchange read iv err:%s", err)
-		return nil
-	}
-
-	stream := cipher.NewCFBEncrypter(block, iv)
-	stream.XORKeyStream(ciphertext[aes.BlockSize:], signData)
-	base64Str := base64.StdEncoding.EncodeToString(ciphertext)
-
-	var requestData map[string]string = make(map[string]string)
-	requestData["params"] = base64Str
-
-	resp := tool.HttpCall(exchangeUrl, "POST", requestData, nil)
-
-	beego.BeeLogger.Warn("exchange resp: %s", resp)
-	var result ExchangeResult
-	errMarsha := json.Unmarshal([]byte(resp), &result)
-	if errMarsha != nil {
-		return nil
-	}
-
-	return &result
-}
-
-func ReturnPlatformMallBalance(secret, tradeNo, returnUrl, tel string, count int64) *ExchangeResult {
-	if tradeNo == "" || count <= 0 || tel == "" {
-		return nil
-	}
-
-	key := []byte(secret) //秘钥
-	params := fmt.Sprintf("tradeNo=%s&count=%d&tel=%s", tradeNo, count, tel)
-	signData := []byte(params)
-	block, err := aes.NewCipher(key)
-	if err != nil {
-		beego.BeeLogger.Error("exchange aes newCipher err:%s", err)
-		return nil
-	}
-	// The IV needs to be unique, but not secure. Therefore it's common to
-	// include it at the beginning of the ciphertext.
-	ciphertext := make([]byte, aes.BlockSize+len(signData))
-	iv := ciphertext[:aes.BlockSize]
-	if _, err := io.ReadFull(rand.Reader, iv); err != nil {
-		beego.BeeLogger.Error("exchange read iv err:%s", err)
-		return nil
-	}
-
-	stream := cipher.NewCFBEncrypter(block, iv)
-	stream.XORKeyStream(ciphertext[aes.BlockSize:], signData)
-	base64Str := base64.StdEncoding.EncodeToString(ciphertext)
-
-	var requestData map[string]string = make(map[string]string)
-	requestData["params"] = base64Str
-
-	returnUrl = fmt.Sprintf("%s%s", beego.AppConfig.String("D5CApiHost"), returnUrl)
-	resp := tool.HttpCall(returnUrl, "POST", requestData, nil)
-
-	beego.BeeLogger.Warn("exchange resp: %s", resp)
-	var result ExchangeResult
-	errMarsha := json.Unmarshal([]byte(resp), &result)
-	if errMarsha != nil {
-		return nil
-	}
-	return &result
-}
-
-func AnalysePlatformMallBalance(secret, tel, analyseUrl string) *AnalyseResult {
-
-	if len(secret) < 16 {
-		beego.BeeLogger.Error("helpers.AnalysePlatformMallBalance(). Check len(secret)<16 error.")
-		return nil
-	}
-
-	if tel == "" {
-		return nil
-	}
-
-	key := []byte(secret) //秘钥
-	params := fmt.Sprintf("tel=%s", tel)
-	signData := []byte(params)
-	block, err := aes.NewCipher(key)
-	if err != nil {
-		beego.BeeLogger.Error("helpers.AnalysePlatformMallBalance(). Check aes newCipher err:%s", err)
-		return nil
-	}
-	// The IV needs to be unique, but not secure. Therefore it's common to
-	// include it at the beginning of the ciphertext.
-	ciphertext := make([]byte, aes.BlockSize+len(signData))
-	iv := ciphertext[:aes.BlockSize]
-	if _, err := io.ReadFull(rand.Reader, iv); err != nil {
-		beego.BeeLogger.Error("exchange read iv err:%s", err)
-		return nil
-	}
-
-	stream := cipher.NewCFBEncrypter(block, iv)
-	stream.XORKeyStream(ciphertext[aes.BlockSize:], signData)
-	base64Str := base64.StdEncoding.EncodeToString(ciphertext)
-
-	var requestData map[string]string = make(map[string]string)
-	requestData["params"] = base64Str
-
-	analyseUrl = fmt.Sprintf("%s%s", beego.AppConfig.String("D5CApiHost"), analyseUrl)
-	resp := tool.HttpCall(analyseUrl, "POST", requestData, nil)
-
-	beego.BeeLogger.Warn("helpers.AnalysePlatformMallBalance(). check resp: %s", resp)
-	var result AnalyseResult
-	errMarsha := json.Unmarshal([]byte(resp), &result)
-	if errMarsha != nil {
-		beego.BeeLogger.Warn("helpers.AnalysePlatformMallBalance(). Unmarshal(resp) err: %s", errMarsha)
-		return nil
-	}
-	return &result
-}

+ 0 - 120
go/gopath/src/fohow.com/apps/helpers/granary_helper.go

@@ -1,120 +0,0 @@
-package helpers
-
-import (
-	// "crypto/md5"
-	// "encoding/hex"
-	"fmt"
-	// "time"
-
-	// "github.com/astaxie/beego"
-
-	"fohow.com/apps/models/balance_model"
-	"fohow.com/apps/models/granary_model"
-	"fohow.com/apps/models/order_model"
-	"fohow.com/apps/models/product_model"
-	"fohow.com/apps/models/user_model"
-	// "st.com/libs/wx_mp"
-	"sync"
-)
-
-//购买代销订单,确认收货,发放销售金额至卖方账户
-func SendBalanceWhileSaleOrderCompleteHandler(order *order_model.Order) {
-	if order == nil ||
-		order.Status != order_model.STATUS_COMPLETE ||
-		order.OrderType != order_model.ORDER_TYPE_SALE {
-		return
-	}
-	product := product_model.GetProductById(order.ProductId, false)
-	if product == nil {
-		return
-	}
-	saleRelateOrders := granary_model.GetSaleRelateOrdersByOId(order.OrderId)
-	for _, relateOrder := range saleRelateOrders {
-		saleOrder := granary_model.GetSaleOrderByOId(relateOrder.SaleOrderId)
-		if saleOrder != nil {
-			wxUser := user_model.GetWxUserByUserId(saleOrder.SaleUserId, true)
-			if wxUser != nil {
-				source := balance_model.CASH_SOURCE_PRODUCT_SALE
-				rId := fmt.Sprintf("saleRelateOrderId-%d", relateOrder.Id)
-				balance := balance_model.GetCashBalanceByWxUIdAndRIdAndSource(wxUser.Id, rId, source)
-				if balance == nil {
-					c := order.UnitUserSalePrice * relateOrder.Count
-					remark := fmt.Sprintf("<%s>代销结算", product.Name)
-					new(balance_model.CashBalance).Create(wxUser.Id, c, source, rId, remark)
-				}
-			}
-		}
-	}
-}
-
-var saleOrderHandlerLock sync.Mutex
-
-//购买代销商品成功,根据代销规则,生成代销订单关联记录
-func SaleOrderHandler(order *order_model.Order) {
-	saleOrderHandlerLock.Lock()
-	defer saleOrderHandlerLock.Unlock()
-	if order == nil {
-		return
-	}
-	product := product_model.GetProductById(order.ProductId, false)
-	if product == nil {
-		return
-	}
-	wxUser := user_model.GetWxUserById(order.WxUserId, true)
-	if wxUser == nil {
-		return
-	}
-	//待买数量
-	leftBuyCount := order.Count
-	//优先判断邀请人是否有挂单,先买邀请人的订单
-	if wxUser.InviteId != 0 {
-		wxInviter := user_model.GetWxUserById(wxUser.InviteId, true)
-		if wxInviter != nil && wxInviter.UserId != 0 {
-			saleOrder := granary_model.GetSaleOrderByPIdAndUId(order.ProductId, wxInviter.UserId)
-			if saleOrder != nil && saleOrder.State == granary_model.ORDER_STATE_ONLINE {
-				granary := granary_model.GetGranaryById(saleOrder.GranaryId, false)
-				leftCount := saleOrder.TotalCount - saleOrder.SoldCount
-				if leftCount >= 0 {
-					if leftCount >= leftBuyCount {
-						saleOrder.Buy(order.WxUserId, leftBuyCount, order.OrderId)
-						granary.SoldCount += leftBuyCount
-						granary.SoldAmount += product.UserSalePrice * leftBuyCount
-						granary.Save()
-						return
-					} else {
-						saleOrder.Buy(order.WxUserId, leftCount, order.OrderId)
-						leftBuyCount = leftBuyCount - leftCount
-						granary.SoldCount += leftCount
-						granary.SoldAmount += product.UserSalePrice * leftCount
-						granary.Save()
-					}
-				}
-			}
-		}
-	}
-	saleOrders := granary_model.GetOnlineSaleOrdersByPId(order.ProductId, false)
-	for _, saleOrder := range saleOrders {
-		granary := granary_model.GetGranaryById(saleOrder.GranaryId, false)
-		if granary == nil {
-			continue
-		}
-		leftCount := saleOrder.TotalCount - saleOrder.SoldCount
-		if leftCount <= 0 {
-			continue
-		}
-		//剩余数量足够
-		if leftCount >= leftBuyCount {
-			saleOrder.Buy(order.WxUserId, leftBuyCount, order.OrderId)
-			granary.SoldCount += leftBuyCount
-			granary.SoldAmount += product.UserSalePrice * leftBuyCount
-			granary.Save()
-			break
-		} else { //剩余数量不足,买完后继续
-			saleOrder.Buy(order.WxUserId, leftCount, order.OrderId)
-			leftBuyCount = leftBuyCount - leftCount
-			granary.SoldCount += leftCount
-			granary.SoldAmount += product.UserSalePrice * leftCount
-			granary.Save()
-		}
-	}
-}

+ 0 - 105
go/gopath/src/fohow.com/apps/helpers/invite_helper.go

@@ -1,16 +1,10 @@
 package helpers
 
 import (
-	// "crypto/md5"
-	// "encoding/hex"
-	"fmt"
 	"time"
 
 	"github.com/astaxie/beego"
 
-	"fohow.com/apps/models/balance_model"
-	"fohow.com/apps/models/order_model"
-	"fohow.com/apps/models/product_model"
 	"fohow.com/apps/models/user_model"
 	// "st.com/libs/wx_mp"
 )
@@ -57,102 +51,3 @@ func SetInviter(loginedWxUId, ivId int64) {
 		beego.BeeLogger.Info("Wxuser Inviter Relationship-setInviter(), wxUserId:%d, inviteId:%d", wxUser.Id, wxUser.InviteId)
 	}
 }
-
-//处理佣金
-func HandleProductBenefit(order *order_model.Order) {
-	if order == nil {
-		beego.BeeLogger.Error("Helpers HandleInviteBenefit order is not exist")
-		return
-	}
-	wxUser := user_model.GetWxUserById(order.WxUserId, true)
-	if wxUser == nil {
-		beego.BeeLogger.Error("Helpers HandleInviteBenefit wxuser is not exist, id:%d", order.WxUserId)
-		return
-	}
-	if wxUser.InviteId == 0 {
-		return
-	}
-	inviter := user_model.GetWxUserById(wxUser.InviteId, true)
-	if inviter == nil {
-		return
-	}
-	source := user_model.SOURCE_PRODUCT_BENEFIT
-
-	inviteOrder := user_model.GetInviteOrderByWxUIdAndSourceAndRId(wxUser.Id, source, order.OrderId)
-	if inviteOrder != nil {
-		beego.BeeLogger.Error("Helpers HandleInviteBenefit inviteOrder has exist, order_id:%s", order.OrderId)
-		return
-	}
-
-	if inviter != nil && inviter.ShowInviteMode != 1 {
-		if inviter.ProductBenefitRate == 0 {
-			inviter.ProductBenefitRate = 5
-		}
-		if inviter.ProjectBenefitRate == 0 {
-			inviter.ProjectBenefitRate = 1
-		}
-		inviter.ShowInviteMode = int64(1)
-		inviter.Save()
-	}
-	//生成佣金订单
-	count := order.UnitPrice * order.Count * inviter.ProductBenefitRate / 100
-	if count <= 0 {
-		beego.BeeLogger.Error("Helpers HandleInviteBenefit benefit count error, count:%d", count)
-		return
-	}
-
-	inviteOrder = new(user_model.InviteOrder).Create(inviter.Id, wxUser.Id, wxUser.Id, count, order.UnitPrice*order.Count, source, order.OrderId)
-
-	product := product_model.GetProductById(order.ProductId, true)
-	//创建余额记录, TODO: 部分退款、不发佣金
-	remark := fmt.Sprintf("%s的分佣奖励", product.Name)
-	rId := fmt.Sprintf("ProductOId-%d", order.Id)
-	new(balance_model.CashBalance).Create(inviter.Id, count, source, rId, remark)
-}
-
-func HandleProductBenefitIntoCashBalance(order *order_model.Order) {
-	if order == nil {
-		beego.BeeLogger.Error("Helpers HandleInviteBenefit order is not exist")
-		return
-	}
-	wxUser := user_model.GetWxUserById(order.WxUserId, true)
-	if wxUser == nil {
-		beego.BeeLogger.Error("Helpers HandleInviteBenefit wxuser is not exist, id:%d", order.WxUserId)
-		return
-	}
-	if wxUser.InviteId == 0 {
-		return
-	}
-	inviter := user_model.GetWxUserById(wxUser.InviteId, true)
-	if inviter == nil {
-		return
-	}
-
-	if inviter.ProductBenefitRate <= 0 {
-		beego.BeeLogger.Error("Helpers HandleInviteProductBenefit the Inviter no more enjoy productBenefit, order_id:%s", order.OrderId)
-		return
-	}
-
-	source := user_model.SOURCE_PRODUCT_BENEFIT
-
-	benefitOrder := user_model.GetInviteOrderByWxUIdAndSourceAndRId(wxUser.Id, source, order.OrderId)
-	if benefitOrder == nil {
-		beego.BeeLogger.Error("Helpers HandleInviteProductBenefit benefitOrder not exist, order_id:%s", order.OrderId)
-		return
-	}
-
-	s := balance_model.CASH_SOURCE_PRODUCT_BENEFIT
-	product := product_model.GetProductById(order.ProductId, true)
-	// remark := fmt.Sprintf("%s>", product.Name)
-	//发放现金佣金
-	b := balance_model.GetCashBalanceByWxUIdAndRIdAndSource(inviter.Id, order.OrderId, s)
-	if b == nil {
-		b = new(balance_model.CashBalance).Create(inviter.Id, benefitOrder.Count, s, order.OrderId, product.Name)
-		if b != nil {
-			//标志进账
-			benefitOrder.IsEnterBalance = true
-			benefitOrder.EnterTime = b.CreatedAt
-			benefitOrder.Save()
-		}
-	}
-}

+ 0 - 41
go/gopath/src/fohow.com/apps/helpers/project_benefit_helper.go

@@ -1,41 +0,0 @@
-package helpers
-
-import (
-	"fohow.com/apps/models/balance_model"
-	"fohow.com/apps/models/project_model"
-	"fohow.com/apps/models/user_model"
-)
-
-func SendProjectBenefit(project *project_model.Project) {
-
-	if project == nil || project.IsSbenefitFinished || project.State != project_model.STATE_SUCCESS {
-		return
-	}
-
-	pjs := project_model.GetProjectJoinListByPId(project.Id, false)
-
-	for _, pj := range pjs {
-		inviteBenefitOrder := user_model.GetInviteOrderByRId(pj.OrderId)
-
-		if inviteBenefitOrder == nil {
-			continue
-		}
-
-		s := balance_model.CASH_SOURCE_PROJECT_BENEFIT
-		b := balance_model.GetCashBalanceByWxUIdAndRIdAndSource(inviteBenefitOrder.BenefitWxUId, inviteBenefitOrder.RelateId, s)
-
-		if b == nil {
-			b = new(balance_model.CashBalance).Create(inviteBenefitOrder.BenefitWxUId, inviteBenefitOrder.Count, s, inviteBenefitOrder.RelateId, project.Title)
-			if b != nil {
-				//标志进账
-				inviteBenefitOrder.IsEnterBalance = true
-				inviteBenefitOrder.EnterTime = b.CreatedAt
-				inviteBenefitOrder.Save()
-			}
-		}
-
-	}
-	project.IsSbenefitFinished = true
-	project.Save()
-
-}

+ 0 - 26
go/gopath/src/fohow.com/apps/models/user_model/wx_user.go

@@ -11,7 +11,6 @@ import (
 	"fohow.com/cache"
 	"fohow.com/libs/ali_oss"
 	"fohow.com/libs/tool"
-	"net/http"
 )
 
 const (
@@ -375,31 +374,6 @@ func (self *WxUser) SetInviter(ivId int64) {
 	}
 }
 
-// 是否在第五创主数据库注册
-func (self *WxUser) IsRegisterInD5C() (isRegister bool) {
-	if self.Unionid == "" {
-		isRegister = false
-		return
-	}
-	apiUrl := beego.AppConfig.String("D5CApiHost") + "/v1/user/union_id?union_id=" + self.Unionid
-
-	timeout := time.Duration(2 * time.Second)
-	client := http.Client{
-		Timeout: timeout,
-	}
-	resp, err := client.Get(apiUrl)
-	if err != nil {
-		beego.BeeLogger.Error("IsRegisterInD5C  Http Error %s:  ********", err)
-		return false
-	}
-	defer resp.Body.Close()
-	isRegister = resp.StatusCode == 204
-	if isRegister {
-		// TODO: 冗余一字段,优先使用本地字段;如果取回结果已经注册,则更新本地状态
-	}
-	return
-}
-
 func GetCountByWxUserInviter(id int64) int64 {
 	o := orm.NewOrm()
 	i, err := o.QueryTable(new(WxUser)).Filter("invite_id", id).Count()

+ 3 - 24
go/gopath/src/fohow.com/conf/app.conf

@@ -4,9 +4,9 @@
 
 RunMode = dev
 
-AppName = fohowMall.com
+AppName = winhaMall.com
 HttpAddr = 0.0.0.0
-HttpPort = 25565
+HttpPort = 25567
 
 
 EnableAdmin = false
@@ -22,8 +22,7 @@ inetIp = "127.0.0.1,47.52.141.54,8.129.187.89"
 ######控制放款的定时任务开关
 CanOperateCash = "false"
 
-ApiHost = "https://tfohowapi.hiwavo.com"
-D5CApiHost = "http://testapi.d5c360.com"
+ApiHost = "https://r_api.hiwavo.com"
 WxHost = "http://tfhwx.hiwavo.com"
 
 #专属二维码
@@ -58,8 +57,6 @@ AliDaYuAppKey = "23531135"
 AliDaYuAppSecret = "089035706ec0ea30c065ef42a1b07bb7"
 
 MysqlMaster = root:fohow123!@#@tcp(127.0.0.1:3306)/fohow_test?charset=utf8&parseTime=true
-MysqlDataSource = d5c:D5ctesting@tcp(d5ctestingdb.mysql.rds.aliyuncs.com:3306)/org_db?charset=utf8&parseTime=true
-CowMysqlDataSource = d5c:D5ctesting@tcp(d5ctestingdb.mysql.rds.aliyuncs.com:3306)/cow_test?charset=utf8&parseTime=true
 
 WkhtmltoimgBinPath = /opt/software/wkhtmltox/bin/wkhtmltoimage
 
@@ -82,17 +79,7 @@ Gzh_MessageTemplateId_OpenPrize= "lAYZ7E3LUadQkgRjmZ6TvyQhHmUvhc6drP6lUiSl8ug"
 Gzh_MessageTemplateId_DealUnpay= "dEgLLsKVf_hBqh21nQLpAYmR6t0GNR83JXBqw-Jtc8E"
 Gzh_MessageTemplateId_NewProject= "iJxsToxHLL0vxb7srmaGRfdfLeu7zdisn4wON8M9lsw"
 
-#抽奖中奖到FOHOW玖玖下单秘钥
-RabbitOrderProductKey = "1234567890123456"
 
-#正式项目474、测试项目1054筹中筹项目到FOHOW玖玖下单
-CzcOrderProductKey = "1234567890123456"
-
-# 到第五创查询号码是否已经注册
-CheckIsRegistD5cKey = "1234567890123456"
-
-# 一键绑定微信使用的号码
-BindingWxPhoneKey = "1234567890123456"
 
 
 #######################################################################
@@ -107,7 +94,6 @@ CanOperateCash = "false"
 
 
 ApiHost = "https://ofohowapi.hiwavo.com"
-D5CApiHost = "http://api.d5c360.com"
 WxHost = "http://fhwx.hiwavo.com"
 
 #专属二维码
@@ -144,10 +130,7 @@ AliDaYuAppKey = "23531135"
 AliDaYuAppSecret = "089035706ec0ea30c065ef42a1b07bb7"
 
 MysqlMaster = root:Ud56Ur&fad@tcp(127.0.0.1:3306)/fohow_org?charset=utf8&parseTime=true
-MysqlDataSource = d5c:D5ctesting@tcp(d5ctestingdb.mysql.rds.aliyuncs.com:3306)/org_db?charset=utf8&parseTime=true
-CowMysqlDataSource = d5c:D5ctesting@tcp(d5ctestingdb.mysql.rds.aliyuncs.com:3306)/cow_test?charset=utf8&parseTime=true
 
-#WkhtmltoimgBinPath = "C:/Program Files/wkhtmltopdf/bin/wkhtmltoimage.exe"
 WkhtmltoimgBinPath = /opt/software/wkhtmltox/bin/wkhtmltoimage
 
 SessionName = "fohow_sid"
@@ -170,10 +153,6 @@ Gzh_MessageTemplateId_DealUnpay= "EMWYRXVPtY_jd5EI2ijhWktN3fHoAqMqMNlHQ-hGhpQ"
 Gzh_MessageTemplateId_NewProject= "qafnEW-3Yq9eKPA0FJm_a9auyOJuYWpGAKxzJOjc_TM"
 
 
-# 一键绑定微信使用的号码
-BindingWxPhoneKey = "fd85930e4941d780"
-
-
 #微信支付、企业付款证书
 #小程序商户号证书
 MchCertFile= "/opt/wxpay/fohow_wx/apiclient_cert.pem"

+ 0 - 29
go/gopath/src/fohow.com/libs/kefu/kefu.go

@@ -1,29 +0,0 @@
-package kefu
-
-import (
-	"encoding/json"
-	"fmt"
-	"github.com/astaxie/beego"
-	"fohow.com/libs/tool"
-)
-
-type CheckResult struct {
-	CheckCode string `json:"check_code"`
-	ImgPath   string `json:"img_path"`
-}
-
-func GetKfQrcodeImgFromD5c(unionId string) *CheckResult {
-
-	url := fmt.Sprintf("%s%s%s", beego.AppConfig.String("D5CApiHost"), "/v1/user/kf_qrcode?unionid=", unionId)
-
-	beego.BeeLogger.Warn("GetKfQrcodeImgFromD5c url:%s", url)
-	resp := tool.HttpCall(url, "GET", nil, nil)
-	beego.BeeLogger.Warn("GetKfQrcodeImgFromD5c resp, resp:%s", resp)
-
-	beego.BeeLogger.Warn("---GetKfQrcodeImgFromD5c resp---: %s", resp)
-
-	var result *CheckResult
-	json.Unmarshal([]byte(resp), &result)
-
-	return result
-}

+ 0 - 45
go/gopath/src/fohow.com/libs/user/certification_d5c.go

@@ -1,45 +0,0 @@
-package user
-
-import (
-	"fmt"
-	"github.com/astaxie/beego"
-
-	"encoding/json"
-	"fohow.com/libs/tool"
-	"strings"
-)
-
-type CheckResult struct {
-	CheckCode     string `json:"check_code"`
-	IsCertificate int64  `json:"is_cer"`
-	IdCard        string `json:"icer_card"`
-	RealName      string `json:"ral_name"`
-}
-
-var CHECK_CODE_SUCCESS string = "0001"
-
-func CheckCertificationInD5c(unionId string) *CheckResult {
-
-	if strings.TrimSpace(unionId) == "" {
-		return nil
-	}
-
-	url := fmt.Sprintf("%s%s", beego.AppConfig.String("D5CApiHost"), "/v1/user/check_certification")
-
-	beego.BeeLogger.Warn("CheckCertificationInD5c url:%s", url)
-
-	var params map[string]string = make(map[string]string)
-	params["unionid"] = unionId
-
-	resp := tool.HttpCall(url, "POST", params, nil)
-	beego.BeeLogger.Warn("CheckCertificationInD5c resp, resp:%s", resp)
-
-	var result *CheckResult
-	err := json.Unmarshal([]byte(resp), &result)
-	if err != nil {
-		return nil
-	}
-
-	beego.BeeLogger.Warn("---CheckCertificationInD5c resp result---: %s", result)
-	return result
-}

+ 0 - 10
go/gopath/src/fohow.com/main.go

@@ -18,22 +18,12 @@ func init() {
 	// ORM
 	orm.RegisterDriver("mysql", orm.DRMySQL)
 	orm.RegisterDataBase("default", "mysql", beego.AppConfig.String("MysqlMaster"))
-	orm.RegisterDataBase("data_source", "mysql", beego.AppConfig.String("MysqlDataSource"))
-	orm.RegisterDataBase("cow_data_source", "mysql", beego.AppConfig.String("CowMysqlDataSource"))
 	if beego.AppConfig.String("RunMode") == "dev" {
 		orm.SetMaxIdleConns("default", 1)
 		orm.SetMaxOpenConns("default", 2)
-		orm.SetMaxIdleConns("data_source", 1)
-		orm.SetMaxOpenConns("data_source", 2)
-		orm.SetMaxIdleConns("cow_data_source", 1)
-		orm.SetMaxOpenConns("cow_data_source", 2)
 	} else {
 		orm.SetMaxIdleConns("default", 50)
 		orm.SetMaxOpenConns("default", 100)
-		orm.SetMaxIdleConns("data_source", 25)
-		orm.SetMaxOpenConns("data_source", 50)
-		orm.SetMaxIdleConns("cow_data_source", 25)
-		orm.SetMaxOpenConns("cow_data_source", 50)
 	}
 
 	beego.BConfig.WebConfig.Session.SessionOn = true

+ 11 - 11
go/gopath/src/fohow.com/nginx/ngx_test_config

@@ -6,23 +6,23 @@
 
 server {
     listen       8079;
-    server_name  tfohowapi.hiwavo.com;
+    server_name  r_api.hiwavo.com;
     charset utf-8;
 
-    access_log  /home/rails/fohow/api/go/gopath/src/fohow.com/logs/ngx_access.log  main;
-    error_log   /home/rails/fohow/api/go/gopath/src/fohow.com/logs/ngx_error.log;
+    access_log  /home/rails/winha/api/go/gopath/src/fohow.com/logs/ngx_access.log  main;
+    error_log   /home/rails/winha/api/go/gopath/src/fohow.com/logs/ngx_error.log;
 
     location /.well-known/pki-validation/ {
-      alias /home/rails/fohow/api/go/gopath/src/fohow.com/static/tapi/;
+      alias /home/rails/winha/api/go/gopath/src/fohow.com/static/tapi/;
     }
 
     location =/MP_verify_WKpffc3SRB4yjEzI.txt {
-      root /home/rails/fohow/api/go/gopath/src/fohow.com/static/tapi/;
+      root /home/rails/winha/api/go/gopath/src/fohow.com/static/tapi/;
       #expires  30d;
     }
 
     location =/stcXSY70Qh.txt {
-      root /home/rails/fohow/api/go/gopath/src/fohow.com/static/tapi/;
+      root /home/rails/winha/api/go/gopath/src/fohow.com/static/tapi/;
       #expires  30d;
     }
 
@@ -34,7 +34,7 @@ server {
         proxy_set_header    Host                $host;
         proxy_http_version  1.1;
         proxy_set_header    Connection  "";
-        proxy_pass          http://127.0.0.1:25565;
+        proxy_pass          http://127.0.0.1:25567;
     }
 
    location /ngx {
@@ -46,11 +46,11 @@ server {
 # HTTPS server
 server {
     listen       443 ssl;
-    server_name  tfohowapi.hiwavo.com;
+    server_name  r_api.hiwavo.com;
     charset utf-8;
     #ssl on;
-    ssl_certificate      /home/rails/fohow/api/go/gopath/src/fohow.com/static/tapi/4048551_tfohowapi.hiwavo.com.pem;
-    ssl_certificate_key  /home/rails/fohow/api/go/gopath/src/fohow.com/static/tapi/4048551_tfohowapi.hiwavo.com.key;
+    ssl_certificate      /home/rails/winha/api/go/gopath/src/fohow.com/static/tapi/4048551_tfohowapi.hiwavo.com.pem;
+    ssl_certificate_key  /home/rails/winha/api/go/gopath/src/fohow.com/static/tapi/4048551_tfohowapi.hiwavo.com.key;
 
     ssl_session_cache    shared:SSL:1m;
     ssl_session_timeout  5m;
@@ -66,7 +66,7 @@ server {
         proxy_set_header    Host                $host;
         proxy_http_version  1.1;
         proxy_set_header    Connection  "";
-        proxy_pass           http://tfohowapi.hiwavo.com:8079;
+        proxy_pass           http://r_api.hiwavo.com:8079;
     }
 }