package cn.teammodel.controller.admin.controller;

import cn.teammodel.common.R;
import cn.teammodel.controller.admin.service.ArtService;
import cn.teammodel.model.dto.admin.art.ArtAnalysisDto;
import cn.teammodel.model.dto.admin.art.ArtFindDto;
import cn.teammodel.model.dto.admin.art.DataFileCommentDto;
import cn.teammodel.model.dto.admin.art.DataFileDto;
import cn.teammodel.model.dto.admin.common.GroupDto;
import cn.teammodel.model.dto.admin.common.RGroupList;
import cn.teammodel.model.vo.admin.ArtElementsVo;
import cn.teammodel.model.vo.admin.DataFileVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;

/**
 * @author zzzzz
 * @since  2024-01-09 17:59
 */

@RestController
@RequestMapping("admin/art")
@Api(tags = "管理员端-艺术评测")
public class ArtController {

    @Resource
    private ArtService ArtService;

    @PostMapping("getArtList")
    @ApiOperation("获取当前学校艺术评测列表")
    public R<List<ArtElementsVo>> findRecords(@Valid @RequestBody ArtFindDto artFindDto,HttpServletRequest request) {
        List<ArtElementsVo> res = ArtService.getArtList(artFindDto,request);
        return R.success(res);
    }
    @PostMapping("getGroupList")
    @ApiOperation("获取当前学校指定成员名单详细信息")
    public R<List<RGroupList>> findGroups(@Valid @RequestBody GroupDto groupDto, HttpServletRequest request) {
        List<RGroupList> res = ArtService.getGroupList(groupDto,request);
        return R.success(res);
    }
    @PostMapping("getPdfData")
    @ApiOperation("请求学生的pdf数据文件")
    public R<List<DataFileVo>> getPdfData(@Valid @RequestBody DataFileDto dataFileDto, HttpServletRequest request) {
        List<DataFileVo> res = ArtService.getPdfData(dataFileDto,request);
        return R.success(res);
    }
    @PostMapping("updateComment")
    @ApiOperation("更新评论")
    public R<List<DataFileVo>> updateComment(@Valid @RequestBody DataFileCommentDto dataFileCommentDto, HttpServletRequest request) {
        List<DataFileVo> res = ArtService.updateComment(dataFileCommentDto,request);
        return R.success(res);
    }
    @PostMapping("artAnalysis")
    @ApiOperation("艺术评测校级看板分析")
    public R<Map<String,Object>> getArtAnalysis(@Valid @RequestBody ArtAnalysisDto artAnalysisDto, HttpServletRequest request) {
        Map<String, Object> res = ArtService.getArtAnalytics(artAnalysisDto,request);
        return R.success(res);
    }

}
