package com.yiboshi.science.rest.v1;


import com.yiboshi.arch.base.ResponseDataModel;
import com.yiboshi.science.entity.ComEvaluationValue;
import com.yiboshi.science.param.dto.ComEvaluationValueDTO;
import com.yiboshi.science.param.query.ComEvaluationValueQueryVO;
import com.yiboshi.science.rest.BaseController;
import com.yiboshi.science.service.ComEvaluationValueService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;


@Api(tags = "com-expert-spec", description = "评审分值表")
@RestController
@RequestMapping("/v1/science-admin/com-evaluation-value")
public class ComEvaluationValueController extends BaseController<ComEvaluationValueService, ComEvaluationValueQueryVO, ComEvaluationValueDTO, ComEvaluationValue> {

    @Autowired
    private ComEvaluationValueService comEvaluationValueService;

    @ApiOperation(value = "值添加", httpMethod = "POST", notes = "值添加")
    @RequestMapping("/insertEvaluationValue")
    @PostMapping
    public ResponseDataModel<String> insertEvaluationValue(@Validated @RequestBody ComEvaluationValueDTO dto) {
        return ResponseDataModel.ok(comEvaluationValueService.insertEvaluationValue(dto));
    }

    @ApiOperation(value = "值修改", httpMethod = "POST", notes = "值修改")
    @RequestMapping("/updateEvaluationValue")
    @PostMapping
    public ResponseDataModel<String> updateEvaluationValue(@Validated @RequestBody ComEvaluationValueDTO dto) {
        return ResponseDataModel.ok(comEvaluationValueService.updateEvaluationValue(dto));
    }


    @ApiOperation(value = "值删除", httpMethod = "DELETE", notes = "值删除")
    @DeleteMapping(value = "deleteEvaluationValue/{id}")
    public ResponseDataModel<String> deleteEvaluationValue(@PathVariable String id) {
        return ResponseDataModel.ok(comEvaluationValueService.deleteEvaluationValue(id));
    }
}
