package com.fzzy.gateway.service;
|
|
import com.bstek.dorado.annotation.DataProvider;
|
import com.bstek.dorado.annotation.DataResolver;
|
import com.bstek.dorado.annotation.Expose;
|
import com.fzzy.gateway.entity.GatewayConf;
|
import com.fzzy.gateway.service.repository.GatewayConfRep;
|
import org.springframework.beans.BeanUtils;
|
import org.springframework.stereotype.Component;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
|
@Component
|
public class GatewayConfService {
|
|
@Resource
|
private GatewayConfRep gatewayConfRep;
|
|
|
/**
|
* gatewayConfService#listAll
|
*
|
* @return
|
*/
|
@DataProvider
|
public List<GatewayConf> listAll() {
|
|
List<GatewayConf> list = gatewayConfRep.findAll();
|
|
return list;
|
}
|
|
/**
|
* gatewayConfService#listAll#updateSave
|
*
|
* @param entity
|
*/
|
@DataResolver
|
public void updateSave(GatewayConf entity) {
|
GatewayConf data = new GatewayConf();
|
BeanUtils.copyProperties(entity, data);
|
gatewayConfRep.save(data);
|
}
|
|
/**
|
* gatewayConfService#delData
|
*
|
* @param data
|
*/
|
@Expose
|
public String delData(GatewayConf data) {
|
|
GatewayConf data2 = new GatewayConf();
|
BeanUtils.copyProperties(data, data2);
|
gatewayConfRep.delete(data2);
|
return null;
|
}
|
}
|