package consts var HeadTypeMap = map[int64]string{ 1: "企业", 2: "个人", } func GetHeadType(HeadType int64) string { toast, contain := HeadTypeMap[HeadType] if contain { return toast } return "未知" } var InvoiceTypeMap = map[int64]string{ 1: "数电普票", 2: "数电专票", } func GetInvoiceType(InvoiceType int64) string { toast, contain := InvoiceTypeMap[InvoiceType] if contain { return toast } return "未知" }