4feb1f61f2
map与struct之间转换的处理工具使用示例,参考代码地址:https://github.com/mitchellh/mapstructure json与struct之间转换处理工具使用示例
21 lines
309 B
Go
21 lines
309 B
Go
/*
|
||
* @Author : huangzj
|
||
* @Time : 2020/3/26 18:18
|
||
* @Description:
|
||
*/
|
||
|
||
package entity
|
||
|
||
import "time"
|
||
|
||
type UserType struct {
|
||
UserTypeId int
|
||
UserTypeName string
|
||
}
|
||
|
||
type User struct {
|
||
UserType UserType `jpath:"userType"`
|
||
LoginName string `jpath:"loginName"`
|
||
T time.Time `jpath:"t"`
|
||
}
|