Merge branch 'develop' of https://gitee.com/fusenpack/fusenapi into develop
This commit is contained in:
commit
169c167d4a
19
constants/domain.go
Normal file
19
constants/domain.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package constants
|
||||
|
||||
// api域名
|
||||
const API_URL = "https://fusenapi.kayue.cn:8010"
|
||||
|
||||
// 后台域名
|
||||
const BACK_URL = "http://fusenadmin.kayue.cn:8009"
|
||||
|
||||
// h5域名
|
||||
const H5_URL = "https://fusenh5.kayue.cn:8011"
|
||||
|
||||
// vue域名
|
||||
const VUE_URL = "https://fusenh5.kayue.cn:8011"
|
||||
|
||||
// 后台v2域名
|
||||
const BACKEND_URL = "https://fusenv2admin.kayue.cn:8014/#/"
|
||||
|
||||
// 二维码域名
|
||||
const QRCODE_URL = "http://qrcode.fusenpack.com/site/go/"
|
|
@ -34,7 +34,7 @@ const MAIN_INVOICE_HTML = `<!DOCTYPE html>
|
|||
<tr height="15px"></tr>
|
||||
<tr>
|
||||
<td align="left" style="width: 50%;">
|
||||
<span style="color: #666666;font-weight: 400;font-size: 22px; display: block;">' . $sn . '</span>
|
||||
<span style="color: #666666;font-weight: 400;font-size: 22px; display: block;">{{order_sn}}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr height="30px"></tr>
|
||||
|
|
|
@ -18,7 +18,7 @@ import (
|
|||
func GetOrderInvoiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
/*var (
|
||||
var (
|
||||
// 定义错误变量
|
||||
err error
|
||||
// 定义用户信息变量
|
||||
|
@ -51,7 +51,7 @@ func GetOrderInvoiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||
} else {
|
||||
// 如果claims为nil,则认为用户身份为白板用户
|
||||
userinfo = &auth.UserInfo{UserId: 0, GuestId: 0}
|
||||
}*/
|
||||
}
|
||||
|
||||
var req types.GetOrderInvoiceReq
|
||||
// 如果端点有请求结构体,则使用httpx.Parse方法从HTTP请求体中解析请求数据
|
||||
|
@ -65,7 +65,7 @@ func GetOrderInvoiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||
}
|
||||
// 创建一个业务逻辑层实例
|
||||
l := logic.NewGetOrderInvoiceLogic(r.Context(), svcCtx)
|
||||
resp := l.GetOrderInvoice(&req, &auth.UserInfo{39, 0})
|
||||
resp := l.GetOrderInvoice(&req, userinfo)
|
||||
// 如果响应不为nil,则使用httpx.OkJsonCtx方法返回JSON响应;
|
||||
if resp != nil {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
|
|
|
@ -171,7 +171,8 @@ func (l *GetOrderInvoiceLogic) GetOrderInvoice(req *types.GetOrderInvoiceReq, us
|
|||
mainHtml = strings.ReplaceAll(mainHtml, "{{name}}", userName)
|
||||
mainHtml = strings.ReplaceAll(mainHtml, "{{first_style1}}", firstStyle1)
|
||||
mainHtml = strings.ReplaceAll(mainHtml, "{{first_style2}}", firstStyle2)
|
||||
mainHtml = strings.ReplaceAll(mainHtml, "{{h5Url}}", "http://www.baidu.com") // TODO ????????????
|
||||
mainHtml = strings.ReplaceAll(mainHtml, "{{h5Url}}", constants.H5_URL)
|
||||
mainHtml = strings.ReplaceAll(mainHtml, "{{order_sn}}", *orderInfo.Sn)
|
||||
mainHtml = strings.ReplaceAll(mainHtml, "{{order_expire_time}}", time.Unix(*orderInfo.Ctime, req.TimeZone*60).Format("02 Jan,2006"))
|
||||
//html内容页面转pdf的base64
|
||||
prfBase64, err := pdf.HtmlToPdfBase64(mainHtml, 2)
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
"os"
|
||||
)
|
||||
|
||||
// 带logo的二维码图片生成 content-二维码内容 size-像素单位 outPath 保存路径(传空则不保存) logoPath-logo文件路径(传空就不带) x:x轴整体偏移 y:y轴整体偏移
|
||||
// 带logo的二维码图片生成 content-二维码内容 size-像素单位 outPath 保存路径(传空则不保存) disableBorder是否不启用边框 logoPath-logo文件路径(传空就不带) x:x轴整体偏移 y:y轴整体偏移
|
||||
func CreateQrCodeBs64WithLogo(content, outPath string, logoPath string, size, x, y int, disableBorder bool) (data string, err error) {
|
||||
code, err := qrcode.New(content, qrcode.High)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue
Block a user