美文网首页
集成接口发布

集成接口发布

作者: 左灯右行_ | 来源:发表于2018-08-16 08:57 被阅读0次

@Controller

@RequestMapping(value = "/MyController")

public class MyController {

private static final Logger LOGGER = LogR.getLogger(MyController.class.getName());

/**

  *

  * @param requestParameter 入参是json数组格式的字符串

  * @return

  * @throws JSONException

  */

@ResponseBody

@RequestMapping(value = "/MyMethod",method = RequestMethod.POST)

public MyVo MyMethod(String requsetParameter){

  MyVo myVo = null;

  try {

  //乱码处理

  requsetParameter = new String(requsetParameter.getBytes("iso-8859-1"),"utf-8");

  LOGGER.info(String.format(">>>MyController.saveOrUpdateMethod>>> requsetParameter:%s",requsetParameter));

  //入参判断

  if(StringUtils.isBlank(requsetParameter)){ 

    return new MyVo(MyVo.FAIL,MyVo.NOT_NULL,MyVo.FAIL_CODE);

  }

  myVo = MyService.saveOrUpdateMethod(requsetParameter);

  } catch (Exception e) {

  LOGGER.error(">>>MyService.saveOrUpdateMethod<<<执行异常", e);

  return new MyVo(MyVo.FAIL,MyVo.MSG_FAIL,MyVo.FAIL_CODE);

  }

  return myVo;

}

}

相关文章

  • 集成接口发布

    @Controller @RequestMapping(value = "/MyController") publ...

  • SpringBoot集成Swagger2出现Unable to

    现象: SpringBoot集成Swagger2进行接口发布,SpringBoot版本:2.0.1,Swagger...

  • Retrofit上传图片、参数

    1、接口定义: 2、代码集成:

  • 接口发布

    # 部署流程简化 ### 一 在节点机器上安装git > 使用的是centos7系统 首先更新git客户端的依赖 ...

  • 9.2接口下的继承者

    collection是集合类的基本接口(set,list)也是list和set的父接口,set接口set接口集成子...

  • 模块接口卡

    什么是模块接口卡? AIM(Advanced Integration Mode)--- 高级集成模块。高级集成模块...

  • JDBC Connection的close方法

    java.sql.Connectionjava.sql.Connection集成AutoCloseable接口,包...

  • 非线程安全 Map 简谈

    Map 框架 Map 框架集成于 Map 接口,除了早期的 Map 类,其他类集成于 AbstractMap 抽象...

  • SSM集成

    SSM SSM集成开发RESTful风格的API接口示例 主要集成以下框架: Spring SpringMVC M...

  • Robolectric实战(2)

    Robolectric接口测试 Robolectric的集成在上一章节中已经提到,如何集成Robolectric进...

网友评论

      本文标题:集成接口发布

      本文链接:https://www.haomeiwen.com/subject/licnbftx.html