package com.red.circle.other.adapter.app.user.user;

import com.red.circle.common.business.dto.cmd.AppExtCommand;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.app.dto.clientobject.user.UserFreightBalanceCO;
import com.red.circle.other.app.service.user.UserFreightBalanceRestService;
import com.red.circle.wallet.inner.model.cmd.UserFreightBalancePageQryCmd;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户货运账户 前端控制器.
 *
 * @author system
 * @eo.api-type http
 * @eo.groupName 用户服务.用户货运账户
 * @eo.path /user/freight-balance
 * @since 2025-10-21
 */
@Slf4j
@RestController
@RequestMapping(value = "/user/freight-balance", produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class UserFreightBalanceRestController extends BaseController {

  private final UserFreightBalanceRestService userFreightBalanceRestService;

  /**
   * 分页查询用户货运账户.
   *
   * @eo.name 分页查询用户货运账户.
   * @eo.url /page
   * @eo.method get
   * @eo.request-type formdata
   */
  @GetMapping("/page")
  public PageResult<UserFreightBalanceCO> pageFreight(UserFreightBalancePageQryCmd cmd, AppExtCommand appExtCommand) {
    return userFreightBalanceRestService.pageFreight(cmd, appExtCommand);
  }

}
