package com.template.controller;


import com.template.annotation.DESRespondSecret;
import com.template.api.SmartRelationControllerAPI;
import com.template.model.pojo.SmartRelation;
import com.template.model.result.CommonResult;
import com.template.model.result.PageUtils;
import com.template.model.vo.SmartRelationAppVo;
import com.template.model.vo.SmartRelationVo;
import com.template.services.SmartRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ceshi
 * @since 2024-06-28
 */
@RestController
@DESRespondSecret
public class SmartRelationController implements SmartRelationControllerAPI {

    @Autowired
    SmartRelationService smartRelationService;

    @Override
    @DESRespondSecret(validated = true)
    public CommonResult getList(int currentPage,int pageCount,Integer userId, String startTime, String endTime) {

        PageUtils<SmartRelationVo> pageUtils =smartRelationService.getList(currentPage,pageCount,userId,startTime,endTime);

        return CommonResult.ok(pageUtils);
    }

    @Override
    @DESRespondSecret(validated = true)
    public CommonResult getAppList(int currentPage, int pageCount, Integer userId, String startTime, String endTime) {
        PageUtils<SmartRelationAppVo> pageUtils =smartRelationService.getAppList(currentPage,pageCount,userId,startTime,endTime);

        return CommonResult.ok(pageUtils);
    }
}

