修改语音配置
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
"unicode/utf8"
|
||||
)
|
||||
@@ -16,7 +15,7 @@ func TestPrintMsg(t *testing.T) {
|
||||
msg := &model.PrintMsg{
|
||||
ModelIDCULD: model.ModelIDCULD{},
|
||||
PrintNo: "20220707000002",
|
||||
Content: "<sound>61</sound><sound>62</sound>",
|
||||
Content: "<sound>1,2,3</sound><center>居中文字</center><sound>4,5,6</sound><center>居中</center>",
|
||||
OrderNo: "9999999991", // 2147483648111
|
||||
Status: 0,
|
||||
Comment: "",
|
||||
@@ -25,7 +24,6 @@ func TestPrintMsg(t *testing.T) {
|
||||
|
||||
data, err := buildMsg(msg)
|
||||
|
||||
fmt.Println("data=", fmt.Sprintf("%s", string(data...)))
|
||||
fmt.Println("data=", string(data))
|
||||
fmt.Println("err=", err)
|
||||
}
|
||||
@@ -63,28 +61,5 @@ func TestCheckSum(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTen216(t *testing.T) {
|
||||
fmt.Println(toHex(16))
|
||||
}
|
||||
|
||||
func toHex(ten int) string {
|
||||
m := 0
|
||||
hex := make([]int, 0)
|
||||
for {
|
||||
m = ten % 16
|
||||
ten = ten / 16
|
||||
if ten == 0 {
|
||||
hex = append(hex, m)
|
||||
break
|
||||
}
|
||||
hex = append(hex, m)
|
||||
}
|
||||
hexStr := []string{}
|
||||
for i := len(hex) - 1; i >= 0; i-- {
|
||||
if hex[i] >= 10 {
|
||||
hexStr = append(hexStr, fmt.Sprintf("%c", 'A'+hex[i]-10))
|
||||
} else {
|
||||
hexStr = append(hexStr, fmt.Sprintf("%d", hex[i]))
|
||||
}
|
||||
}
|
||||
return strings.Join(hexStr, "")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user