|
|
package com.yohoufo.resource.controller;
|
|
|
|
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yoho.tools.docs.ApiOperation;
|
|
|
import com.yohoufo.common.ApiResponse;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 保证金相关配置
|
|
|
*/
|
|
|
@RestController
|
|
|
public class ConfigDepositController {
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(ConfigDepositController.class);
|
|
|
|
|
|
@Value("${deposit.prestore}")
|
|
|
private Integer depositPreStore;
|
|
|
|
|
|
@Value("${deposit.recharge.list}")
|
|
|
private String depositRechargeList;
|
|
|
|
|
|
/**
|
|
|
* <p>预存保证金</p>
|
|
|
*/
|
|
|
@ApiOperation(name = "ufo.resource.depositPreStore", desc="预存保证金")
|
|
|
@RequestMapping(params = "method=ufo.resource.depositPreStore")
|
|
|
@ResponseBody
|
|
|
public ApiResponse depositPreStore() {
|
|
|
|
|
|
logger.info("enter depositPreStore.get preStoreDeposit {}",depositPreStore);
|
|
|
|
|
|
if(depositPreStore==null||depositPreStore<=0){
|
|
|
throw new ServiceException(400,"请配置预存保证金!");
|
|
|
}
|
|
|
|
|
|
return new ApiResponse.ApiResponseBuilder().data(depositPreStore).code(200).message("预存保证金").build();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* <p>保证金充值列表</p>
|
|
|
*/
|
|
|
@ApiOperation(name = "ufo.resource.depositRechargeList", desc="保证金充值列表")
|
|
|
@RequestMapping(params = "method=ufo.resource.depositRechargeList")
|
|
|
@ResponseBody
|
|
|
public ApiResponse depositRechargeList() {
|
|
|
|
|
|
logger.info("enter depositPreStore.get depositRechargeList {}",depositRechargeList);
|
|
|
|
|
|
List<Integer> ls=new ArrayList<>();
|
|
|
if(StringUtils.isNotBlank(depositRechargeList)){
|
|
|
for(String str:depositRechargeList.split(",")){
|
|
|
if(StringUtils.isNotBlank(str)){
|
|
|
ls.add(Integer.parseInt(str));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return new ApiResponse.ApiResponseBuilder().data(ls).code(200).message("保证金充值列表").build();
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|