| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- package com.chuanghai.ihotel.controller;
- import java.util.Arrays;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.DeleteMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.PutMapping;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.RestController;
- import com.chuanghai.ihotel.entity.HotelOderRefundEntity;
- import com.chuanghai.ihotel.service.HotelOderRefundService;
- import com.chuanghai.ihotel.common.utils.PageUtils;
- import com.chuanghai.ihotel.common.utils.CommonResult;
- import com.chuanghai.ihotel.common.utils.PageParam;
- /**
- * 订单退款表
- *
- * @author codingliang
- * @email codingliang@gmail.com
- * @date 2022-07-27 10:02:04
- */
- @RestController
- @RequestMapping("hotelOderRefund")
- public class HotelOderRefundController {
- @Autowired
- private HotelOderRefundService hotelOderRefundService;
- /**
- * 列表
- */
- @GetMapping("/list")
- public CommonResult<PageUtils<HotelOderRefundEntity>> list(PageParam pageParam){
- PageUtils page = hotelOderRefundService.queryPage(pageParam);
- return CommonResult.ok().setResult(page);
- }
- /**
- * 信息
- */
- @GetMapping("/info/{id}")
- public CommonResult<HotelOderRefundEntity> info(@PathVariable("id") Long id){
- HotelOderRefundEntity hotelOderRefund = hotelOderRefundService.getById(id);
- return CommonResult.ok().setResult(hotelOderRefund);
- }
- /**
- * 保存
- */
- @PostMapping("/save")
- public CommonResult<String> save(@RequestBody HotelOderRefundEntity hotelOderRefund){
- hotelOderRefundService.save(hotelOderRefund);
- return CommonResult.ok();
- }
- /**
- * 修改
- */
- @PutMapping("/update")
- public CommonResult<String> update(@RequestBody HotelOderRefundEntity hotelOderRefund){
- boolean flag = hotelOderRefundService.updateById(hotelOderRefund);
- if (flag) {
- return CommonResult.ok();
- } else {
- return CommonResult.fail();
- }
- }
- /**
- * 删除
- */
- @DeleteMapping("/delete")
- public CommonResult<String> delete(@RequestBody Long[] ids){
- boolean flag = hotelOderRefundService.removeByIds(Arrays.asList(ids));
- if (flag) {
- return CommonResult.ok();
- } else {
- return CommonResult.fail();
- }
- }
- }
|