refactor: reorganize modules and add Linux build tooling
This commit is contained in:
28
module/ec/mall/internal/logic/ads/ref.go
Normal file
28
module/ec/mall/internal/logic/ads/ref.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package ads
|
||||
|
||||
import (
|
||||
"bsm/full/module/ec/mall/internal/models"
|
||||
pb "bsm/full/module/ec/mall/pb"
|
||||
"git.apinb.com/bsm-sdk/core/vars"
|
||||
)
|
||||
|
||||
func ref(data []*models.MallAds) (list []*pb.AdsItem) {
|
||||
if len(data) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
for _, in := range data {
|
||||
row := pb.AdsItem{
|
||||
Id: int64(in.ID),
|
||||
Title: in.Title,
|
||||
PosKey: in.PosKey,
|
||||
Content: in.Content,
|
||||
Type: int32(in.Type),
|
||||
ToUrl: in.ToUrl,
|
||||
CreatedAt: in.CreatedAt.Format(vars.YYYY_MM_DD_HH_MM_SS),
|
||||
}
|
||||
|
||||
list = append(list, &row)
|
||||
}
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user