package com.tax.token.web.controller;


import com.alibaba.fastjson.JSON;
import com.tax.token.model.TokenReportReq;
import com.tax.token.model.TokenReportUpdateReq;
import com.tax.token.service.api.TkRealTokenLogService;
import com.tax.token.service.api.TkTokenService;
import com.tax.token.service.api.TkZoneInfoService;
import com.yxcheng.token.common.model.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/client/report/")
@ComponentScan(basePackages = {"com.tax.token.service"})
public class TokenReportController {

    @Autowired
    private TkTokenService tokenService;
    @Autowired
    private TkRealTokenLogService tkRealTokenLogService;

    @RequestMapping(value ="/selectTokenListPage" , method = RequestMethod.POST)
    public String selectTokenListPage(@RequestBody TokenReportReq tokenReportReq){
        return JSON.toJSONString(tokenService.selectTokenListPage(tokenReportReq));
    }

    @RequestMapping(value ="/updateTokenByIds" , method = RequestMethod.POST)
    public String updateTokenByIds(@RequestBody TokenReportUpdateReq tokenReportUpdateReq){
        return JSON.toJSONString(tokenService.updateTokenByIds(tokenReportUpdateReq));
    }

    @RequestMapping(value ="/updateTokenById" , method = RequestMethod.GET)
    public String updateTokenById(String applyId){
        JsonResult result = new JsonResult();
        result.setData(tokenService.updateTokenById(applyId));
        return JSON.toJSONString(result);
    }

    @RequestMapping(value ="/selectRealTokenListPage" , method = RequestMethod.POST)
    public String selectRealTokenListPage(@RequestBody TokenReportReq tokenReportReq){
        return JSON.toJSONString(tkRealTokenLogService.selectRealTokenListPage(tokenReportReq));
    }
}
