Worry-free mobile APP api
Global remarks: message: save information, data, the message that needs to be returned to the front end, success: true: indicates whether the request is successful or not
1. Registration information interface
Request address: http://localhost:8080/apcompany/student/registerphone=123456789&password=12345678&code=123456
parameter:
phone mobile phone number
password password
code verification code
Request method: POST
Sample request result
failure example {"message":"Mobile phone number or verification code is empty","data":"Mobile phone number or verification code is empty","success":false} Successful example {"message":"Registration succeeded", "data":{"grade":0,"id":5,"isIdentity":0, "password":"25D55AD283AA400AF464C76D713C07AD", "phone":"123456789","type":0}, "success":true}
2. Get verification code interface
Request address http://localhost:8080/apcompany/student/sendCode?phone=123456789
parameter phone mobile phone number
Request method: POST
Sample request result
"{\"stat\":\"100\",\"message\":\"·¢Ëͳɹ¦\"}"
The result is obtained from a third party. The description of stat will be added later. 100 is the success mark. The garbled code in the message means that the third party does not match our result set, which is an explanation. It is currently in communication.
3. Verify that the username exists
Request address http://localhost:8080/apcompany/student/validname/{name}
Parameter name: username
Request method: get
does not exist {"message":"操作成功!","data":false,"success":true} exist {"message":"操作成功!","data":true,"success":true} Note that the value is in data, and success indicates whether the request was successful or not.4. Verify that the phone number exists
Request address http://localhost:8080/apcompany/student/validphone/{phone}
Request parameters: phone mobile phone number
Request method: get
Request result:
exist {"message":"操作成功!","data":true,"success":true} does not exist {"message":"操作成功!","data":false,"success":true}5. Mobile phone, password login mode
Request address: http://localhost:8080/apcompany/student/login/nomal?phone=*******&password=*****
Parameter name: phone mobile phone number, password password
Request method: get
request result
{"message":"sucessful login","data":{"grade":0,"id":6,"isIdentity":0,"password":"25D55AD283AA400AF464C76D713C07AD","phone":"18901051605","type":0},"success":true}6 Account, password login mode
Request address: http://localhost:8080/apcompany/student/login/nomal?loginname=*******&password=*****
Request name: loginname registration name, password password
Request method: get
request result
Ditto for success fail {"message":"password does not match loginname","data":"password does not match loginname","success":false}7 Mobile phone number login method
Request address: http://localhost:8080/apcompany/student/login/phone?phone=*******&code=****
Request parameters: phone: mobile phone number, code verification code
Request method POST
result
{"message":"sucessful login","data":{"grade":0,"id":6,"isIdentity":0,"password":"25D55AD283AA400AF464C76D713C07AD","phone":"18901051605","type":0},"success":true}
8. WeChat login
Request address http://localhost:8080/apcompany/student/login/wechat?openid=*****
Request parameter: openid
request method post
result
{"message":"sucessful login","data":{"grade":0,"id":6,"isIdentity":0,"password":"25D55AD283AA400AF464C76D713C07AD","phone":"18901051605","type":0},"success":true}
9 Update user information
请求地址http://localhost:8080/apcompany/student/updateMessage
请求参数 grade 年级
phone 手机号
password 密码
deviceId 设备号
school 学校
openid 微信号
imageurl 图片地址
type 类别
id 学生唯一编号
loginname 登陆名称
请求方式:post
请求结果如下
{"message":"sucessful login","data":{"deviceId":"","grade":0,"id":6,"imageurl":"","isIdentity":0,"loginname":"dugu61888","name":"","opendid":"","password":"25D55AD283AA400AF464C76D713C07AD","phone":"18901051605","school":"","type":0},"success":true}