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

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;

@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;

    @ApiOperation(value = "user")
    @GetMapping(value = {"user"})
    public ResponseDto<Object> dataMigrationForUser(@RequestParam boolean flg) {
//        if (!verify(alis)) return ResponseDto.failure();
        dmUserInformationProcessor.handler(flg);
        return ResponseDto.success();
    }

    @ApiOperation(value = "tpa")
    @GetMapping(value = {"tpa"})
    public ResponseDto<Object> dataMigrationForTpa(@RequestParam boolean flg) {
//        if (!verify(alis)) return ResponseDto.failure();
        dmThirdPartsProcessor.handler(flg);
        return ResponseDto.success();
    }

    @ApiOperation(value = "real")
    @GetMapping(value = {"real"})
    public ResponseDto<Object> dataMigrationForReal(@RequestParam boolean flg) {
//        if (!verify(alis)) return ResponseDto.failure();
        dmRealNameProcessor.handler(flg);
        return ResponseDto.success();
    }

    @ApiOperation(value = "vip")
    @GetMapping(value = {"vip"})
    public ResponseDto<Object> dataMigrationForVip(@RequestParam boolean flg) {
//        if (!verify(alis)) return ResponseDto.failure();
        dmUserMemberProcessor.handler(flg);
        return ResponseDto.success();
    }

    @ApiOperation(value = "morder")
    @GetMapping(value = {"morder"})
    public ResponseDto<Object> dataMigrationForMOrder(@RequestParam boolean flg) {
//        if (!verify(alis)) return ResponseDto.failure();
        return ResponseDto.success();
    }

    @ApiOperation(value = "enters")
    @GetMapping(value = {"enters"})
    public ResponseDto<Object> dataMigrationForEnters(@RequestParam boolean flg) {
//        if (!verify(alis)) return ResponseDto.failure();
        dmEntersProcessor.handler(flg);
        return ResponseDto.success();
    }

    @ApiOperation(value = "addr")
    @GetMapping(value = {"addr"})
    public ResponseDto<Object> dataMigrationForAddr(@RequestParam boolean flg) {
//        if (!verify(alis)) return ResponseDto.failure();
        dmAddressesProcessor.handler(flg);
        return ResponseDto.success();
    }

    @ApiOperation(value = "traces")
    @GetMapping(value = {"traces"})
    public ResponseDto<Object> dataMigrationForTraces(@RequestParam boolean flg) {
//        if (!verify(alis)) return ResponseDto.failure();
        dmTracesInfoProcessor.handler(flg);
        return ResponseDto.success();
    }
}
