package cn.com.tenlion.materialstore.controller.api.materialdata;

import cn.com.tenlion.materialstore.pojo.dtos.materialdata.MaterialDataDTO;
import cn.com.tenlion.materialstore.service.materialdata.MaterialDataService;
import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.pojo.result.ErrorResult;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName: MaterialDataController
 * @Description: 图片素材
 * @Author: CodeFactory
 * @Date: 2021-05-28 11:04:34
 * @Version: 3.0
        **/
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "素材详情接口")
@RestController
@RequestMapping(ISystemConstant.API_PREFIX + "/materialdata")
public class MaterialDataController extends DefaultBaseController {

    @Autowired
    private MaterialDataService materialDataService;

    @ApiOperation(value = "素材详情列表", notes = "素材详情接口")
    @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
    @GetMapping("list/{materialId}")
    public MaterialDataDTO list(@PathVariable("materialId") String materialId) {
        return materialDataService.getByMaterialId(materialId);
    }

}