package com.base.biz.controller;

import com.base.biz.aop.PageInfo;
import com.base.biz.model.dto.request.QueryTargetListDTO;
import com.base.biz.model.dto.response.SceneBasisTargetDTO;
import com.base.biz.model.dto.response.TargetPointDTO;
import com.base.biz.service.SceneBasisTargetService;
import com.base.orbit.web.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "目标控制类")
@RestController
@RequestMapping("/api/target/v1")
public class TargetController {

    @Resource
    SceneBasisTargetService sceneBasisTargetService;

    @ApiOperation(value = "目标列表查询")
    @GetMapping("/getTargetList")
    public Result<PageInfo<SceneBasisTargetDTO>> getTargetList(
            @ApiParam(name = "page", value = "页码", required = true) int page,
            @ApiParam(name = "size", value = "每页条数", required = true) int size) {
        return Result.success(sceneBasisTargetService.getAllTargetList(page, size));
    }

    @ApiOperation(value = "点目标列表查询")
    @GetMapping("/list/point")
    public Result<PageInfo<TargetPointDTO>> getTargetPointList(QueryTargetListDTO reqDTO){
        return Result.success(sceneBasisTargetService.getTargetPointPage(reqDTO));
    }
}