package com.liquidnet.service.adam.controller.admin;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.liquidnet.service.adam.service.processor.*;
import com.liquidnet.service.base.ResponseDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@ApiSupport(order = 90062)
@Api(tags = "DM")
@Slf4j
@Validated
@RestController
@RequestMapping("dm")
public class AdamDMAdminController extends AdamBaseController {
    @Autowired
    DMUserInformationProcessor dmUserInformationProcessor;
    @Autowired
    DMThirdPartsProcessor dmThirdPartsProcessor;
    @Autowired
    DMRealNameProcessor dmRealNameProcessor;
    @Autowired
    DMUserMemberProcessor dmUserMemberProcessor;
    @Autowired
    DMEntersProcessor dmEntersProcessor;
    @Autowired
    DMAddressesProcessor dmAddressesProcessor;
    @Autowired
    DMTracesInfoProcessor dmTracesInfoProcessor;

    @ApiOperationSupport(order = 0)
    @ApiOperation(value = "user")
    @GetMapping(value = {"user"})
    public ResponseDto<Object> dataMigrationForUser(@RequestParam boolean flg) {
        dmUserInformationProcessor.handler(flg);
        return ResponseDto.success();
    }

    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "tpa")
    @GetMapping(value = {"tpa"})
    public ResponseDto<Object> dataMigrationForTpa(@RequestParam boolean flg) {
        dmThirdPartsProcessor.handler(flg);
        return ResponseDto.success();
    }

    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "real")
    @GetMapping(value = {"real"})
    public ResponseDto<Object> dataMigrationForReal(@RequestParam boolean flg) {
        dmRealNameProcessor.handler(flg);
        return ResponseDto.success();
    }

    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "vip")
    @GetMapping(value = {"vip"})
    public ResponseDto<Object> dataMigrationForVip(@RequestParam boolean flg) {
        dmUserMemberProcessor.handler(flg);
        return ResponseDto.success();
    }

    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "traces")
    @GetMapping(value = {"traces"})
    public ResponseDto<Object> dataMigrationForTraces(@RequestParam boolean flg) {
        dmTracesInfoProcessor.handler(flg);
        return ResponseDto.success();
    }

    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "enters")
    @GetMapping(value = {"enters"})
    public ResponseDto<Object> dataMigrationForEnters(@RequestParam boolean flg) {
        dmEntersProcessor.handler(flg);
        return ResponseDto.success();
    }

    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "addr")
    @GetMapping(value = {"addr"})
    public ResponseDto<Object> dataMigrationForAddr(@RequestParam boolean flg) {
        dmAddressesProcessor.handler(flg);
        return ResponseDto.success();
    }

    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "morder")
    @GetMapping(value = {"morder"})
    public ResponseDto<Object> dataMigrationForMOrder(@RequestParam boolean flg) {

        return ResponseDto.success();
    }
}
