TaxAgentApi.java 1.34 KB
package com.diligrp.cashier.mall.api;

import com.diligrp.cashier.mall.service.biz.TaxAgentService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author lvqi
 */
@RestController
@RequestMapping("/tax")
public class TaxAgentApi {

    @Resource
    private TaxAgentService taxAgentService;

    @GetMapping("/order/init")
    public void initOrder() {
        taxAgentService.initOrder();
    }

    @GetMapping("/refund/init")
    public void initRefund() {
        taxAgentService.initRefund();
    }

    @GetMapping("/sync_order")
    public void syncOrder(@RequestParam("paymentIds") List<Long> paymentIds,
                          @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime) {
        taxAgentService.syncOrder(paymentIds, startTime, endTime);
    }

    @GetMapping("/sync_refund")
    public void syncRefund(@RequestParam("paymentIds") List<Long> paymentIds,
                           @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime) {
        taxAgentService.syncRefund(paymentIds, startTime, endTime);
    }


}