package notice

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.MallNotice) (list []*pb.NoticeItem) {
	if len(data) == 0 {
		return
	}

	for _, in := range data {
		row := pb.NoticeItem{
			Identity:      in.Identity,
			Title:         in.Title,
			StoreId:       int64(in.Store_ID),
			StoreIdentity: in.Store_Identity,
			Author:        in.Author,
			Content:       in.Content,
			CreatedAt:     in.CreatedAt.Format(vars.YYYY_MM_DD_HH_MM_SS),
			Status:        int64(in.Status),
		}

		list = append(list, &row)
	}
	return
}
