24 lines
515 B
Markdown
24 lines
515 B
Markdown
# goverter
|
|
|
|
[GitHub地址](https://github.com/jmattheis/goverter)
|
|
|
|
类型转换器,可以用于类型的转换,比如下面的代码
|
|
|
|
```go
|
|
func (l *CreatePopupLogic) CreatePopup(in *backgroundrpcmodel.ResPopup) (*backgroundrpcmodel.ResResult, error) {
|
|
_, err := l.svcCtx.PopupModel.Insert(l.ctx, u.Convert.SysPopupR2S(in.Info))
|
|
if err != nil {
|
|
return nil, rerr.NewFromSQL(err)
|
|
}
|
|
return &backgroundrpcmodel.ResResult{
|
|
Result: true,
|
|
}, nil
|
|
}
|
|
```
|
|
|
|
使用
|
|
|
|
```
|
|
goverter gen .
|
|
```
|