v1.1
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"ycc-server/app/main/model"
|
||||
"ycc-server/common/xerr"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
@@ -32,6 +33,7 @@ func (l *AdminCreateNotificationLogic) AdminCreateNotification(req *types.AdminC
|
||||
startDate, _ := time.Parse("2006-01-02", req.StartDate)
|
||||
endDate, _ := time.Parse("2006-01-02", req.EndDate)
|
||||
data := &model.GlobalNotifications{
|
||||
Id: uuid.NewString(),
|
||||
Title: req.Title,
|
||||
Content: req.Content,
|
||||
NotificationPage: req.NotificationPage,
|
||||
@@ -45,6 +47,6 @@ func (l *AdminCreateNotificationLogic) AdminCreateNotification(req *types.AdminC
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "创建通知失败, err: %v, req: %+v", err, req)
|
||||
}
|
||||
id, _ := result.LastInsertId()
|
||||
return &types.AdminCreateNotificationResp{Id: id}, nil
|
||||
_ = result
|
||||
return &types.AdminCreateNotificationResp{Id: data.Id}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user