package com.izouma.nineth.web;

import com.izouma.nineth.domain.GiftOrder;
import com.izouma.nineth.exception.BusinessException;
import com.izouma.nineth.repo.GiftOrderRepo;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/giftOrder")
@AllArgsConstructor
public class GiftOrderController extends BaseController {
    private GiftOrderRepo giftOrderRepo;

    @GetMapping("/get/{id}")
    public GiftOrder get(@PathVariable Long id) {
        return giftOrderRepo.findById(id).orElseThrow(new BusinessException("无记录"));
    }
}
