31 lines
617 B
Go
31 lines
617 B
Go
package logic
|
|
|
|
import (
|
|
ad "lone-services/rpc/ad/pb"
|
|
"lone-services/services/ad/internal/dao"
|
|
)
|
|
|
|
func toAdItem(row dao.AdInfo) *ad.Item {
|
|
return &ad.Item{
|
|
Id: int64(row.Id),
|
|
Type: uint32(row.Type),
|
|
Image: row.Image,
|
|
Content: row.Content,
|
|
Reason: row.Reason,
|
|
Status: uint32(row.Status),
|
|
Url: row.Url,
|
|
UpdateTime: row.UpdateTime,
|
|
CreateTime: row.CreateTime,
|
|
}
|
|
}
|
|
|
|
func toAdWebItem(row dao.AdWebInfo) *ad.WebItem {
|
|
return &ad.WebItem{
|
|
Id: int64(row.Id),
|
|
Type: uint32(row.Type),
|
|
Image: row.Image,
|
|
Content: row.Content,
|
|
Url: row.Url,
|
|
}
|
|
}
|