package org.framework.lazy.cloud.network.heartbeat.server.standalone.controller;


import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.LazyInternalNetworkServerPermeateClientMappingApplication;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.netty.server.permeate.client.mapping.*;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.dto.LazyInternalNetworkPenetrationMappingDTO;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.domain.model.lazy.netty.server.permeate.client.mapping.LazyInternalNetworkServerPermeateClientMapping;
import org.springframework.validation.annotation.Validated;
import org.wu.framework.web.response.mark.ValidType;
import org.wu.framework.web.spring.EasyController;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
import org.wu.framework.web.response.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;
import org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyController;

import java.util.List;

/**
 * describe 内网穿透映射
 *
 * @author Jia wei Wu
 * @date 2023/12/29 05:21 下午
 * @see DefaultDDDLazyController
 **/
@Tag(name = "内网穿透映射提供者")
@EasyController("/internal/network/penetration/mapping")
public class LazyInternalNetworkServerPermeateClientMappingProvider {

    @Resource
    private LazyInternalNetworkServerPermeateClientMappingApplication lazyInternalNetworkServerPermeateClientMappingApplication;

    /**
     * describe 新增内网穿透映射
     *
     * @param lazyInternalNetworkServerPermeateClientMappingStoryCommand 新增内网穿透映射
     * @return {@link Result<  LazyInternalNetworkServerPermeateClientMapping  >} 内网穿透映射新增后领域对象
     * @author Jia wei Wu
     * @date 2023/12/29 05:21 下午
     **/

    @Operation(summary = "新增内网穿透映射")
    @PostMapping("/story")
    public Result<LazyInternalNetworkServerPermeateClientMapping> story(@RequestBody LazyInternalNetworkServerPermeateClientMappingStoryCommand lazyInternalNetworkServerPermeateClientMappingStoryCommand)  {
        return lazyInternalNetworkServerPermeateClientMappingApplication.story(lazyInternalNetworkServerPermeateClientMappingStoryCommand);
    }

    /**
     * describe 批量新增内网穿透映射
     *
     * @param lazyInternalNetworkServerPermeateClientMappingStoryCommandList 批量新增内网穿透映射
     * @return {@link Result<List<  LazyInternalNetworkServerPermeateClientMapping  >>} 内网穿透映射新增后领域对象集合
     * @author Jia wei Wu
     * @date 2023/12/29 05:21 下午
     **/

    @Operation(summary = "批量新增内网穿透映射")
    @PostMapping("/batchStory")
    public Result<List<LazyInternalNetworkServerPermeateClientMapping>> batchStory(@RequestBody List<LazyInternalNetworkServerPermeateClientMappingStoryCommand> lazyInternalNetworkServerPermeateClientMappingStoryCommandList) {
        return lazyInternalNetworkServerPermeateClientMappingApplication.batchStory(lazyInternalNetworkServerPermeateClientMappingStoryCommandList);
    }

    /**
     * describe 更新内网穿透映射
     *
     * @param lazyInternalNetworkServerPermeateClientMappingUpdateCommand 更新内网穿透映射
     * @return {@link Result<  LazyInternalNetworkServerPermeateClientMapping  >} 内网穿透映射领域对象
     * @author Jia wei Wu
     * @date 2023/12/29 05:21 下午
     **/

    @Operation(summary = "更新内网穿透映射")
    @PutMapping("/updateOne")
    public Result<LazyInternalNetworkServerPermeateClientMapping> updateOne(
            @Validated(ValidType.Update.class)
            @RequestBody LazyInternalNetworkServerPermeateClientMappingUpdateCommand lazyInternalNetworkServerPermeateClientMappingUpdateCommand) {
        return lazyInternalNetworkServerPermeateClientMappingApplication.updateOne(lazyInternalNetworkServerPermeateClientMappingUpdateCommand);
    }

    /**
     * describe 查询单个内网穿透映射
     *
     * @param lazyInternalNetworkServerPermeateClientMappingQueryOneCommand 查询单个内网穿透映射
     * @return {@link Result< LazyInternalNetworkPenetrationMappingDTO >} 内网穿透映射DTO对象
     * @author Jia wei Wu
     * @date 2023/12/29 05:21 下午
     **/

    @Operation(summary = "查询单个内网穿透映射")
    @GetMapping("/findOne")
    public Result<LazyInternalNetworkPenetrationMappingDTO> findOne(@ModelAttribute LazyInternalNetworkServerPermeateClientMappingQueryOneCommand lazyInternalNetworkServerPermeateClientMappingQueryOneCommand) {
        return lazyInternalNetworkServerPermeateClientMappingApplication.findOne(lazyInternalNetworkServerPermeateClientMappingQueryOneCommand);
    }

    /**
     * describe 查询多个内网穿透映射
     *
     * @param lazyInternalNetworkServerPermeateClientMappingQueryListCommand 查询多个内网穿透映射
     * @return {@link Result<List< LazyInternalNetworkPenetrationMappingDTO >>} 内网穿透映射DTO对象
     * @author Jia wei Wu
     * @date 2023/12/29 05:21 下午
     **/

    @Operation(summary = "查询多个内网穿透映射")
    @GetMapping("/findList")
    public Result<List<LazyInternalNetworkPenetrationMappingDTO>> findList(@ModelAttribute LazyInternalNetworkServerPermeateClientMappingQueryListCommand lazyInternalNetworkServerPermeateClientMappingQueryListCommand) {
        return lazyInternalNetworkServerPermeateClientMappingApplication.findList(lazyInternalNetworkServerPermeateClientMappingQueryListCommand);
    }

    /**
     * describe 分页查询多个内网穿透映射
     *
     * @param lazyInternalNetworkServerPermeateClientMappingQueryListCommand 分页查询多个内网穿透映射
     * @return {@link Result<LazyPage< LazyInternalNetworkPenetrationMappingDTO >>} 分页内网穿透映射DTO对象
     * @author Jia wei Wu
     * @date 2023/12/29 05:21 下午
     **/

    @Operation(summary = "分页查询多个内网穿透映射")
    @GetMapping("/findPage")
    public Result<LazyPage<LazyInternalNetworkPenetrationMappingDTO>> findPage(@Parameter(description = "分页大小") @RequestParam(defaultValue = "10", value = "size") int size,
                                                                               @Parameter(description = "当前页数") @RequestParam(defaultValue = "1", value = "current") int current, @ModelAttribute LazyInternalNetworkServerPermeateClientMappingQueryListCommand lazyInternalNetworkServerPermeateClientMappingQueryListCommand) {
        return lazyInternalNetworkServerPermeateClientMappingApplication.findPage(size, current, lazyInternalNetworkServerPermeateClientMappingQueryListCommand);
    }

    /**
     * describe 删除内网穿透映射
     *
     * @param lazyInternalNetworkServerPermeateClientMappingRemoveCommand 删除内网穿透映射
     * @return {@link Result<  LazyInternalNetworkServerPermeateClientMapping  >} 内网穿透映射
     * @author Jia wei Wu
     * @date 2023/12/29 05:21 下午
     **/

    @Operation(summary = "删除内网穿透映射")
    @DeleteMapping("/remove")
    public Result<LazyInternalNetworkServerPermeateClientMapping> remove(
            @Validated(ValidType.Delete.class)
            @ModelAttribute LazyInternalNetworkServerPermeateClientMappingRemoveCommand lazyInternalNetworkServerPermeateClientMappingRemoveCommand) {
        return lazyInternalNetworkServerPermeateClientMappingApplication.remove(lazyInternalNetworkServerPermeateClientMappingRemoveCommand);
    }
}