package com.msxf.paycore.api.controller;

import com.msxf.paycore.api.aspect.MethodRequired;
import com.msxf.paycore.api.controller.base.BaseApiController;
import com.msxf.paycore.domain.vo.request.*;
import com.msxf.paycore.domain.vo.result.PayCoreResult;
import com.msxf.paycore.service.biz.SignService;
import com.msxf.paycore.service.biz.UnsignService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @ Filename SignApiController.java
* @ Description
* @ Version 1.0
*/
@RestController
@RequestMapping(path="/sign",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "签约控制器接口",tags="签约控制器接口-SignApiController",description = "签约控制器接口",produces="application/json")
public class SignApiController extends BaseApiController {


@Autowired
private UnsignService unSignService;

@Autowired
private SignService signService;

/**
* 解约
* @param request 解约请求入参
* @return 解约结果返回
*/
@RequestMapping("unsign")
@ApiOperation(value = "解约请求接口",httpMethod = "POST")
PayCoreResult unsign(@RequestBody UnsignRequest request) {
return unSignService.unsign(request);
}

/**
* 条件查询签约信息
* @param request 查询其阿奴额入参
* @return 查询结果返回
*/
@RequestMapping("query")
@ApiOperation(value = "条件查询签约信息",httpMethod = "POST")
PayCoreResult query(@RequestBody QuerySignRequest request) {
return signService.query(request);
}

/**
*协议签约接口
* @param request
* @return
*/
@RequestMapping("sign")
@MethodRequired
@ApiOperation(value = "协议签约接口",httpMethod = "POST")
public PayCoreResult sign(@RequestBody SignRequest request){
return signService.sign(request);
}

/**
* 协议签约确认接口
* @param request
* @return
*/
@RequestMapping("signConfirm")
@ApiOperation(value = "协议签约确认接口",httpMethod = "POST")
PayCoreResult signConfirm(@RequestBody SignConfirmRequest request){
return signService.signConfirm(request);
}

/**
* 校验是否需要签约
* @param request
* @return
*/
@RequestMapping("checkSign")
@ApiOperation(value = "校验是否需要签约",httpMethod = "POST")
PayCoreResult checkSign(@RequestBody SignCheckRequest request){
return signService.signCheck(request);
}
}
12-17 21:44