package com.yonge.cooleshow.teacher.controller;

import com.yonge.cooleshow.biz.dal.service.MusicAlbumService;
import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumWrapper;
import com.yonge.cooleshow.common.entity.HttpResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Validated
@RestController
@RequestMapping("${app-config.url.teacher:}/userTenantAlbumRecord")
@Api(tags = "购买训练工具记录")
public class UserTenantAlbumRecordController {

    @Autowired
    private MusicAlbumService musicAlbumService;




    @ApiOperation(value = "查询机构专辑详情")
    @PostMapping("/albumDetail")
    public HttpResponseResult <TenantAlbumWrapper.TenantAlbum> albumDetail(@RequestParam(defaultValue = "") String albumId) {
        TenantAlbumWrapper.TenantAlbum tenantAlbum= musicAlbumService.detailAlbum(albumId);
        return HttpResponseResult.succeed(tenantAlbum);
    }


    @ApiOperation(value = "查询机构专辑详情")
    @PostMapping("/detail")
    public HttpResponseResult <TenantAlbumWrapper.TenantAlbum> detail(@RequestParam(defaultValue = "") String albumId) {
        TenantAlbumWrapper.TenantAlbum tenantAlbum= musicAlbumService.detailAlbum(albumId);
        return HttpResponseResult.succeed(tenantAlbum);
    }


}