package org.gyk.common.base.controller;


import com.baomidou.mybatisplus.extension.service.IService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.PropertyUtils;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Description: Controller基类
 * @Date: 2021-3-23 8:13
 * @Version: 1.0
 */
@Slf4j
public class gykController<T,S extends IService<T>> {
    @Autowired
    S service;
    /**
     * 获取对象ID
     *
     * @return
     */
    private String getId(T item) {
        try {
            return PropertyUtils.getProperty(item, "id").toString();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}
