package com.loan.system.controller.wechat;

import com.loan.system.domain.pojo.Result;
import com.loan.system.service.DictionaryService;
import com.loan.system.utils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wechat/dictionary")
@Api(tags = "字典表接口")
public class DictionaryController {
    @Autowired
    private DictionaryService dictionaryService;

    @GetMapping("/attributes")
    @ApiOperation("查询业务属性")
    public Result getAttributes(){
        return ResultUtil.success("success",dictionaryService.getAllDictAttributes(false));
    }

    @GetMapping("/businessTypes")
    @ApiOperation("查询业务类型")
    public Result getBusinessTypes(){
        return ResultUtil.success("success",dictionaryService.getAllDictTypes(false));
    }

    @GetMapping("/channels")
    @ApiOperation("查询业务渠道")
    public Result getChannels(){
        return ResultUtil.success("success",dictionaryService.getAllDictChannels(false));
    }

    @GetMapping("/locations")
    @ApiOperation("查询房产位置")
    public Result getLocations(){
        return ResultUtil.success("success",dictionaryService.getAllLocations(false));
    }
}
