//package com.inkasso.management.statistics.controller;
//
//import com.inkasso.auth.interfaces.Permissions;
//import com.inkasso.auth.interfaces.PermissionAndCheck;
//import com.inkasso.adapter.page.PageResult;
//import com.inkasso.management.statistics.model.dto.InterfaceStatisticsDTO;
//import com.inkasso.management.statistics.model.request.AddInterfaceStatisticsRequest;
//import com.inkasso.management.statistics.model.request.EditInterfaceStatisticsRequest;
//import com.inkasso.management.statistics.model.request.QueryInterfaceStatisticsRequest;
//import com.inkasso.management.statistics.service.InterfaceStatisticsService;
//import com.inkasso.adapter.exception.ServiceException;
//import com.inkasso.adapter.response.ResponseData;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RestController;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.PutMapping;
//import org.springframework.web.bind.annotation.DeleteMapping;
//import org.springframework.web.bind.annotation.GetMapping;
//import com.inkasso.adapter.exception.enums.KafubaoExceptionEnum;
//
//
//import java.util.List;
//
///**
// * @author 张超
// * @date  2023-08-25
// */
//@RestController
//@RequestMapping(path = "statistics")
//@Permissions(name="接口调用统计",code = "interfacestatisticsManage")
//public class InterfaceStatisticsController {
//
//    @Autowired
//    private InterfaceStatisticsService interfaceStatisticsService;
//
//
//
//    @PostMapping(path = "interfacestatistics")
//    @PermissionAndCheck(name="添加接口调用统计",code="InterfaceStatisticsController:add")
//    public ResponseData add(@Validated @RequestBody AddInterfaceStatisticsRequest addInterfaceStatisticsRequest) {
//
//        interfaceStatisticsService.addInterfaceStatistics(addInterfaceStatisticsRequest);
//        return ResponseData.success();
//
//    }
//
//    @PutMapping(path = "interfacestatistics")
//    @PermissionAndCheck(name="更新接口调用统计",code="InterfaceStatisticsController:update")
//    public ResponseData edit(@Validated @RequestBody EditInterfaceStatisticsRequest editInterfaceStatisticsRequest) {
//        interfaceStatisticsService.editInterfaceStatistics(editInterfaceStatisticsRequest);
//        return ResponseData.success();
//    }
//    @GetMapping(path = "interfacestatistics")
//    @PermissionAndCheck(name = "分页查询列表", code="InterfaceStatisticsController:pageList")
//    public ResponseData pageQuery(@RequestBody QueryInterfaceStatisticsRequest queryInterfaceStatisticsRequest){
//        ResponseData<PageResult<InterfaceStatisticsDTO>> result = interfaceStatisticsService.pageQuery(queryInterfaceStatisticsRequest);
//        return ResponseData.success(result);
//
//    }
//
//    @GetMapping(path = "interfacestatisticss")
//    @PermissionAndCheck(name = "查询全部列表", code="InterfaceStatisticsController:allList")
//    public ResponseData queryList(@RequestBody QueryInterfaceStatisticsRequest queryInterfaceStatisticsRequest) {
//
//        List result = interfaceStatisticsService.queryList(queryInterfaceStatisticsRequest);
//        return ResponseData.success(result);
//
//    }
//
//    @GetMapping(path = "interfacestatistics/{id}")
//    @PermissionAndCheck(name = "查询接口调用统计详细信息", code="InterfaceStatisticsController:detail")
//    public ResponseData getById(@PathVariable("id") Long id){
//        if(id==null){
//            throw new ServiceException(400, KafubaoExceptionEnum.SYSTEM_DATE_ERROR);
//        }
//        InterfaceStatisticsDTO interfaceStatisticsDTO = interfaceStatisticsService.getInterfaceStatisticsDtoById(id);
//        return ResponseData.success(interfaceStatisticsDTO);
//
//    }
//
//
//    @DeleteMapping(path = "interfacestatistics/{id}")
//    @PermissionAndCheck(name = "删除接口调用统计", code="InterfaceStatisticsController:delete")
//    public ResponseData deleteById(@PathVariable("id") Long id){
//        if(id==null){
//            throw new ServiceException(400, KafubaoExceptionEnum.SYSTEM_DATE_ERROR);
//        }
//        interfaceStatisticsService.deleteInterfaceStatistics(id);
//        return ResponseData.success();
//    }
//}