package com.vote.system.controller;


import com.vctgo.common.core.web.domain.AjaxResult;
import com.vote.system.domain.VoteScoringItem;
import com.vote.system.domain.dto.VoteScoringItemDto;
import com.vote.system.domain.vo.VoteScoringItemVo;
import com.vote.system.service.VoteScoringItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/scoring")
public class VoteScoringItemController {

    @Autowired
    private VoteScoringItemService voteScoringItemService;

    /**
     * 查询评分项
     *
     * @param ruleId
     * @return
     */
    @GetMapping
    public AjaxResult queryByRuleId(Long ruleId) {
        return AjaxResult.success(voteScoringItemService.queryByRuleId(ruleId));
    }


    /**
     * 保存
     * @param voteScoringItemDto
     * @return
     */
    @PostMapping("/save")
    public AjaxResult save(@RequestBody VoteScoringItemDto voteScoringItemDto) {
        return AjaxResult.success(voteScoringItemService.saveVoteScoringItem(voteScoringItemDto));
    }



}
