package com.hssx.pcbms.controller;


import com.hssx.pcbms.entity.PersonScore;
import com.hssx.pcbms.entity.Score;
import com.hssx.pcbms.service.PersonScoreService;
import com.hssx.pcbms.service.ScoreService;
import com.hssx.pcbms.util.HttpRespMsg;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

/**
 * @author 吴涛涛
 * @since 2019-12-10
 */
@RestController
@RequestMapping("/personscore")
public class PersonScoreController {

    @Autowired
    private PersonScoreService personScoreService;

    /**
     * 打个人分/修改个人打分
     * 参数：
     * 被打分人的id：uid，德：virtue，能：can，勤：diligence，绩：performance,廉：lian
     * 时间字符串:timeStr，打分主键：scoreId
     * 注：修改时传 id:个人分id
     * @return
     */
    @ApiOperation(value = "打个人分/修改个人打分", notes = "打个人分/修改个人打分")
    @RequestMapping("/addOrUpdate")
    public HttpRespMsg addOrUpdate(PersonScore personScore) {
        return personScoreService.addOrUpdate(personScore);
    }

    /**
     * 获取五项打分的最高打分数据
     * @return
     */
    @ApiOperation(value = "获取五项打分的最高打分数据", notes = "获取五项打分的最高打分数据")
    @RequestMapping("/fiveList")
    public HttpRespMsg fiveList() {
        return personScoreService.fiveList();
    }

}

