All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.didiglobal.logi.security.service.impl.OplogExtraServiceImpl Maven / Gradle / Ivy

Go to download

logi-security 提供项目大多都需要的一些基础功能(用户、角色、权限、登录、注册、操作记录)

There is a newer version: 2.10.19
Show newest version
package com.didiglobal.logi.security.service.impl;

import com.didiglobal.logi.security.common.entity.OplogExtra;
import com.didiglobal.logi.security.common.enums.oplog.OplogCode;
import com.didiglobal.logi.security.dao.OplogExtraDao;
import com.didiglobal.logi.security.service.OplogExtraService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author cjm
 */
@Service("logiSecurityOplogExtraServiceImpl")
public class OplogExtraServiceImpl implements OplogExtraService {

    @Autowired
    private OplogExtraDao oplogExtraDao;

    @Override
    public void saveOplogExtraList(List nameList, OplogCode oplogCode) {
        if(oplogCode == null || CollectionUtils.isEmpty(nameList)) {
            return;
        }
        List oplogExtraList = new ArrayList<>();
        for(String name : nameList) {
            OplogExtra oplogExtra = new OplogExtra();
            oplogExtra.setInfo(name);
            oplogExtra.setType(oplogCode.getType());
        }
        oplogExtraDao.insertBatch(oplogExtraList);
    }

    @Override
    public List getOplogExtraNameListByType(Integer type) {
        List oplogExtraList = oplogExtraDao.selectListByType(type);
        List result = new ArrayList<>();
        for(OplogExtra oplogExtra : oplogExtraList) {
            result.add(oplogExtra.getInfo());
        }
        return result;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy