TabletTaskApiController.java 1.87 KB
package com.huaheng.api.tablet.controller;

/**
 * @author xcq
 */

import com.huaheng.api.tablet.service.TabletTaskApiServiceImpl;
import com.huaheng.framework.aspectj.lang.annotation.ApiLogger;
import com.huaheng.framework.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 平板逻辑处理控制器
 * @author xcq
 */

@RestController
@RequestMapping("/api/tablet")
@Api(tags = {"平板请求处理接口"}, value = "平板请求处理接口")
public class TabletTaskApiController {
    @Resource
    private TabletTaskApiServiceImpl tabletApiService;


    /**
     * 查看所有出库任务
     */
    @PostMapping("/viewTasks")
    @ApiOperation("平板查看任务")
    @ResponseBody
    @ApiLogger(apiName = "平板查看任务", from="平板")
    public AjaxResult viewTasks(@RequestBody String port){
        return tabletApiService.viewTasksServer(port);
    }

    /**
     * 接受任务
     */
    @PostMapping("/acceptTask")
    @ApiOperation("接受任务")
    @ResponseBody
    @ApiLogger(apiName = "接受任务", from="平板")
    public AjaxResult acceptTask(@RequestBody Integer id){
        return tabletApiService.acceptTaskServer(id);
    }

    /**
     * 完成任务
     */
    @PostMapping("/finishTask")
    @ApiOperation("完成任务")
    @ResponseBody
    @ApiLogger(apiName = "完成任务", from="平板")
    public AjaxResult finishTask(@RequestBody Integer id){
        return tabletApiService.finishTaskServer(id);
    }

    /**
     * 取消任务
     */
    @PostMapping("/cancelTask")
    @ApiOperation("取消任务")
    @ResponseBody
    @ApiLogger(apiName = "取消任务", from="平板")
    public AjaxResult cancelTask(@RequestBody Integer id){
        return tabletApiService.cancelTaskServer(id);
    }

}