package com.usky.fire.controller.web;


import com.usky.common.core.bean.ApiResult;
import com.usky.common.log.annotation.Log;
import com.usky.common.log.enums.BusinessType;
import com.usky.fire.domain.DemBuildScore;
import com.usky.fire.service.DemBuildScoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 建筑评分 前端控制器
 * </p>
 *
 * @author JCB
 * @since 2022-09-06
 */
@RestController
@RequestMapping("/demBuildScore")
public class DemBuildScoreController {

    @Autowired
    private DemBuildScoreService demBuildScoreService;

    /**
     * 建筑评分管理-建筑评分规则修改
     *
     * @param demBuildScoreList
     * @return
     */
    @Log(title = "建筑评分管理-建筑评分规则修改", businessType = BusinessType.UPDATE)
    @PutMapping("buildScoreUpdate")
    public ApiResult<Void> buildScoreUpdate(@RequestBody List<DemBuildScore> demBuildScoreList) {
        demBuildScoreService.buildScoreUpdate(demBuildScoreList);
        return ApiResult.success();
    }

    /**
     * 建筑评分管理-列表查询
     *
     * @return
     */
    @GetMapping("buildScoreList")
    public ApiResult<Object> buildScoreList() {
        return ApiResult.success(demBuildScoreService.buildScoreList());
    }


}

