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


import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.app.service.user.user.RedPacketSkinService;
import com.red.circle.other.inner.model.cmd.material.PropsRedPacketSkinCmd;
import com.red.circle.other.inner.model.dto.material.PropsRedPacketSkinDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 红包皮肤图片表 - 道具.
 * </p>
 *
 * @author pengshigang on 2023-11-08 09:40
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/material/props/red-packet/skin")
public class RedPacketSkinRestController extends BaseController {

  private final RedPacketSkinService redPacketSkinService;

  /**
   * 根据ID获得资源信息.
   */
  @GetMapping
  public PropsRedPacketSkinDTO getRedPacketSkinById(Long id) {
    return redPacketSkinService.getPropsRedPacketSkin(id);
  }


  @PostMapping("/save")
  public void saveRedPacketSkin(@RequestBody @Validated PropsRedPacketSkinCmd skinParam) {
    redPacketSkinService.saveRedPacketSkin(skinParam);
  }

}
