Git Product home page Git Product logo

appdevelopment's Introduction

AppDevelopment

夏季小学期app开发

目前状况

已实现:Dao层和Service层,基本的CRUD操作和一些特殊查询,譬如排序、票有效性查询等。

appdevelopment's People

Contributors

1092772959 avatar yangdongchao avatar

Forkers

yangdongchao

appdevelopment's Issues

登陆接口设计

登陆

接口

用户登陆

描述

接口格式为/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"
}

Manager Page 路由及接口

管理员页面功能需求

  1. 更换礼品
    • 手动添加礼品图片与描述
  2. 解决工单
    • 上传文本
  3. 用户管理
    • 普通用户与会员的放权与撤权
  4. 新闻推送


路由及接口

  • 下述若无特殊说明后端请一律通过控制响应头的 status_code 表示请求是否成功。
  • 安全性方面,暂定明文传输,所有请求接口基于session判别身份

登录

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.'
}

登陆接口设计_new

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"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.