package com.fastbee.common.extend.core.controller;

import com.fastbee.common.core.domain.AjaxResult;
import com.fastbee.common.utils.license.LicenseManagerHolder;
import de.schlichtherle.license.LicenseManager;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhuangpengli
 */
@Api(tags = "公共模块")
@RestController
@RequestMapping("/commons")
public class CommonsController extends BaseController {
    @GetMapping(value = "/getInfo")
    public AjaxResult getInfo() {
        LicenseManager licenseManager = LicenseManagerHolder.getInstance(null);
        try {
            return AjaxResult.success(licenseManager.verify());
        } catch (Exception e) {
            e.printStackTrace();
            return AjaxResult.error();
        }
    }
}
