package com.rongwei.controller;


import com.bsentity.vo.DealWithFileVO;
import com.rongwei.bscommon.sys.service.FsFileDataListService;
import com.rongwei.rwcommon.base.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 水印处理
 * @author Trj
 */
@Slf4j
@RestController
@RequestMapping("/watermark")
public class WatermarkController {


    @Autowired
    private FsFileDataListService fsFileDataListService;


    /**
     * 添加水印
     * @return
     */
    @PostMapping("/insetOrUpdate")
    public R add(@RequestBody @Validated DealWithFileVO dealWithFileVO){
        log.info(" 水印处理：  deal wit watermarking --- >  参数: request :{}", dealWithFileVO);
        return fsFileDataListService.watermark(dealWithFileVO);
    }


    /**
     * 临时水印处理
     */
    @PostMapping("temporaryTask")
    private R temporaryTask(){
        log.info(" 水印处理：  deal wit watermarking --- >  定时任务");
        return fsFileDataListService.temporaryTask();
    }

}
