devfeel / mapper

A simple and easy go tools for auto mapper map to struct, struct to map, struct to struct, slice to slice, map to slice, map to json.
MIT License
390 stars 34 forks source link

MapperSlice #33

Closed Ssummer520 closed 1 year ago

Ssummer520 commented 2 years ago

type UserInfo struct { //Name string gorm:"name" //Sex int gorm:"sex" //Age int gorm:"age" //Phone string gorm:"phone"

Name string
//Sex  int
Age      int
Phone    string
PassWord string

}

type UserListOutPutDto struct { Name string Age int Phone string } 当我给output加 json标识的时候 数组无法转换成功

devfeel commented 2 years ago

转换代码发出来看下

Ssummer520 commented 2 years ago

转换代码发出来看下 我往 属性旁边加了一个 mapper Name 大写的就匹配成功了