API设计

API设计
门户_用户接口
1、用户登录

request

    private int id;

    private String name;

response success

 public static CodeMsg SUCCESS = new CodeMsg(0, "success");

response fail

    public static CodeMsg SESSION_ERROR = new CodeMsg(500210, "Session不存在或者已经失效");
    public static CodeMsg PASSWORD_EMPTY = new CodeMsg(500211, "登录密码不能为空");
    public static CodeMsg MOBILE_EMPTY = new CodeMsg(500212, "手机号不能为空");
    public static CodeMsg MOBILE_ERROR = new CodeMsg(500213, "手机号格式错误");
    public static CodeMsg MOBILE_NOT_EXIST = new CodeMsg(500214, "手机号不存在");
    public static CodeMsg PASSWORD_ERROR = new CodeMsg(500215, "密码错误");

2、注册

request

    private int id;

    private String name;

response success

    public static CodeMsg SUCCESS = new CodeMsg(0, "success");

response fail

    public static CodeMsg MOBILE_EMPTY = new CodeMsg(500212, "手机号不能为空");
    public static CodeMsg MOBILE_ERROR = new CodeMsg(500213, "手机号格式错误");
    public static CodeMsg MOBILE_NOT_EXIST = new CodeMsg(500214, "手机号不存在");

3、检查手机号(用户名)是否有效

request

    private int id;

    private String name;

response success

    public static CodeMsg SUCCESS = new CodeMsg(0, "success");

response fail

    public static CodeMsg MOBILE_EMPTY = new CodeMsg(500212, "手机号不能为空");
    public static CodeMsg MOBILE_ERROR = new CodeMsg(500213, "手机号格式错误");
    public static CodeMsg MOBILE_NOT_EXIST = new CodeMsg(500214, "手机号不存在");

4、退出登录

request

无参数

response success

  public static CodeMsg SUCCESS = new CodeMsg(0, "success");

response fail

	public static CodeMsg SERVER_ERROR = new CodeMsg(500100, "服务端异常");

后台_订单接口
1、订单查看

resquest

无参数

response sucess

public static CodeMsg SUCCESS = new CodeMsg(0, "success");

response fail

public static CodeMsg ORDER_NOT_EXIST = new CodeMsg(500400, "订单不存在");

后台_商品接口
1、商品秒杀

request

  	private Long id;
    private Long userId;
    private Long orderId;
    private Long goodsId;

response success

	public static CodeMsg MIAO_SHA_OVER = new CodeMsg(500500, "商品已经秒杀完毕");

response fail

 	public static CodeMsg SERVER_ERROR = new CodeMsg(500100, "服务端异常");

2、重复秒杀商品

request

  	private Long id;
    private Long userId;
    private Long orderId;
    private Long goodsId;

response success

    public static CodeMsg REPEATE_MIAOSHA = new CodeMsg(500501, "不能重复秒杀");

response fail

 	public static CodeMsg SERVER_ERROR = new CodeMsg(500100, "服务端异常");
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值