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.

21 lines
472 B

7 months ago
  1. package reservation
  2. import (
  3. "context"
  4. "practice_Go/api/reservation/v1"
  5. "practice_Go/internal/dao"
  6. "practice_Go/internal/model/do"
  7. )
  8. func (c *ControllerV1) AddReservation(ctx context.Context, req *v1.AddReservationReq) (res *v1.AddReservationRes, err error) {
  9. res = &v1.AddReservationRes{}
  10. _, err = dao.GoLiveReservations.Ctx(ctx).Data(do.GoLiveReservations{
  11. LiveId: req.Id,
  12. UserId: req.UserId,
  13. }).Insert()
  14. if err == nil {
  15. res.Success = true
  16. }
  17. return
  18. }