package cn.flightfeather.supervision.lightshare.web
|
|
import cn.flightfeather.supervision.domain.entity.Evaluation
|
import cn.flightfeather.supervision.lightshare.service.EvaluationService
|
import cn.flightfeather.supervision.lightshare.vo.AssessmentSearchCondition
|
import io.swagger.annotations.Api
|
import org.springframework.web.bind.annotation.*
|
import javax.servlet.http.HttpServletResponse
|
|
@Api(tags = ["评估总分API接口"])
|
@RestController
|
@RequestMapping("/evaluation")
|
class EvaluationController(val evaluationService: EvaluationService) {
|
@GetMapping
|
fun getAll() = evaluationService.findAll()
|
|
@PutMapping
|
fun add(@RequestBody evaluation: Evaluation) = evaluationService.save(evaluation)
|
|
@PostMapping
|
fun update(@RequestBody evaluation: Evaluation) = evaluationService.update(evaluation)
|
|
@GetMapping("/{id}")
|
fun getById(@PathVariable id: String) = evaluationService.findOne(id)
|
|
@DeleteMapping("/{id}")
|
fun delete(@PathVariable id: String) = evaluationService.delete(id)
|
|
@GetMapping("/totalPoint/{userId}")
|
fun getT(
|
@PathVariable("userId") userId: String,
|
@RequestParam("evaluatorType") evaluatorType: Int,
|
@RequestParam("startTime") startTime: String,
|
@RequestParam("endTime") endTime: String,
|
@RequestParam("sceneTypeId", required = false) sceneTypeId: Int?,
|
@RequestParam("erGuid", required = false) erGuid: String?,
|
@RequestParam("eId", required = false) eId: String?
|
) = evaluationService.getTotalPoints(userId, evaluatorType, startTime, endTime, sceneTypeId, erGuid, eId)
|
|
@GetMapping("/historyPoint/{userId}")
|
fun getHistoryPoint(
|
@PathVariable("userId") userId: String,
|
@RequestParam(value = "page") page: Int,
|
@RequestParam(value = "per_page") perPage: Int,
|
response: HttpServletResponse
|
) = evaluationService.getHistoryPoint(userId, page, perPage, response)
|
|
@GetMapping("/creditInfo")
|
fun getCreditInfo(
|
@RequestParam("userId") userId: String
|
) = evaluationService.getCreditInfo(userId)
|
|
@PostMapping("/search/{userId}")
|
fun getAssessments(
|
@PathVariable("userId") userId: String,
|
@RequestBody condition: AssessmentSearchCondition,
|
@RequestParam(value = "page") page: Int,
|
@RequestParam(value = "per_page") perPage: Int,
|
response: HttpServletResponse
|
) = evaluationService.getAssessments(userId, condition, page, perPage, response)
|
|
fun autoScore(
|
@RequestParam(value = "year") year: Int,
|
@RequestParam(value = "month") month: Int,
|
@RequestParam("sceneType") sceneType: Int,
|
response: HttpServletResponse
|
) = evaluationService.autoScore(year, month, sceneType, response)
|
}
|