//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.jeecg.modules.jmreport.desreport.a;

import org.jeecg.modules.jmreport.common.vo.Result;
import org.jeecg.modules.jmreport.desreport.entity.JimuReportShare;
import org.jeecg.modules.jmreport.desreport.service.IJimuReportShareService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController("jimuReportShareController")
@RequestMapping({"/jmreport/share"})
public class f {
    private static final Logger a = LoggerFactory.getLogger(f.class);
    @Autowired
    private IJimuReportShareService jurisdictionService;

    public f() {
    }

    @GetMapping({"/queryJurisdiction"})
    public Result<JimuReportShare> a(@RequestParam(name = "reportId") String var1) {
        Result var2 = new Result();
        JimuReportShare var3 = this.jurisdictionService.selectJurisdiction(var1);
        if (null != var3) {
            var3 = this.jurisdictionService.compareToDate(var3);
        }

        var2.setSuccess(true);
        var2.setResult(var3);
        return var2;
    }

    @PostMapping({"/addAndEdit"})
    public Result<?> a(@RequestBody JimuReportShare var1) {
        try {
            JimuReportShare var2 = this.jurisdictionService.addAndEdit(var1);
            return Result.OK(var2);
        } catch (Exception var3) {
            a.error(var3.getMessage(), var3);
            return Result.error("保存失败！");
        }
    }

    @GetMapping({"/verification"})
    public Result<String> a(@RequestParam(name = "reportId") String var1, @RequestParam(name = "lock", required = false) String var2) {
        String var3 = this.jurisdictionService.passwordVerification(var1, var2);
        return Result.OK(var3);
    }
}
