go-common/app/interface/main/mcn/model/mcnmodel/reply_test.go

51 lines
1021 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package mcnmodel
import (
"encoding/json"
"fmt"
model2 "go-common/app/admin/main/mcn/model"
"go-common/app/interface/main/mcn/model"
"testing"
)
type replyCommon struct {
Message string `json:"message"`
Code int `json:"code"`
Data interface{} `json:"data"`
}
func createReply(data interface{}) *replyCommon {
return &replyCommon{
Message: "",
Code: 0,
Data: data,
}
}
func printReply(data interface{}) {
var r = createReply(data)
var result, _ = json.MarshalIndent(r, "", " ")
fmt.Printf(string(result) + "\n")
}
// var now = xtime.Time(time.Now().Unix())
func TestPrintMcnUpDataInfo(t *testing.T) {
var r = McnGetUpListReply{
Result: []*McnUpDataInfo{{}},
PageResult: model.PageResult{},
}
defer func() {}()
printReply(r)
}
func TestPrintMcnGetUpPermitReply(t *testing.T) {
var r = McnGetUpPermitReply{
Old: &model2.Permits{},
New: &model2.Permits{},
ContractLink: "http://xxx.xx/adi.pdf",
}
defer func() {}()
printReply(r)
}