refactor: reorganize modules and add Linux build tooling
This commit is contained in:
32
module/ec/mall/internal/logic/staff/ref.go
Normal file
32
module/ec/mall/internal/logic/staff/ref.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package staff
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"bsm/full/module/ec/mall/internal/models"
|
||||
pb "bsm/full/module/ec/mall/pb"
|
||||
)
|
||||
|
||||
func ref(data []*models.MallStaff) (list []*pb.StaffItem) {
|
||||
if len(data) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
for _, in := range data {
|
||||
row := pb.StaffItem{
|
||||
Identity: in.Identity,
|
||||
Name: in.Name,
|
||||
Account: in.Account,
|
||||
Password: "***",
|
||||
Profile: in.Profile,
|
||||
Phone: in.Phone,
|
||||
Email: in.Email,
|
||||
Avatar: in.Avatar,
|
||||
Role: "staff",
|
||||
CreatedAt: in.CreatedAt.Format(time.DateTime),
|
||||
}
|
||||
|
||||
list = append(list, &row)
|
||||
}
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user