MT2201Controller.java 1.9 KB
package com.sunyo.wlpt.message.builder.controller;

import com.sunyo.wlpt.message.builder.service.MT2201Service;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping(value = "/mt2201")
public class MT2201Controller {

    @Autowired
    private MT2201Service mt2201Service;

    /**
     *  生成报文
     * @param map
     * @return
     */
    @PostMapping("/creatMt2201")
    @ApiOperation(value = "生成报文")
    @ResponseBody
    public Map<String, Object> creatMt2201(@RequestBody Map<String, Object> map) {

        try {

            return mt2201Service.creatMt2201(map);
        }catch (Exception e){
            e.printStackTrace();
            Map<String, Object> maps = new HashMap<>();
            maps.put("status", "0");
            return maps;
        }

    }

    @PutMapping("/editMt2201")
    @ApiOperation(value = "修改报文")
    @ResponseBody
    public Map<String, Object> editMt2201(@RequestBody Map<String, Object> map) {

        try {

            return mt2201Service.editMt2201(map);
        }catch (Exception e){
            e.printStackTrace();
            Map<String, Object> maps = new HashMap<>();
            maps.put("status", "0");
            return maps;
        }

    }

    @PutMapping("/removeMt2201")
    @ApiOperation(value = "删除报文")
    @ResponseBody
    public Map<String, Object> removeMt2201(@RequestBody Map<String, Object> map) {

        try {

            return mt2201Service.removeMt2201(map);
        }catch (Exception e){
            e.printStackTrace();
            Map<String, Object> maps = new HashMap<>();
            maps.put("status", "0");
            return maps;
        }

    }

}