package com.gonghang.h5clientapp.web;

import com.gonghang.h5clientapp.common.ResultData;
import com.gonghang.h5clientapp.service.GhH5Service;
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;

/**
 * Created by shiwn on 2022/7/5 8:59
 */
@RestController
@RequestMapping("/mobile/robotH5")
public class GhH5Controller implements GhH5Api{
    @Autowired
    private GhH5Service ghH5Service;

    @Override
    @GetMapping("/getRobotList")
    public ResultData getRobotList(){
        return ResultData.success(ghH5Service.getRobotList());
    }

    @Override
    @GetMapping("/getRobotInfo")
    public ResultData getRobotInfo(Integer robotId){
        return ResultData.success(ghH5Service.getRobotInfo(robotId));
    }

    @Override
    @GetMapping("/getTaskList")
    public ResultData getTaskList(Integer pageNum, Integer pageSize, Integer robotId) {
        return ResultData.success(ghH5Service.getTaskList(pageNum, pageSize, robotId));
    }

    @Override
    @GetMapping("/getReportList")
    public ResultData getReportList(Integer pageNum, Integer pageSize, Integer robotId) {
        return ResultData.success(ghH5Service.getReportList(pageNum, pageSize, robotId));
    }
}
