package org.wfc.system.controller;

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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.wfc.common.core.web.controller.BaseController;
import org.wfc.common.core.web.domain.AjaxResult;
import org.wfc.common.core.web.page.TableDataInfo;
import org.wfc.omada.api.client.model.ClientInfo;
import org.wfc.system.service.IUClientService;

import java.util.List;

/**
 * <p>
 * 用户平台_用户设备表 前端控制器
 * </p>
 *
 * @author sys
 * @since 2025-01-03
 */
@RestController
@RequestMapping("/client")
public class UClientController extends BaseController {

    @Autowired
    private IUClientService uClientService;

    @GetMapping("/page")
    public TableDataInfo page(@RequestParam(value = "searchKey", required = false) String searchKey) {
        startPage();
        List<ClientInfo> list = uClientService.clientList(searchKey);
        return getDataTable(list);
    }

    @GetMapping("/list")
    public AjaxResult list(@RequestParam(value = "searchKey", required = false) String searchKey) {
        List<ClientInfo> list = uClientService.clientList(searchKey);
        return success(list);
    }

}
