Closed Ssummer520 closed 1 year ago
type UserInfo struct { //Name string gorm:"name" //Sex int gorm:"sex" //Age int gorm:"age" //Phone string gorm:"phone"
gorm:"name"
gorm:"sex"
gorm:"age"
gorm:"phone"
Name string //Sex int Age int Phone string PassWord string
}
type UserListOutPutDto struct { Name string Age int Phone string } 当我给output加 json标识的时候 数组无法转换成功
转换代码发出来看下
转换代码发出来看下 我往 属性旁边加了一个 mapper Name 大写的就匹配成功了
type UserInfo struct { //Name string
gorm:"name"
//Sex intgorm:"sex"
//Age intgorm:"age"
//Phone stringgorm:"phone"
}
type UserListOutPutDto struct { Name string Age int Phone string } 当我给output加 json标识的时候 数组无法转换成功