package com.muyu.rule.server.controller;

import com.muyu.common.core.domain.Result;
import com.muyu.rule.server.service.SourceDisposeService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author：张承志
 * @Package：com.muyu.rule.server.controller
 * @Project：cloud-etl-rule
 * @name：DataSourceDisposeController
 * @Date：2024/8/27 20:54
 */

@Log4j2
@RestController
@RequestMapping("/dispose")
public class DataSourceDisposeController {

    @Autowired
    private SourceDisposeService sourceDisposeService;

    /**
     * 数据脱敏
     */

    @PostMapping("/dataGenerate/{dataSource}")
    public Result dataGenerate(@PathVariable("dataSource") String dataSource){

        String  string  = sourceDisposeService.dataGenerate(dataSource);

        return Result.success(string);
    }

    /**
     * 数据非空
     */
    @PostMapping("/notEmpty/{dataSource}")
    public Result notEmpty(@PathVariable("dataSource") Object dataSource){

      Boolean aBoolean =  sourceDisposeService.notEmpty(dataSource);

        return Result.success();
    }

    /**
     * 对字段进行测试
     * @param object
     * @return
     */

    @PostMapping("/valueTest")
    public Result valueTest(Object object){

        sourceDisposeService.valueTest(object);

     return Result.success();
    }


















}
