package com.chushang.inspection.terminal.controller;

import com.chushang.common.core.web.AjaxResult;
import com.chushang.common.log.annotation.SysLog;
import com.chushang.common.log.enums.BusinessType;
import com.chushang.inspection.terminal.query.FiveUnifiedStoreDetailsQuery;
import com.chushang.inspection.terminal.service.FiveStoreService;
import com.chushang.security.annotation.RequiresPermissions;
import lombok.extern.java.Log;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
* 五统一商户明细(内蒙古建行随付贷)(st_five_store)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/store/five")
public class FiveStoreController {


    @Resource
    FiveStoreService fiveStoreService;

    /**
     * 分页查询五统一商户明细（内蒙古建行随付贷）
     */
    @GetMapping("/page")
    @RequiresPermissions("five:unified:store")
    public AjaxResult pageList(@Validated FiveUnifiedStoreDetailsQuery query) {
        return AjaxResult.success(fiveStoreService.pageList(query));
    }

    /**
     * 下载五统一商户明细（内蒙古建行随付贷）
     */
    @GetMapping("/download")
    @SysLog(value = "五统一商户明细（内蒙古建行随付贷）", businessType = BusinessType.EXPORT)
    public void download(@Validated FiveUnifiedStoreDetailsQuery query, HttpServletResponse response) {
        fiveStoreService.download(query, response);
    }


}
