package com.dxhy.base.controller;

import com.dxhy.base.service.fpxxrz.BaseLqcxrzService;
import com.dxhy.common.controller.AbstractController;
import com.dxhy.common.util.StringHelper;
import com.dxhy.common.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName BaseLqCxRzController
 * @Description 撤销认证功能
 * @Author wangruwei
 * @Date 2022/11/22 15:05
 * @Version 1.0
 */
@RestController
@RequestMapping("/lqCxrz")
@Slf4j
public class BaseLqCxRzController  extends AbstractController {

    @Resource
    private BaseLqcxrzService baseLqcxrzService;

    /**
    * @Description 点击弹框里的撤销认证
    * @Author wangruwei
    * @Date 2022/11/23 14:31
    **/
    @RequestMapping(value = "lqcxrz", method = RequestMethod.POST)
    public ResponseEntity<?> lqcxrz(@RequestBody Map<String, Object> map) {
        String cxids = (String)map.get("cxids");

        Map<String,Object> pramsMap = new HashMap<String,Object>();
        if (!StringHelper.isBlank(cxids)) {
            pramsMap.put("cxids", cxids);
        } else {
            return ResponseEntity.ok(R.error("请选择需要撤销认证的数据！"));
        }

        return baseLqcxrzService.lqcxrz(pramsMap);
    }

}
