修改打印模板
This commit is contained in:
46
model/app_model/app_print.go
Normal file
46
model/app_model/app_print.go
Normal file
@@ -0,0 +1,46 @@
|
||||
package app_model
|
||||
|
||||
type AddPrintReq struct {
|
||||
AppID int `json:"app_id" form:"app_id" binding:"required"`
|
||||
Prints string `json:"prints" form:"prints" binding:"required"`
|
||||
}
|
||||
|
||||
type QueryPrintReq struct {
|
||||
AppID int `json:"app_id" form:"app_id" binding:"required"` // appId
|
||||
PrintNo string `json:"print_no" form:"print_no"` //打印机编号
|
||||
Name string `json:"name" form:"name"` //打印机备注,模糊
|
||||
Status int `json:"status" form:"status"` //打印机状态。正常还是缺纸
|
||||
IsOnline int `json:"is_online" form:"is_online"` //在线状态。1在线,0离线
|
||||
Offset int `json:"offset" form:"offset"` // 跳过
|
||||
PageSize int `json:"page_size" form:"page_size" binding:"required"` // 页数
|
||||
}
|
||||
|
||||
type DeletePrintReq struct {
|
||||
AppID int `json:"app_id" form:"app_id" binding:"required"`
|
||||
PrintNos string `json:"print_nos" form:"print_nos" binding:"required"` //打印机编号s
|
||||
}
|
||||
|
||||
type UpdatePrintReq struct {
|
||||
AppID int `json:"app_id" form:"app_id" binding:"required"` // appId
|
||||
PrintNo string `json:"print_no" form:"print_no" binding:"required"` //打印机编号
|
||||
Name string `json:"name" form:"name"` //打印机备注,模糊
|
||||
Sound string `json:"sound" form:"sound"` //声音类型
|
||||
Volume int `json:"volume" form:"volume"` //音量大小
|
||||
}
|
||||
|
||||
type TestPrintReq struct {
|
||||
AppID int `json:"app_id" form:"app_id" binding:"required"`
|
||||
PrintNo string `json:"print_no" form:"print_no" binding:"required"` //打印机编号
|
||||
OrderNo int `json:"order_no" form:"order_no" binding:"required"` //订单序号
|
||||
Content string `json:"content" form:"content"` //打印内容
|
||||
}
|
||||
|
||||
type GetPrintMsg struct {
|
||||
AppID int `json:"app_id" form:"app_id" binding:"required"`
|
||||
PrintNo string `json:"print_no" form:"print_no" binding:"required"` //打印机编号
|
||||
MsgID string `json:"msg_id" form:"msg_id"` //消息ID
|
||||
BeginAt string `json:"begin_at" form:"begin_at"` //开始时间 默认一周内
|
||||
EndAt string `json:"end_at" form:"end_at"`
|
||||
Offset int `json:"offset" form:"offset"`
|
||||
PageSize int `json:"page_size" form:"page_size" binding:"required"`
|
||||
}
|
||||
35
model/app_model/app_user_login.go
Normal file
35
model/app_model/app_user_login.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package app_model
|
||||
|
||||
// 小程序配置
|
||||
const (
|
||||
WeChatAPPID = "xxx"
|
||||
WeChatAPPSecret = "xxx"
|
||||
)
|
||||
|
||||
// LoginTypeWechat 登录配置
|
||||
const (
|
||||
LoginTypeWechat = "wechatMin" // 微信授权登录
|
||||
LoginTypePhone = "wechatPhone" // 电话登录
|
||||
LoginPassword = "location" // 账号登录
|
||||
)
|
||||
|
||||
const (
|
||||
TokenHeader = "TOKEN"
|
||||
TokenVer = "V2"
|
||||
TokenTypeSep = "."
|
||||
)
|
||||
|
||||
// WeChatPhoneNumberParam 微信登陆
|
||||
type WeChatPhoneNumberParam struct {
|
||||
EncryptedData string `json:"encrypted_data" form:"encrypted_data" binding:"required"` // 加密信息
|
||||
IV string `json:"iv" form:"iv" binding:"required"` // 加密算法初始量
|
||||
NickName string `json:"nick_name" form:"nick_name" binding:"required"` // 昵称
|
||||
HeadUrl string `json:"head_url" form:"head_url" binding:"required"` //头像图片地址
|
||||
Code string `json:"code" form:"code" binding:"required"` //code
|
||||
}
|
||||
|
||||
type WxLoginReq struct {
|
||||
Code string `json:"code" form:"code"` // 微信授权登录使用
|
||||
Phone string `json:"phone" form:"phone"` // 微信和电话登录使用
|
||||
Password string `json:"password" form:"password"` // 密码登录
|
||||
}
|
||||
1
model/app_model/print_temp.go
Normal file
1
model/app_model/print_temp.go
Normal file
@@ -0,0 +1 @@
|
||||
package app_model
|
||||
14
model/app_model/print_test.go
Normal file
14
model/app_model/print_test.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package app_model
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPrintOrder(t *testing.T) {
|
||||
aa := "1E 00 C1 02 00 FF 50 00 01 1B 40 1B 59 41 55 01 2D 20 2D 20 2D 20 2D\n20 2D 20 2D 20 2D 20 2D 20 2D 20 2D 20 2D 20 2D 20 2D 2D 20 2D 20 2D\n20 0A B2 CB C3 FB 20 20 20 20 20 20 20 20 CA FD C1 BF 20 20 20 20 20\n20 20 20 BD F0 B6 EE 0A B0 D7 C7 D0 BC A6 20 20 20 20 20 20 31 20 20\n20 20 20 20 20 20 20 20 20 31 35 0A 2D 20 2D 20 2D 20 2D 20 2D 20 2D\n20 2D 20 2D 20 2D 20 2D 20 2D 20 2D 20 2D 2D 20 2D 20 2D 20 0A 1b 61\n02 1b 21 30 D7 DC BD F0 B6 EE 3A 31 35 0A 1D 58 02 1b 5a 00 01 06 16\n00 68 74 74 70 73 3a 2f 2f 77 77 77 2e 62 61 69 64 75 2e 63 6f 6d 2f\n1b 61 00 0A 0A 0A 1B 40 FF"
|
||||
cc := strings.Replace(aa, " ", "", -1)
|
||||
dd := strings.Replace(cc, "\n", "", -1)
|
||||
fmt.Println(dd)
|
||||
}
|
||||
53
model/app_model/system_temp.go
Normal file
53
model/app_model/system_temp.go
Normal file
@@ -0,0 +1,53 @@
|
||||
package app_model
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
TempTypeMerchantUser = `user_store` // 商户自定义模板-商户看
|
||||
TempTypeConsumerUser = `user_consumer` // 商户自定义模板-消费用户看
|
||||
TempTypeMerchant = `sys_store` // 系统模板-商户看
|
||||
TempTypeConsumer = `sys_consumer` // 系统模板-消费用户看
|
||||
)
|
||||
|
||||
const (
|
||||
SystemTempSizeBig = "big"
|
||||
SystemTempSizeSmall = "small"
|
||||
SystemTempSizeMedium = "medium"
|
||||
)
|
||||
|
||||
type SystemTemp struct {
|
||||
ID int `json:"id" db:"id"`
|
||||
CreatedAt *time.Time `json:"created_at" db:"created_at"`
|
||||
UpdatedAt *time.Time `json:"updated_at" db:"updated_at"`
|
||||
LastOperator string `json:"last_operator" db:"last_operator"`
|
||||
DeletedAt *time.Time `json:"deleted_at" db:"deleted_at"`
|
||||
TempName string `json:"temp_name" db:"temp_name"` // 模板名称
|
||||
TempRank string `json:"temp_rank" db:"temp_rank"` // 模板顺序
|
||||
Temp string `json:"temp" db:"temp"` // 模板
|
||||
UserId string `json:"user_id" db:"user_id"` // 所属用户
|
||||
TempType string `json:"temp_type" db:"temp_type"` // 模板类型
|
||||
TempSize string `json:"temp_size" db:"temp_size"` // 模板尺寸 big/medium/small
|
||||
PrintSn string `json:"print_sn" db:"print_sn"` // 模板所属打印机
|
||||
IsUse int `json:"is_use" db:"is_use"` // 默认使用 1-使用/2-不使用
|
||||
}
|
||||
|
||||
type AddTemp struct {
|
||||
ID int `json:"id" form:"id"` // 修改时传入
|
||||
TempName string `json:"temp_name" form:"temp_name" binding:"required"` // 模板名称
|
||||
Temp string `json:"temp" form:"temp" binding:"required"` // 模板
|
||||
UserId string `json:"user_id" form:"user_id"` // 所属用户
|
||||
TempType string `json:"temp_type" form:"temp_type" binding:"required"` // 模板类型
|
||||
TempSize string `json:"temp_size" form:"temp_size" binding:"required"` // 模板尺寸 big/medium/small
|
||||
PrintSn string `json:"print_sn" db:"print_sn" binding:"required"` // 模板所属打印机
|
||||
IsUse int `json:"is_use" db:"is_use" binding:"required"` // 默认使用 1-使用/2-不使用
|
||||
}
|
||||
|
||||
type TempContext struct {
|
||||
Rank int `json:"rank"` // 排序值 1
|
||||
DefinitionName string `json:"definition_name"` // 用户定义字段名称 下单时间
|
||||
MatchContext string `json:"match_context"` // 匹配字段 payOrderTime
|
||||
}
|
||||
|
||||
type DeleteTemp struct {
|
||||
ID int `json:"id" form:"id"` // 修改时传入
|
||||
}
|
||||
@@ -79,9 +79,9 @@ type FlowConfig struct {
|
||||
}
|
||||
|
||||
type PrintInfo struct {
|
||||
PrintNo string `json:"print_no" form:"print_no" binding:"required"` //打印机编号
|
||||
Name string `json:"name" form:"name"` //打印机备注
|
||||
//SIM string `json:"sim" form:"sim"` //流量卡号码
|
||||
PrintNo string `json:"print_no" form:"print_no" binding:"required"` //打印机编号
|
||||
Name string `json:"name" form:"name"` //打印机备注
|
||||
PrintKey string `json:"print_key" form:"print_key"` //打印机识别码
|
||||
}
|
||||
|
||||
type PagedInfo struct {
|
||||
@@ -98,30 +98,31 @@ type ModelIDCULD struct {
|
||||
}
|
||||
|
||||
type User struct {
|
||||
ID int `json:"id" db:"id"`
|
||||
CreatedAt *time.Time `json:"created_at" db:"created_at"`
|
||||
UpdatedAt *time.Time `json:"updated_at" db:"updated_at"`
|
||||
LastOperator string `json:"last_operator" db:"last_operator"`
|
||||
DeletedAt *time.Time `json:"deleted_at" db:"deleted_at"`
|
||||
UserID string `json:"user_id" db:"user_id"` // 内部唯一标识
|
||||
Password string `json:"password"` //密码
|
||||
Name string `json:"name"` // 外部显示标识(当前可以重复)
|
||||
Mobile string `json:"mobile"`
|
||||
Email string `json:"email"`
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
Status int8 `json:"status"`
|
||||
Type int8 `json:"type"` // 用户类型
|
||||
Company string `json:"company"` //公司名称
|
||||
CityCode int `json:"city_code" db:"city_code"`
|
||||
DistrictCode int `json:"district_code" db:"district_code"`
|
||||
Address string `json:"address"`
|
||||
|
||||
IDCardNo string `json:"id_card_no" db:"id_card_no"` // 身份证号
|
||||
Remark string `json:"remark"`
|
||||
|
||||
ID int `json:"id" db:"id"`
|
||||
CreatedAt *time.Time `json:"created_at" db:"created_at"`
|
||||
UpdatedAt *time.Time `json:"updated_at" db:"updated_at"`
|
||||
LastOperator string `json:"last_operator" db:"last_operator"`
|
||||
DeletedAt *time.Time `json:"deleted_at" db:"deleted_at"`
|
||||
UserID string `json:"user_id" db:"user_id"` // 内部唯一标识
|
||||
Password string `json:"password"` //密码
|
||||
Name string `json:"name"` // 外部显示标识(当前可以重复)
|
||||
Mobile string `json:"mobile"`
|
||||
Email string `json:"email"`
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
Status int8 `json:"status"` // 用户状态 1-正常/2-禁用
|
||||
Type int8 `json:"type"` // 用户类型 1-管理用户/2-微信用户/3-管理微信统一账户
|
||||
Company string `json:"company"` //公司名称
|
||||
CityCode int `json:"city_code" db:"city_code"`
|
||||
DistrictCode int `json:"district_code" db:"district_code"`
|
||||
Address string `json:"address"`
|
||||
IDCardNo string `json:"id_card_no" db:"id_card_no"` // 身份证号
|
||||
Remark string `json:"remark"`
|
||||
LastLoginAt *time.Time `json:"last_login_at" db:"last_login_at"`
|
||||
LastLoginIP string `json:"last_login_ip" db:"last_login_ip"`
|
||||
LastLoginType string `json:"last_login_type" db:"last_login_type"`
|
||||
LastLoginType string `json:"last_login_type" db:"last_login_type"` // 最后登录类型
|
||||
OpenId string `json:"open_id" db:"open_id"` // 微信用户openId
|
||||
UnionId string `json:"union_id" db:"union_id"` // 微信用户Id
|
||||
|
||||
}
|
||||
|
||||
type Apps struct {
|
||||
@@ -188,6 +189,7 @@ type Printer struct {
|
||||
Volume int `json:"volume"` //音量,1-5 ,对应打印机2-10
|
||||
FlowFlag int `json:"flow_flag" db:"flow_flag"` //是否超流量了,1表示超了
|
||||
OfflineCount int `json:"-" db:"offline_count"` //掉线次数
|
||||
UserId string `json:"user_id" db:"user_id"` //打印机所属用户
|
||||
}
|
||||
|
||||
type PrintMsg struct {
|
||||
@@ -198,7 +200,7 @@ type PrintMsg struct {
|
||||
DeletedAt *time.Time `json:"deleted_at" db:"deleted_at"`
|
||||
MsgID string `json:"msg_id" db:"msg_id"` //消息ID
|
||||
PrintNo string `json:"print_no" db:"print_no"` //打印机编号
|
||||
OrderNo int `json:"order_no" db:"order_no"` //订单序号
|
||||
OrderNo string `json:"order_no" db:"order_no"` //订单序号
|
||||
Content string `json:"content"` //订单内容
|
||||
Status int `json:"status"` //打印状态
|
||||
Comment string `json:"comment"` //失败原因
|
||||
@@ -256,3 +258,10 @@ type NewConfig struct {
|
||||
Key string `json:"key"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
// CallBack 公共返回参数
|
||||
type CallBack struct {
|
||||
Data string `json:"data"`
|
||||
Code string `json:"code"`
|
||||
Desc string `json:"desc"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user