package com.cusc.nirvana.user.rnr.fp.controller;

import com.cusc.nirvana.user.rnr.fp.dto.InstructionDTO;
import com.cusc.nirvana.user.rnr.fp.dto.InstructionRespDTO;
import com.cusc.nirvana.user.rnr.fp.service.IInstructionService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * T1指令下发
 */
@RestController
@RequestMapping("/t1")
public class T1InstructionController {

    @Resource
    private IInstructionService instructionService;

    /**
     * Description: 指令处理
     * <br />
     * CreateDate 2022-06-07 20:11:49
     *
     * @author yuyi
     **/
    @PostMapping("/instruction")
    @ApiOperation(value = "t1-instruction测试", notes = "t1-instruction测试")
    public InstructionRespDTO instruction(@RequestBody InstructionDTO instructionDTO) {
        return instructionService.uploadInfo(instructionDTO);
    }


     /**
       * @author: jk
       * @description: 用于指令下发
       * @date: 2022/7/26 15:39
       * @version: 1.0
       */
    @PostMapping("/instructions")
    @ApiOperation(value = "指令下发", notes = "指令下发")
    public InstructionRespDTO instructions(@RequestBody InstructionDTO instructionDTO) {
        return instructionService.instructionsIssue(instructionDTO);
    }
}
