package com.ruoyi.controller;

import com.ruoyi.frequency.workstype.entity.WorksType;
import com.ruoyi.frequency.workstype.service.WorksTypeService;
import com.ruoyi.response.ResponseData;
import com.ruoyi.vo.RyController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 作品类型
 */
@CrossOrigin
@RestController
@RequestMapping("/api/worksType")
@Api(tags = "作品类型")
public class ApiWorksTypeController extends RyController {


    @Autowired
    private WorksTypeService worksTypeService;


    @PostMapping("/worksTypeTree")
    @ApiOperation(value = "作品类型树", notes = "作品类型树")
    public ResponseData<List<WorksType>> worksTypeTree() {
        return ResponseData.success(worksTypeService.worksTypeList());
    }

}
