package com.goldenwater.web.controller.gx;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import com.goldenwater.common.annotation.Log;
import com.goldenwater.common.core.controller.BaseController;
import com.goldenwater.common.core.domain.AjaxResult;
import com.goldenwater.common.core.page.TableDataInfo;
import com.goldenwater.common.enums.BusinessType;
import com.goldenwater.gx.domain.GxExchangeLog;
import com.goldenwater.gx.service.IGxExchangeLogService;

/**
 * 数据交换日志Controller
 */
@RestController
@RequestMapping("/gx/log")
public class GxExchangeLogController extends BaseController
{
    @Autowired
    private IGxExchangeLogService gxExchangeLogService;

    @PreAuthorize("@ss.hasPermi('gx:log:list')")
    @GetMapping("/list")
    public TableDataInfo list(GxExchangeLog log)
    {
        startPage();
        List<GxExchangeLog> list = gxExchangeLogService.selectGxExchangeLogList(log);
        return getDataTable(list);
    }

    @PreAuthorize("@ss.hasPermi('gx:log:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable Long id)
    {
        return success(gxExchangeLogService.selectGxExchangeLogById(id));
    }

    @PreAuthorize("@ss.hasPermi('gx:log:remove')")
    @Log(title = "交换日志", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(gxExchangeLogService.deleteGxExchangeLogByIds(ids));
    }
}
