11 | * {@link org.xutils.http.annotation.HttpRequest} 注解的参数构建的模板接口 12 | */ 13 | public interface ParamsBuilder { 14 | 15 | /** 16 | * 根据@HttpRequest构建请求的url 17 | */ 18 | String buildUri(RequestParams params, HttpRequest httpRequest) throws Throwable; 19 | 20 | /** 21 | * 根据注解的cacheKeys构建缓存的自定义key, 22 | * 如果返回为空, 默认使用 url 和整个 query string 组成. 23 | */ 24 | String buildCacheKey(RequestParams params, String[] cacheKeys); 25 | 26 | /** 27 | * 自定义SSLSocketFactory 28 | */ 29 | SSLSocketFactory getSSLSocketFactory() throws Throwable; 30 | 31 | /** 32 | * 为请求添加通用参数等操作 33 | */ 34 | void buildParams(RequestParams params) throws Throwable; 35 | 36 | /** 37 | * 自定义参数签名 38 | */ 39 | void buildSign(RequestParams params, String[] signs) throws Throwable; 40 | } 41 | -------------------------------------------------------------------------------- /Android/AutoBook/xutils/src/main/java/org/xutils/http/app/RedirectHandler.java: -------------------------------------------------------------------------------- 1 | package org.xutils.http.app; 2 | 3 | import org.xutils.http.RequestParams; 4 | import org.xutils.http.request.UriRequest; 5 | 6 | /** 7 | * Created by wyouflf on 15/11/12. 8 | * 请求重定向控制接口 9 | */ 10 | public interface RedirectHandler { 11 | 12 | /** 13 | * 根据请求信息返回自定义重定向的请求参数 14 | * 15 | * @param request 原始请求 16 | * @return 返回不为null时进行重定向 17 | */ 18 | RequestParams getRedirectParams(UriRequest request) throws Throwable; 19 | } 20 | -------------------------------------------------------------------------------- /Android/AutoBook/xutils/src/main/java/org/xutils/http/app/RequestInterceptListener.java: -------------------------------------------------------------------------------- 1 | package org.xutils.http.app; 2 | 3 | 4 | import org.xutils.http.request.UriRequest; 5 | 6 | /** 7 | * Created by wyouflf on 15/11/10. 8 | * 拦截请求响应(在后台线程工作). 9 | *
10 | * 用法: 11 | * 1. 请求的callback参数同时实现RequestInterceptListener 12 | * 2. 或者使用 @HttpRequest 注解实现ParamsBuilder接口 13 | */ 14 | public interface RequestInterceptListener { 15 | 16 | /** 17 | * 检查请求参数等处理 18 | */ 19 | void beforeRequest(UriRequest request) throws Throwable; 20 | 21 | /** 22 | * 检查请求相应头等处理 23 | */ 24 | void afterRequest(UriRequest request) throws Throwable; 25 | } -------------------------------------------------------------------------------- /Android/AutoBook/xutils/src/main/java/org/xutils/http/app/RequestTracker.java: -------------------------------------------------------------------------------- 1 | package org.xutils.http.app; 2 | 3 | import org.xutils.http.RequestParams; 4 | import org.xutils.http.request.UriRequest; 5 | 6 | /** 7 | * Created by wyouflf on 15/9/10. 8 | * 请求过程追踪, 适合用来记录请求日志. 9 | * 所有回调方法都在主线程进行. 10 | *
11 | * 用法:
12 | * 1. 将RequestTracker实例设置给请求参数RequestParams.
13 | * 2. 请的callback参数同时实现RequestTracker接口;
14 | * 3. 注册给UriRequestFactory的默认RequestTracker.
15 | * 注意: 请求回调RequestTracker时优先级按照上面的顺序,
16 | * 找到一个RequestTracker的实现会忽略其他.
17 | */
18 | public interface RequestTracker {
19 |
20 | void onWaiting(RequestParams params);
21 |
22 | void onStart(RequestParams params);
23 |
24 | void onRequestCreated(UriRequest request);
25 |
26 | void onCache(UriRequest request, Object result);
27 |
28 | void onSuccess(UriRequest request, Object result);
29 |
30 | void onCancelled(UriRequest request);
31 |
32 | void onError(UriRequest request, Throwable ex, boolean isCallbackError);
33 |
34 | void onFinished(UriRequest request);
35 | }
36 |
--------------------------------------------------------------------------------
/Android/AutoBook/xutils/src/main/java/org/xutils/http/app/ResponseParser.java:
--------------------------------------------------------------------------------
1 | package org.xutils.http.app;
2 |
3 |
4 | import java.lang.reflect.Type;
5 |
6 | /**
7 | * Created by wyouflf on 15/8/4.
8 | * {@link org.xutils.http.annotation.HttpResponse} 注解的返回值转换模板
9 | *
10 | * @param
12 | * Author: wyouflf
13 | * Time: 2014/05/30
14 | */
15 | /*package*/ class InputStreamLoader extends Loader
5 |
6 |
7 |
8 |
9 |
10 |
11 | 前端示例图:
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/back_end/README.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/back_end/diancan/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**
5 | !**/src/test/**
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 |
30 | ### VS Code ###
31 | .vscode/
32 |
--------------------------------------------------------------------------------
/back_end/diancan/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/swing0/auto_order_meal/c538f620f18baf8072af00eb619eaa548d94c3bd/back_end/diancan/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/back_end/diancan/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
3 |
--------------------------------------------------------------------------------
/back_end/diancan/src/main/java/com/order/diancan/AutoRefer/MyElement.java:
--------------------------------------------------------------------------------
1 | package com.order.diancan.AutoRefer;
2 |
3 |
4 | //菜品类
5 | public class MyElement implements Comparable{
6 | //菜品
7 | public int id;
8 | //菜品价格
9 | public float price;
10 | //菜品评分
11 | public float score;
12 | //是否推荐该菜品
13 | public boolean take ;
14 |
15 | public int getId() {
16 | return id;
17 | }
18 | public float getPrice() {
19 | return price;
20 | }
21 | public float getScore() {
22 | return score;
23 | }
24 | public boolean isTake() {
25 | return take;
26 | }
27 | public MyElement(int id, float price, float score, boolean take) {
28 | this.id = id;
29 | this.price = price;
30 | this.score = score;
31 | this.take = take;
32 | }
33 | // 更改实现的方法,方便调用系统函数
34 | @Override
35 | public int compareTo(Object o) {
36 | if (score / price < ((MyElement) o).score / ((MyElement) o).price) {
37 | return 1; // 注意,此处主要用于排序,从大到小排序,所以故意反
38 | } else {
39 | return -1;
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/back_end/diancan/src/main/java/com/order/diancan/DiancanApplication.java:
--------------------------------------------------------------------------------
1 | package com.order.diancan;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class DiancanApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(DiancanApplication.class, args);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/back_end/diancan/src/main/java/com/order/diancan/bean/Admin.java:
--------------------------------------------------------------------------------
1 | package com.order.diancan.bean;
2 |
3 | import java.io.Serializable;
4 |
5 | public class Admin implements Serializable {
6 | private long id;
7 | private String account;
8 | private String password;
9 | private long restaurant_id;
10 |
11 | public long getId() {
12 | return id;
13 | }
14 |
15 | public void setId(long id) {
16 | this.id = id;
17 | }
18 |
19 | public String getAccount() {
20 | return account;
21 | }
22 |
23 | public void setAccount(String account) {
24 | this.account = account;
25 | }
26 |
27 | public String getPassword() {
28 | return password;
29 | }
30 |
31 | public void setPassword(String password) {
32 | this.password = password;
33 | }
34 |
35 | public long getRestaurant_id() {
36 | return restaurant_id;
37 | }
38 |
39 | public void setRestaurant_id(long restaurant_id) {
40 | this.restaurant_id = restaurant_id;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/back_end/diancan/src/main/java/com/order/diancan/bean/Order.java:
--------------------------------------------------------------------------------
1 | package com.order.diancan.bean;
2 |
3 | import java.io.Serializable;
4 | import java.sql.Timestamp;
5 | import java.util.Date;
6 |
7 | public class Order implements Serializable {
8 | private Long id;
9 | private Long price;
10 | private String date;
11 | private Integer state;
12 | private Long restaurant_id;
13 | private String dish_id_list;
14 | private Long customer_id;
15 |
16 | public Long getId() {
17 | return id;
18 | }
19 |
20 | public void setId(Long id) {
21 | this.id = id;
22 | }
23 |
24 | public Long getPrice() {
25 | return price;
26 | }
27 |
28 | public void setPrice(Long price) {
29 | this.price = price;
30 | }
31 |
32 | public String getDate() {
33 | return date;
34 | }
35 |
36 | public void setDate(String date) {
37 | this.date = date;
38 | }
39 |
40 | public Integer getState() {
41 | return state;
42 | }
43 |
44 | public void setState(Integer state) {
45 | this.state = state;
46 | }
47 |
48 | public Long getRestaurant_id() {
49 | return restaurant_id;
50 | }
51 |
52 | public void setRestaurant_id(Long restaurant_id) {
53 | this.restaurant_id = restaurant_id;
54 | }
55 |
56 | public String getDish_id_list() {
57 | return dish_id_list;
58 | }
59 |
60 | public void setDish_id_list(String dish_id_list) {
61 | this.dish_id_list = dish_id_list;
62 | }
63 |
64 | public Long getCustomer_id() {
65 | return customer_id;
66 | }
67 |
68 | public void setCustomer_id(Long customer_id) {
69 | this.customer_id = customer_id;
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/back_end/diancan/src/main/java/com/order/diancan/bean/OrderId.java:
--------------------------------------------------------------------------------
1 | package com.order.diancan.bean;
2 |
3 | import java.io.Serializable;
4 | import java.util.List;
5 |
6 | public class OrderId implements Serializable {
7 | private Long id;
8 |
9 | public OrderId(){}
10 |
11 | public OrderId(Long id) {
12 | this.id = id;
13 | }
14 |
15 | public Long getId() {
16 | return id;
17 | }
18 |
19 | public void setId(Long id) {
20 | this.id = id;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/back_end/diancan/src/main/java/com/order/diancan/bean/OrderState.java:
--------------------------------------------------------------------------------
1 | package com.order.diancan.bean;
2 |
3 | public class OrderState {
4 | private Long id;
5 | private Integer state;
6 |
7 | public Long getId() {
8 | return id;
9 | }
10 |
11 | public void setId(Long id) {
12 | this.id = id;
13 | }
14 |
15 | public Integer getState() {
16 | return state;
17 | }
18 |
19 | public void setState(Integer state) {
20 | this.state = state;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/back_end/diancan/src/main/java/com/order/diancan/bean/OrderStates.java:
--------------------------------------------------------------------------------
1 | package com.order.diancan.bean;
2 |
3 | import java.util.List;
4 |
5 | public class OrderStates {
6 | private List