httpResult
来源:互联网 发布:常见web前后端数据交互 编辑:程序博客网 时间:2024/06/05 03:03
import org.apache.commons.lang3.StringUtils;public class HttpResult { // 响应状态码 private Integer code; // 响应体 private String body; public HttpResult() { } public HttpResult(Integer code, String body) { super(); this.code = code; if (StringUtils.isNotEmpty(body)) { this.body = body; } } public Integer getCode() { return code; } public void setCode(Integer code) { this.code = code; } public String getBody() { return body; } public void setBody(String body) { this.body = body; }}public ResponseEntity<String> insertAppoint(Appointment appointment) {if (StringUtils.isEmpty(appointment.getLOAN_MONEY()) ||StringUtils.isEmpty(appointment.getUSER_NAME()) ||StringUtils.isEmpty(appointment.getUSER_PHONE())) {return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(null);}try {indexService.insertAppoint(appointment);} catch (Exception e) {return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);}return ResponseEntity.status(HttpStatus.OK).body(null);}
阅读全文
0 0
- httpResult
- 好的 分布式系统(微服务) result 设计 rpcResult httpResult 设计
- java多线程:ExecutorService解析(五)
- BZOJ1050(HAOI2006)[旅行comf]--并查集
- Frank的【python网络爬虫系列教程】~序章&目录
- JAVA数据流概念及标准数据流的实现
- 暑假来临!花了点时间用flash3d做了一个MV歌曲!
- httpResult
- 源码安装 mysql的种种问题(已解决)
- python使用lxml解析html获取页面内所有叶子节点的xpath路径
- Rundll32
- linux内核--进程管理(一)
- linux下添加新用户,并赋予root权限
- ffmpeg开发之旅(6):详解ffmpeg命令在Android平台上的使用
- Python 爬虫入门 1 了解爬虫Scrapy
- 大型系统开发经验谈