mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-27 06:25:13 +08:00
add 新增运营端小程序"我的钱包"界面接口
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
package com.jsowell.api.uniapp.business;
|
||||
|
||||
import com.jsowell.common.core.controller.BaseController;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.response.RestApiResponse;
|
||||
import com.jsowell.pile.dto.MerchantOrderReportDTO;
|
||||
import com.jsowell.pile.service.BusinessFinancialService;
|
||||
import com.jsowell.pile.vo.uniapp.business.BusinessFinancialQueryResultVO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 运营端财务信息相关Controller
|
||||
*
|
||||
* @author Lemon
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/business/financial")
|
||||
public class BusinessFinancialController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private BusinessFinancialService businessFinancialService;
|
||||
|
||||
/**
|
||||
* 我的钱包界面查询接口
|
||||
*
|
||||
* @param dto 查询参数
|
||||
* @return 钱包信息查询结果
|
||||
*/
|
||||
@PostMapping("/")
|
||||
public RestApiResponse<?> getMyWallet(@RequestBody MerchantOrderReportDTO dto) {
|
||||
logger.info("我的钱包查询 merchantId:{}", dto != null ? dto.getMerchantId() : null);
|
||||
RestApiResponse<?> response;
|
||||
try {
|
||||
// 参数验证
|
||||
if (dto == null || StringUtils.isBlank(dto.getMerchantId())) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
|
||||
BusinessFinancialQueryResultVO result = businessFinancialService.getMyWallet(dto);
|
||||
response = new RestApiResponse<>(result);
|
||||
logger.info("我的钱包查询成功 merchantId:{}", dto.getMerchantId());
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("我的钱包查询业务异常 merchantId:{}, code:{}, message:{}",
|
||||
dto != null ? dto.getMerchantId() : null, e.getCode(), e.getMessage(), e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("我的钱包查询系统异常 merchantId:{}",
|
||||
dto != null ? dto.getMerchantId() : null, e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user