#
luxiaotao1123
2024-02-16 02eb9d41eb2f201ce18d8481f56d82fb89641d42
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/sys/controller/BaseController.java
@@ -1,8 +1,11 @@
package com.zy.asrs.wcs.sys.controller;
import com.zy.asrs.wcs.common.domain.BaseParam;
import com.zy.asrs.wcs.sys.entity.User;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import java.util.Map;
/**
 * Created by vincent on 1/30/2024
@@ -29,4 +32,15 @@
        return loginUser == null ? null : loginUser.getId();
    }
    public <T extends BaseParam> T buildParam(Map<String, Object> map, Class<T> clz) {
        T t  = null;
        try {
            t = clz.getDeclaredConstructor().newInstance();
            t.syncMap(map);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return t;
    }
}