package com.huatek.busi.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.huatek.busi.config.TitleNameConfig;
import com.huatek.busi.entity.EquipmentSumNumber;
import com.huatek.busi.entity.HomeTitleName;
import com.huatek.busi.entity.TitleName;
import com.huatek.busi.service.HomeTitleService;
import com.huatek.torch.frame.tools.ConstantUtil;
import com.huatek.torch.frame.tools.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.Map;

/**
 * 站点名称配置
 *
 * @author mitche ma
 *
 * @Date 2021年11月16日
 */

@Slf4j
@Api(tags={"标题管理"})
@RestController
@RequestMapping("/api/titleName")
public class TitleNameController {
    @Reference(check = false)
    HomeTitleService homeTitleService;

//    @Autowired
//    private TitleNameConfig titleNameConfig;
//
//    /**
//     * 配置文件查询标题名称
//     */
//    @GetMapping("/titleName")
//    public Map<String,Object> titleName() {
//        Map<String, Object> map = new HashMap<String, Object>();
//        String titleName = titleNameConfig.getTitleName();
//        map.put("titleName",titleName);
//        return map;
//    }

    /**
     * 标题名称查询
     *
     */
    @ApiOperation(value = "标题名称查询")
    @GetMapping(value="/selectTitleName")
    public Map<String, Object> selectTitleName (){
        HomeTitleName homeTitleName = homeTitleService.findTitleName();
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", homeTitleName);
    }


}
