夏季小学期app开发
已实现:Dao层和Service层,基本的CRUD操作和一些特殊查询,譬如排序、票有效性查询等。
夏季小学期app开发
接口格式为/api/login
post请求,返回token及用户身份
{
"user_id":"122333"
"password":"123322"
}
{
"status":"success",
"message":null,
"data":
{
"token":"dshdffodnjknvjkhahfahfwief",
"identity":"1",
"userName":"",
"userId":""
}
}
url:"api/user/favorite/add"
// 请求1。用户添加收藏
{
"method":"GET",
"headers":"你们看",
"Content-Type":"application/json"
}
后端需要参数: userId,articleId.
后端返回参数:
返回数据格式
{
"status":"success",//status表示成功或失败
"message":null,
}
url:"api/user/favorite/delete"
// 请求1。用户删除收藏
{
"method":"GET",
"headers":"你们看",
"Content-Type":"application/json"
}
后端需要参数: userId,articleId.
后端返回参数:
返回数据格式
{
"status":"success",//status表示成功或失败
"message":null,
}
url:"/api/rank"
// 请求1
{
"method":"GET",
"headers":"你们看",
"Content-Type":"application/json"
}
// 返回1 每一个item包含一个userinfo的信息,在"info"中体现
// info里面还要加个img_url,见用户信息接口
{
"items":[
{ //按顺序
"id":"1",
"rankType":"dayRank",
"info":{
"id":"1",
"name":"顾斌",
"region":"计算机学院",
"anyStep":4912
},
"rankStatus":1 //第几名
},
{
"id":"2",
"rankType":"dayRank",
"info":{
"id":"1",
"name":"顾斌",
"region":"计算机学院",
"anyStep":4911
},
"rankStatus":2
},
{
"id":"3",
"rankType":"dayRank",
"info":{
"id":"1",
"name":"顾斌",
"region":"计算机学院",
"anyStep":4910
},
"rankStatus":3
},
{
"id":"4",
"rankType":"weekRank",
"info":{
"id":"1",
"name":"顾斌",
"region":"计算机学院",
"anyStep":4912
},
"rankStatus":1
},
{
"id":"5",
"rankType":"weekRank",
"info":{
"id":"1",
"name":"顾斌",
"region":"计算机学院",
"anyStep":4911
},
"rankStatus":2
},
{
"id":"6",
"rankType":"weekRank",
"info":{
"id":"1",
"name":"顾斌",
"region":"计算机学院",
"anyStep":4910
},
"rankStatus":3
},
{
"id":"7",
"rankType":"monthRank",
"info":{
"id":"1",
"name":"顾斌",
"region":"计算机学院",
"anyStep":4912
},
"rankStatus":1
},
{
"id":"8",
"rankType":"monthRank",
"info":{
"id":"1",
"name":"顾斌",
"region":"计算机学院",
"anyStep":4911
},
"rankStatus":2
},
{
"id":"9",
"rankType":"monthRank",
"info":{
"id":"1",
"name":"顾斌",
"region":"计算机学院",
"anyStep":4910
},
"rankStatus":3
},
{
"id":"10",
"rankType":"seasonRank",
"info":{
"id":"1",
"name":"顾斌",
"region":"计算机学院",
"anyStep":4912
},
"rankStatus":1
},
{
"id":"11",
"rankType":"seasonRank",
"info":{
"id":"1",
"name":"顾斌",
"region":"计算机学院",
"anyStep":4911
},
"rankStatus":2
},
{
"id":"12",
"rankType":"seasonRank",
"info":{
"id":"1",
"name":"顾斌",
"region":"计算机学院",
"anyStep":4910
},
"rankStatus":3
}
]
}
//请求2
{
"method":"POST",
"headers":"你们看",
"Content-Type":"application/x-www-form-urlencoded",
"body":{
"today_step":3,
"week_step":3,
"month_step":3,
"total_step":3,
}
}
// 返回2
{
"status":"200"
}
url:"/api/userinfo"
// 请求1
{
"method":"GET",
"headers":"你们看",
"Content-Type":"application/json"
}
// 返回1
{
"id":"1",
"name":"顾斌",
"department":"计算机学院",
"anyStep":4912,//随便写
"img_url":"xxx"
}
url:"/api/news"
// 请求1
{
"method":"GET",
"headers":"你们看",
"Content-Type":"application/json"
}
// 返回1
{
"items":[
{
"id":"1", //此处不可重复
"real_id":"1", //此处为真实的news/ticket id
"title":"All Best Buy stores can now repair your Apple devices",
"author":"Chris Welch",
"abstract":"This morning, Apple announced that Best Buy now offers authorized repairs on its products at each and every one of the retailer’s stores. This gives consumers an important alternative to visiting their nearest Apple store — if there even is one — for service on an iPhone or Mac. Repairs are done with genuine Apple parts and are fully backed by the company, just as if Apple had done the work itself.",
"content":"This morning, Apple announced that Best Buy now offers authorized repairs on its products at each and every one of the retailer’s stores. This gives consumers an important alternative to visiting their nearest Apple store — if there even is one — for service on an iPhone or Mac. Repairs are done with genuine Apple parts and are fully backed by the company, just as if Apple had done the work itself.\n Best Buy has offered Apple repairs at many locations for some time now, but the completed expansion brings that number up to nearly 1,000 stores. “Best Buy’s Geek Squad has nearly 7,600 newly Apple-certified technicians ready to make same-day iPhone repairs or to service other Apple products,” Apple said in a press release. There are Best Buy stores in neighborhoods that might not have an Apple presence, so this is a nice option to have at the ready. Most Best Buy locations have Apple showcase sections with the company’s iOS devices, MacBooks, HomePod, and other products.\n At its own stores, Apple has recently been pushing to speed up keyboard repairs for its MacBook, MacBook Air, and MacBook Pro laptops, promising a next-day turnaround in many cases. It’s unclear whether Best Buy has also begun replacing the third-generation butterfly keyboard with 2019’s revamped version.\n For its same-day iPhone screen replacements, Best Buy recommends that customers make an appointment and drop off their device before 6PM local time. Assuming the necessary parts are in stock, you’ll get your phone back that day or can just browse around the store while you wait for the repair to be completed.",
"date":"2019-6-20",
"is_ticket":false
},
{
"id":"2",
"real_id":"1", //此处为真实的news/ticket id
"title":"Apple Struggles To Find Quick Fix For Major iPhone Problem",
"author":"Chris Welch",
"abstract":"This morning, Apple announced that Best Buy now offers authorized repairs on its products at each and every one of the retailer’s stores. This gives consumers an important alternative to visiting their nearest Apple store — if there even is one — for service on an iPhone or Mac. Repairs are done with genuine Apple parts and are fully backed by the company, just as if Apple had done the work itself.",
"content":"This morning, Apple announced that Best Buy now offers authorized repairs on its products at each and every one of the retailer’s stores. This gives consumers an important alternative to visiting their nearest Apple store — if there even is one — for service on an iPhone or Mac. Repairs are done with genuine Apple parts and are fully backed by the company, just as if Apple had done the work itself.\n Best Buy has offered Apple repairs at many locations for some time now, but the completed expansion brings that number up to nearly 1,000 stores. “Best Buy’s Geek Squad has nearly 7,600 newly Apple-certified technicians ready to make same-day iPhone repairs or to service other Apple products,” Apple said in a press release. There are Best Buy stores in neighborhoods that might not have an Apple presence, so this is a nice option to have at the ready. Most Best Buy locations have Apple showcase sections with the company’s iOS devices, MacBooks, HomePod, and other products.\n At its own stores, Apple has recently been pushing to speed up keyboard repairs for its MacBook, MacBook Air, and MacBook Pro laptops, promising a next-day turnaround in many cases. It’s unclear whether Best Buy has also begun replacing the third-generation butterfly keyboard with 2019’s revamped version.\n For its same-day iPhone screen replacements, Best Buy recommends that customers make an appointment and drop off their device before 6PM local time. Assuming the necessary parts are in stock, you’ll get your phone back that day or can just browse around the store while you wait for the repair to be completed.",
"date":"2019-6-20",
"is_ticket":true,
"cnt":20,
"icon_path":"",
"vedio_path":"",
"does_get":false,
"current":15
},
{
"id":"3",
"real_id":"1", //此处为真实的news/ticket id
"title":"Apple May Move 30% of Its iPhone Production From China. This Analyst Disagrees",
"author":"Chris Welch",
"abstract":"This morning, Apple announced that Best Buy now offers authorized repairs on its products at each and every one of the retailer’s stores. This gives consumers an important alternative to visiting their nearest Apple store — if there even is one — for service on an iPhone or Mac. Repairs are done with genuine Apple parts and are fully backed by the company, just as if Apple had done the work itself.",
"content":"This morning, Apple announced that Best Buy now offers authorized repairs on its products at each and every one of the retailer’s stores. This gives consumers an important alternative to visiting their nearest Apple store — if there even is one — for service on an iPhone or Mac. Repairs are done with genuine Apple parts and are fully backed by the company, just as if Apple had done the work itself.\n Best Buy has offered Apple repairs at many locations for some time now, but the completed expansion brings that number up to nearly 1,000 stores. “Best Buy’s Geek Squad has nearly 7,600 newly Apple-certified technicians ready to make same-day iPhone repairs or to service other Apple products,” Apple said in a press release. There are Best Buy stores in neighborhoods that might not have an Apple presence, so this is a nice option to have at the ready. Most Best Buy locations have Apple showcase sections with the company’s iOS devices, MacBooks, HomePod, and other products.\n At its own stores, Apple has recently been pushing to speed up keyboard repairs for its MacBook, MacBook Air, and MacBook Pro laptops, promising a next-day turnaround in many cases. It’s unclear whether Best Buy has also begun replacing the third-generation butterfly keyboard with 2019’s revamped version.\n For its same-day iPhone screen replacements, Best Buy recommends that customers make an appointment and drop off their device before 6PM local time. Assuming the necessary parts are in stock, you’ll get your phone back that day or can just browse around the store while you wait for the repair to be completed.",
"date":"2019-6-20",
"is_ticket":false
}
]
}
//请求2
{
"method":"POST",
"headers":"你们看",
"Content-Type":"application/x-www-form-urlencoded",
"body":{
"user_id":"",
"ticket_id":""
}
}
// 返回2
{
"status":"200"
}
http://host/api/manager/login
{ // request post
"userId": "account"
"passwd": "VzEIxwQU"
}
若登录成功后服务器请重定向页面
http://host/path/to/home.html
get方式无参请求
http://host/api/manager/awards/list
[ // respond
{
"id": 1,
"title": "huawei P90",
"img": '/path/to/file',
"desc": "Lorem ipsum dolor sit amet consectetur adipisicing elit.",
"step": 1000 // rewards threshold
},
{
"id": 2,
"name": "rongyao v20",
"img": '/path/to/file',
"desc": "Lorem ipsum dolor sit amet consectetur adipisicing elit.",
"step": 1000
},
]
http://host/api/manager/awards/update
{ // request post
"img": 'base64Code',
"name": "huawei P90",
"desc": 'Lorem ipsum dolor sit amet consectetur adipisicing elit.', // description
"step": 1000, // rewards threshold
}
http://host/api/manager/awards/delete
[ // request post
{id: 1},
{id: 2}
]
等前端完成..
get方式无参请求
http://host/api/manager/users/list
[ // respond
{
"id": 1,
"name": "foo",
"type": 0, // 0--normal; 1--member
"step": 1000
},
{
"id": 2,
"name": "bar",
"type": 1,
"step": 0
}
]
http://host/api/manager/users/update
[ // request post
{id: 1},
{id: 2}
]
http://host/api/manager/news/update
{ // request
"title": 'Untitled-1',
"date": "2019-07-06",
"content": 'Lorem ipsum dolor sit amet consectetur adipisicing elit.'
}
url:"/api/login"
// 请求
{
"method":"POST",
"body":
{
"username":"1612xxxx",
"password":"xxxxxxxx"
},
"headers":"你们看",
"Content-Type":"application/x-www-form-urlencoded"
}
// 返回
{
"status":"200" // 200:成功,其他参照标准
}
url:"/api/message"
// 请求1
{
"method":"GET",
"headers":"你们看",
"Content-Type":"application/json"
}
// 返回1
{
"items": [
{
"id": "1",
"send_id": "1",
"receive_id": "2",
"context": "怎么才能领奖?",
"send_time": "2019-6-10",
"type": ""
},
{
"id": "2",
"send_id": "2",
"receive_id": "1",
"context": "你说呢",
"send_time": "2019-6-10",
"type": ""
},
{
"id": "3",
"send_id": "1",
"receive_id": "2",
"context": "到底怎么才能领奖?啊啊啊啊啊啊\n啊啊啊啊\n啊啊啊\n",
"send_time": "2019-6-10",
"type": ""
}
]
}
// 请求2
{
"method":"POST",
"headers":"你们看",
"Content-Type":"application/x-www-form-urlencoded",
"body":{
"user_id":"1",
"type":"",
"content":""
}
}
// 返回2
{
"status":"200"
}
url:"/api/gift"
// 请求1
{
"method":"GET",
"headers":"你们看",
"Content-Type":"application/json"
}
// 返回1
{
"items":[
{
"name":"xiaomi",
"id":"1",
"description":"Throughout the history of smartphones, Snapdragon™ has been there as an engine powering the world's devices. Now, the Snapdragon™ 855 presents another leap forward in performance. Made with 7nm process technology, it leads the pack, and we are proud to be the first to put it in your hands through Mi 9.",
"redeemed":false, //是否兑换过,参照兑换记录
"available":false, //是否可兑换,否(固定)
"year":2019,
"month":6,
"day":10,
"stepNeed":10000, //需要的步数
"stepNow":0, //0(固定)
"img_url":"xxx" //有且只有一条
}
]
}
//请求2
{
"method":"POST",
"headers":"你们看",
"Content-Type":"application/x-www-form-urlencoded",
"body":{
"user_id":"xxx",
"prize_id":"xxx"
}
}
// 返回2
{
"status":"200"
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.