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

import com.red.circle.console.app.dto.clienobject.user.UserFreightSellerCO;
import com.red.circle.console.app.service.app.user.UserFreightSellerService;
import com.red.circle.console.infra.annotations.OpsOperationReqLog;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.wallet.inner.model.cmd.UserFreightSellerPageQryCmd;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 经销商卖家信息 前端控制器.
 * </p>
 *
 * @author zongpubin on 2023-07-14 15:28
 */
@RestController
@RequestMapping("/freight-seller")
@RequiredArgsConstructor
public class UserFreightSellerRestController extends BaseController {

  private final UserFreightSellerService userFreightSellerService;

  /**
   * 获取经销商卖家信息-分页列表.
   */
  @GetMapping("/page")
  public PageResult<UserFreightSellerCO> pageFreightSeller(
      UserFreightSellerPageQryCmd query) {
    return userFreightSellerService.pageFreightSeller(query);
  }

  /**
   * 删除经销商卖家信息。
   */
  @OpsOperationReqLog("删除经销商卖家")
  @DeleteMapping("/delete/{id}")
  public void deleteFreightSeller(@PathVariable("id") Long id
  ) {
    userFreightSellerService.removeFreightSeller(id);
  }


}
