You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
556 B
23 lines
556 B
package reservation
|
|
|
|
import (
|
|
"context"
|
|
|
|
"practice_Go/api/reservation/v1"
|
|
"practice_Go/internal/dao"
|
|
"practice_Go/internal/model/do"
|
|
"practice_Go/internal/model/dto"
|
|
)
|
|
|
|
func (c *ControllerV1) AddReservation(ctx context.Context, req *v1.AddReservationReq) (*dto.Result, error) {
|
|
res := &v1.AddReservationRes{}
|
|
_, err := dao.GoLiveReservations.Ctx(ctx).Data(do.GoLiveReservations{
|
|
LiveId: req.Id,
|
|
UserId: req.UserId,
|
|
}).Insert()
|
|
if err != nil {
|
|
return dto.Error(err.Error()), nil
|
|
}
|
|
res.Success = true
|
|
return dto.SuccessWithData(res), nil
|
|
}
|