package com.younike.merchant;


import com.younike.common.core.controller.BaseController;
import com.younike.common.utils.StringUtils;
import com.younike.system.domain.UjdChangeRecord;
import com.younike.system.param.UjdChangeRedordQueryParam;
import com.younike.system.service.IUjdChangeRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import com.younike.common.core.page.TableDataInfo;

import javax.annotation.Resource;
import java.util.List;



@RestController
@RequestMapping("/merchant/ujdchange")
public class UjdChangeRecordController extends BaseController {
    @Resource
    private IUjdChangeRecordService iUjdChangeRecordService;

    /**
     * 查看保证金账单list
     * @param ujdChangeRedordQueryParam
     * @return
     */
    @GetMapping("/list")
    @PreAuthorize("@ss.hasRole('merchant')")
    public TableDataInfo ujdlist(UjdChangeRedordQueryParam ujdChangeRedordQueryParam){
        if (ObjectUtils.isEmpty(ujdChangeRedordQueryParam) || ujdChangeRedordQueryParam.getMerchantId() == null) {
            throw new ArithmeticException("参数错误");
        }
        startPage();
        List<UjdChangeRecord> ujdlist = iUjdChangeRecordService.ujdlist(ujdChangeRedordQueryParam);
        return getDataTable(ujdlist);
    }

}
