package com.red.circle.console.adapter.app.user;


import com.red.circle.console.app.service.app.user.UserCustomGiftService;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.inner.model.cmd.user.UserCustomGiftQryCmd;
import com.red.circle.other.inner.model.dto.user.UserCustomGiftRecordDTO;
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;

/**
 * <p>
 * 用户领取专属礼物记录 前端控制器.
 * </p>
 *
 * @author zongpubin on 2024-01-08 18:11
 */
@RestController
@AllArgsConstructor
@RequestMapping("/user/custom-gift")
public class UserCustomGiftRecordRestController extends BaseController {

  private final UserCustomGiftService userCustomGiftService;

  @GetMapping
  public PageResult<UserCustomGiftRecordDTO> getCustomGift(UserCustomGiftQryCmd query) {
    return userCustomGiftService.getCustomGift(query);
  }

  /**
   * 切换用户上传专属礼物状态.
   */
  @GetMapping("/{id}/{status}")
  public void switchStatus(@PathVariable("id") Long id,
      @PathVariable("status") Boolean status) {
    userCustomGiftService.switchStatus(id, status);
  }


}
