├── ItBook
├── .gitignore
├── .idea
│ ├── encodings.xml
│ ├── gradle.xml
│ ├── misc.xml
│ └── runConfigurations.xml
├── app
│ ├── .gitignore
│ ├── build.gradle
│ ├── libs
│ │ └── volley.jar
│ ├── proguard-rules.pro
│ ├── release
│ │ ├── ITBook.apk
│ │ └── output.json
│ ├── src
│ │ ├── androidTest
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── glc
│ │ │ │ └── itbook
│ │ │ │ └── ExampleInstrumentedTest.java
│ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── glc
│ │ │ │ │ └── itbook
│ │ │ │ │ ├── AddActivity.java
│ │ │ │ │ ├── BanBenActivity.java
│ │ │ │ │ ├── LoginActivity.java
│ │ │ │ │ ├── MenuActivity.java
│ │ │ │ │ ├── RegistActivity.java
│ │ │ │ │ ├── UpdateActity.java
│ │ │ │ │ ├── UpdateItemActivity.java
│ │ │ │ │ ├── XiangQingActivity.java
│ │ │ │ │ ├── bean
│ │ │ │ │ └── Book.java
│ │ │ │ │ └── fragment
│ │ │ │ │ ├── Fragment_dongtai.java
│ │ │ │ │ ├── Fragment_index.java
│ │ │ │ │ └── Fragment_wode.java
│ │ │ └── res
│ │ │ │ ├── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ │ ├── drawable
│ │ │ │ ├── add.png
│ │ │ │ ├── admin.jpg
│ │ │ │ ├── banben.png
│ │ │ │ ├── bg.jpg
│ │ │ │ ├── bg_edit.xml
│ │ │ │ ├── bg_edit2.xml
│ │ │ │ ├── buttonstyle.xml
│ │ │ │ ├── buttonstyle2.xml
│ │ │ │ ├── dianhua.png
│ │ │ │ ├── dongtai.png
│ │ │ │ ├── dongtai1.png
│ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ ├── index.png
│ │ │ │ ├── index1.png
│ │ │ │ ├── me.png
│ │ │ │ ├── me1.png
│ │ │ │ ├── mima.png
│ │ │ │ ├── sousuo.png
│ │ │ │ ├── updatebook.png
│ │ │ │ ├── youjiantou.png
│ │ │ │ └── zuojiantou.png
│ │ │ │ ├── layout
│ │ │ │ ├── activity_add.xml
│ │ │ │ ├── activity_ban_ben.xml
│ │ │ │ ├── activity_login.xml
│ │ │ │ ├── activity_menu.xml
│ │ │ │ ├── activity_regist.xml
│ │ │ │ ├── activity_update_actity.xml
│ │ │ │ ├── activity_update_item.xml
│ │ │ │ ├── activity_xiang_qing.xml
│ │ │ │ ├── fragment_dongtai.xml
│ │ │ │ ├── fragment_index.xml
│ │ │ │ ├── fragment_wode.xml
│ │ │ │ ├── item_booklist.xml
│ │ │ │ └── item_booklist2.xml
│ │ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ ├── book.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ └── values
│ │ │ │ ├── colors.xml
│ │ │ │ ├── strings.xml
│ │ │ │ └── styles.xml
│ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── glc
│ │ │ └── itbook
│ │ │ └── ExampleUnitTest.java
│ └── volley.jar
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
├── README.md
└── login-register
├── .gitignore
├── .mvn
└── wrapper
│ ├── MavenWrapperDownloader.java
│ ├── maven-wrapper.jar
│ └── maven-wrapper.properties
├── item.sql
├── mvnw
├── mvnw.cmd
├── pom.xml
├── src
├── main
│ ├── java
│ │ └── com
│ │ │ └── glc
│ │ │ └── loginregister
│ │ │ ├── LoginRegisterApplication.java
│ │ │ ├── controller
│ │ │ ├── ItemController.java
│ │ │ └── UserController.java
│ │ │ ├── entity
│ │ │ ├── Item.java
│ │ │ ├── Message.java
│ │ │ ├── PageBean.java
│ │ │ ├── Result.java
│ │ │ └── User.java
│ │ │ ├── mapper
│ │ │ ├── ItemMapper.java
│ │ │ └── UserMapper.java
│ │ │ └── service
│ │ │ ├── ItemService.java
│ │ │ └── UserService.java
│ └── resources
│ │ ├── application.properties
│ │ └── application.yml
└── test
│ └── java
│ └── com
│ └── glc
│ └── loginregister
│ └── LoginRegisterApplicationTests.java
└── usermessage.sql
/ItBook/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 |
--------------------------------------------------------------------------------
/ItBook/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/ItBook/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
15 |
--------------------------------------------------------------------------------
/ItBook/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ItBook/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/ItBook/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/ItBook/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 29
5 | buildToolsVersion "29.0.2"
6 | defaultConfig {
7 | applicationId "com.glc.itbook"
8 | minSdkVersion 15
9 | targetSdkVersion 29
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | implementation fileTree(include: ['*.jar'], dir: 'libs')
24 | implementation 'androidx.appcompat:appcompat:1.1.0'
25 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
26 | implementation 'androidx.legacy:legacy-support-v4:1.0.0'
27 | testImplementation 'junit:junit:4.12'
28 | androidTestImplementation 'androidx.test:runner:1.2.0'
29 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
30 | implementation files('libs/volley.jar')
31 | implementation 'com.google.code.gson:gson:2.8.0'
32 |
33 | implementation 'com.github.bumptech.glide:glide:3.7.0'
34 |
35 | implementation 'jp.wasabeef:glide-transformations:2.0.1'
36 |
37 | implementation 'de.hdodenhof:circleimageview:2.1.0'
38 |
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/ItBook/app/libs/volley.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/libs/volley.jar
--------------------------------------------------------------------------------
/ItBook/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/ItBook/app/release/ITBook.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/release/ITBook.apk
--------------------------------------------------------------------------------
/ItBook/app/release/output.json:
--------------------------------------------------------------------------------
1 | [{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
--------------------------------------------------------------------------------
/ItBook/app/src/androidTest/java/com/glc/itbook/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.glc.itbook;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.InstrumentationRegistry;
6 | import androidx.test.runner.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getTargetContext();
24 |
25 | assertEquals("com.glc.itbook", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/java/com/glc/itbook/AddActivity.java:
--------------------------------------------------------------------------------
1 | package com.glc.itbook;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import android.util.Log;
8 | import android.view.View;
9 | import android.widget.Button;
10 | import android.widget.EditText;
11 | import android.widget.ImageView;
12 | import android.widget.Toast;
13 |
14 | import com.android.volley.Request;
15 | import com.android.volley.RequestQueue;
16 | import com.android.volley.Response;
17 | import com.android.volley.VolleyError;
18 | import com.android.volley.toolbox.JsonObjectRequest;
19 | import com.android.volley.toolbox.Volley;
20 |
21 | import org.json.JSONException;
22 | import org.json.JSONObject;
23 |
24 | import java.io.UnsupportedEncodingException;
25 | import java.net.URLEncoder;
26 |
27 | public class AddActivity extends AppCompatActivity {
28 | private EditText addBookName;
29 | private EditText addBookimg;
30 | private EditText addBookAuthor;
31 | private EditText addBookinfo;
32 | private EditText addBookLianjie;
33 | private Button addBtn;
34 | private ImageView img;
35 | @Override
36 | protected void onCreate(Bundle savedInstanceState) {
37 | super.onCreate(savedInstanceState);
38 | setContentView(R.layout.activity_add);
39 | addBookName=findViewById(R.id.edt_addBookName);
40 | addBookimg=findViewById(R.id.edt_addBookimg);
41 | addBookAuthor=findViewById(R.id.edt_addBookAuthor);
42 | addBookinfo=findViewById(R.id.edt_addBookInfo);
43 | addBookLianjie=findViewById(R.id.edt_addBookLianjie);
44 | addBtn=findViewById(R.id.btn_Add);
45 | img=findViewById(R.id.img_fanhuiAdd);
46 |
47 | img.setOnClickListener(new View.OnClickListener() {
48 | @Override
49 | public void onClick(View view) {
50 | finish();
51 | }
52 | });
53 |
54 | addBtn.setOnClickListener(new View.OnClickListener() {
55 | @Override
56 | public void onClick(View view) {
57 | String name = addBookName.getText().toString();
58 | String img = addBookimg.getText().toString();
59 | String author= addBookAuthor.getText().toString();
60 | String info = addBookinfo.getText().toString();
61 | String lianjie = addBookLianjie.getText().toString();
62 | if(name.equals("")||img.equals("")||author.equals("")||info.equals("")||lianjie.equals("")){
63 | Toast.makeText(AddActivity.this, "请填写完整", Toast.LENGTH_SHORT).show();
64 | }else {
65 | try {
66 | String name1 = URLEncoder.encode(name, "utf-8");
67 | String img1 = URLEncoder.encode(img, "utf-8");
68 | String author1= URLEncoder.encode(author, "utf-8");
69 | String info1 = URLEncoder.encode(info, "utf-8");
70 | String lianjie1 = URLEncoder.encode(lianjie, "utf-8");
71 | Add(name1,img1,author1,info1,lianjie1);
72 | } catch (UnsupportedEncodingException e) {
73 | e.printStackTrace();
74 | }
75 | }
76 |
77 | }
78 | });
79 |
80 |
81 |
82 |
83 | }
84 | private void Add(String name,String img,String author,String info,String lianjie){
85 | JSONObject jsonObject=new JSONObject();
86 | String url="http://192.168.1.103:8085/item/insertItem?book_name="+name+"&book_img="+img+"&book_author="+author+"&book_info="+info+"&book_download="+lianjie+"";
87 | RequestQueue requestQueue= Volley.newRequestQueue(AddActivity.this);
88 | JsonObjectRequest jsonObjectRequest=new JsonObjectRequest(Request.Method.GET, url, jsonObject, new Response.Listener() {
89 | @Override
90 | public void onResponse(JSONObject jsonObject) {
91 | try {
92 | String info1 = jsonObject.getString("info");
93 | if(info1.equals("添加成功")){
94 | Toast.makeText(AddActivity.this, "添加成功", Toast.LENGTH_SHORT).show();
95 | }else {
96 | Toast.makeText(AddActivity.this, "添加失败", Toast.LENGTH_SHORT).show();
97 | }
98 | } catch (JSONException e) {
99 | e.printStackTrace();
100 | }
101 | }
102 | }, new Response.ErrorListener() {
103 | @Override
104 | public void onErrorResponse(VolleyError volleyError) {
105 | Log.d("错误", volleyError.toString());
106 | Toast.makeText(AddActivity.this, "网络失败", Toast.LENGTH_SHORT).show();
107 | }
108 | });
109 | requestQueue.add(jsonObjectRequest);
110 |
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/java/com/glc/itbook/BanBenActivity.java:
--------------------------------------------------------------------------------
1 | package com.glc.itbook;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.net.Uri;
7 | import android.os.Bundle;
8 | import android.view.View;
9 | import android.widget.ImageView;
10 | import android.widget.TextView;
11 |
12 | public class BanBenActivity extends AppCompatActivity {
13 | private ImageView fanhui;
14 | private TextView lianZhang;
15 | private TextView lianGao;
16 | @Override
17 | protected void onCreate(Bundle savedInstanceState) {
18 | super.onCreate(savedInstanceState);
19 | setContentView(R.layout.activity_ban_ben);
20 | lianZhang=findViewById(R.id.lianjie_zhang);
21 | fanhui=findViewById(R.id.img_fanhuiAdd);
22 | lianGao=findViewById(R.id.lianxiwo_gao);
23 | fanhui.setOnClickListener(new View.OnClickListener() {
24 | @Override
25 | public void onClick(View view) {
26 | finish();
27 | }
28 | });
29 | lianZhang.setOnClickListener(new View.OnClickListener() {
30 | @Override
31 | public void onClick(View view) {
32 | Intent intent = new Intent();
33 | //intent 动作
34 | intent.setAction("android.intent.action.VIEW");
35 | //打开的网址
36 | intent.setData(Uri.parse("https://me.csdn.net/weixin_43912367"));
37 | startActivity(intent);
38 | }
39 | });
40 | lianGao.setOnClickListener(new View.OnClickListener() {
41 | @Override
42 | public void onClick(View view) {
43 | Intent intent = new Intent();
44 | //intent 动作
45 | intent.setAction("android.intent.action.VIEW");
46 | //打开的网址
47 | intent.setData(Uri.parse("http://www.gaolicong.xyz/"));
48 | startActivity(intent);
49 | }
50 | });
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/java/com/glc/itbook/LoginActivity.java:
--------------------------------------------------------------------------------
1 | package com.glc.itbook;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Context;
6 | import android.content.Intent;
7 | import android.content.SharedPreferences;
8 | import android.os.Bundle;
9 | import android.util.Log;
10 | import android.view.View;
11 | import android.view.WindowManager;
12 | import android.widget.Button;
13 | import android.widget.EditText;
14 | import android.widget.Toast;
15 |
16 | import com.android.volley.Request;
17 | import com.android.volley.RequestQueue;
18 | import com.android.volley.Response;
19 | import com.android.volley.VolleyError;
20 | import com.android.volley.toolbox.JsonObjectRequest;
21 | import com.android.volley.toolbox.Volley;
22 |
23 | import org.json.JSONException;
24 | import org.json.JSONObject;
25 |
26 | public class LoginActivity extends AppCompatActivity {
27 | private EditText login_username;
28 | private EditText login_password;
29 | private Button btn_login;
30 | private Button btnRegister;
31 | private SharedPreferences sharedPreferences;
32 |
33 | @Override
34 | protected void onCreate(final Bundle savedInstanceState) {
35 | super.onCreate(savedInstanceState);
36 | setContentView(R.layout.activity_login);
37 | //透明状态栏
38 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
39 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
40 |
41 | btnRegister = findViewById(R.id.btn_registerActivity);
42 | login_username = findViewById(R.id.edt_login_username);
43 | login_password = findViewById(R.id.edt_login_password);
44 | btn_login = findViewById(R.id.btn_login);
45 |
46 |
47 | sharedPreferences =getSharedPreferences("data",Context.MODE_PRIVATE);
48 | String userstr= sharedPreferences.getString("username","");
49 | String phonestr= sharedPreferences.getString("phone","");
50 | if(userstr.equals("")){
51 |
52 | }else {
53 | Intent intent = new Intent(LoginActivity.this, MenuActivity.class);
54 | intent.putExtra("username", userstr);
55 | intent.putExtra("phone", phonestr);
56 | startActivity(intent);
57 | }
58 | Intent intent = getIntent();
59 | final String username1 = intent.getStringExtra("username1");
60 | login_username.setText(username1);
61 |
62 | btn_login.setOnClickListener(new View.OnClickListener() {
63 | @Override
64 | public void onClick(View view) {
65 | String usernameStr = login_username.getText().toString().trim();
66 | String passwordStr = login_password.getText().toString().trim();
67 | if (usernameStr.equals("") || passwordStr.equals("")) {
68 | Toast.makeText(LoginActivity.this, "用户名密码不能为空", Toast.LENGTH_SHORT).show();
69 | } else {
70 | JSONObject jsonObject = new JSONObject();
71 | try {
72 | jsonObject.put("username", usernameStr);
73 | jsonObject.put("password", passwordStr);
74 | } catch (JSONException e) {
75 | e.printStackTrace();
76 | }
77 | String url = "http://192.168.1.103:8085/user/login";
78 | RequestQueue requestQueue = Volley.newRequestQueue(LoginActivity.this);
79 | JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST, url, jsonObject, new Response.Listener() {
80 | @Override
81 | public void onResponse(JSONObject jsonObject) {
82 | try {
83 | Log.d("信心", jsonObject.toString());
84 | String msg = jsonObject.getString("msg");
85 | Log.d("msg", msg);
86 | if (msg.equals("登录成功")) {
87 |
88 | JSONObject detail = jsonObject.getJSONObject("detail");
89 | String username = detail.getString("username");
90 | String phone = detail.getString("phone");
91 |
92 | sharedPreferences=getSharedPreferences("data",Context.MODE_PRIVATE);
93 | SharedPreferences.Editor editor = sharedPreferences.edit();
94 | editor.putString("username",username);
95 | editor.putString("phone",phone);
96 | editor.commit();
97 |
98 |
99 |
100 | Intent intent = new Intent(LoginActivity.this, MenuActivity.class);
101 | intent.putExtra("username", username);
102 | intent.putExtra("phone", phone);
103 | startActivity(intent);
104 | } else if (msg.equals("用户名或密码错误")) {
105 | Toast.makeText(LoginActivity.this, "用户名密码有误", Toast.LENGTH_SHORT).show();
106 | }
107 |
108 | } catch (JSONException e) {
109 | e.printStackTrace();
110 | }
111 |
112 | }
113 | }, new Response.ErrorListener() {
114 | @Override
115 | public void onErrorResponse(VolleyError volleyError) {
116 | Toast.makeText(LoginActivity.this, "网络出错", Toast.LENGTH_SHORT).show();
117 | }
118 | });
119 | requestQueue.add(jsonObjectRequest);
120 | }
121 |
122 | }
123 | });
124 |
125 | btnRegister.setOnClickListener(new View.OnClickListener() {
126 | @Override
127 | public void onClick(View view) {
128 | startActivity(new Intent(LoginActivity.this, RegistActivity.class));
129 | }
130 | });
131 |
132 |
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/java/com/glc/itbook/MenuActivity.java:
--------------------------------------------------------------------------------
1 | package com.glc.itbook;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.appcompat.app.AppCompatActivity;
5 | import androidx.fragment.app.Fragment;
6 | import androidx.fragment.app.FragmentManager;
7 | import androidx.fragment.app.FragmentPagerAdapter;
8 | import androidx.viewpager.widget.ViewPager;
9 |
10 | import android.content.Context;
11 | import android.content.Intent;
12 | import android.content.SharedPreferences;
13 | import android.graphics.Color;
14 | import android.os.Bundle;
15 | import android.view.View;
16 | import android.widget.ImageView;
17 | import android.widget.LinearLayout;
18 | import android.widget.TextView;
19 |
20 | import com.glc.itbook.fragment.Fragment_dongtai;
21 | import com.glc.itbook.fragment.Fragment_index;
22 | import com.glc.itbook.fragment.Fragment_wode;
23 |
24 | import java.util.ArrayList;
25 | import java.util.List;
26 |
27 | public class MenuActivity extends AppCompatActivity {
28 | private ViewPager vp;
29 | private LinearLayout btn1;
30 | private TextView tv1;
31 | private ImageView imgIndex;
32 | private LinearLayout btn2;
33 | private TextView tv2;
34 | private ImageView imgDongtai;
35 | private LinearLayout btn3;
36 | private TextView tv3;
37 | private ImageView imgMe;
38 |
39 | List fragments = new ArrayList<>();
40 |
41 | @Override
42 | protected void onCreate(Bundle savedInstanceState) {
43 | super.onCreate(savedInstanceState);
44 | setContentView(R.layout.activity_menu);
45 | vp = findViewById(R.id.vp_vp1);
46 | btn1 = findViewById(R.id.ly_btn1);
47 | tv1 = findViewById(R.id.tv_index);
48 | imgIndex = findViewById(R.id.img_index);
49 | btn2 = findViewById(R.id.ly_btn2);
50 | tv2 = findViewById(R.id.tv_dongtai);
51 | imgDongtai = findViewById(R.id.img_dongtai);
52 | btn3 = findViewById(R.id.ly_btn3);
53 | tv3 = findViewById(R.id.tv_wode);
54 | imgMe = findViewById(R.id.img_me);
55 | fragments.add(new Fragment_index());
56 | fragments.add(new Fragment_dongtai());
57 | fragments.add(new Fragment_wode());
58 |
59 |
60 | SharedPreferences sharedPreferences=getSharedPreferences("data", Context.MODE_PRIVATE);
61 | String username1 = sharedPreferences.getString("username", null);
62 | Intent intent = getIntent();
63 | String username = intent.getStringExtra("username");
64 | String phone = intent.getStringExtra("phone");
65 |
66 | intent.getStringExtra("msg");
67 | Bundle bundle = new Bundle();
68 | bundle.putString("username", username);
69 | bundle.putString("phone", phone);
70 | fragments.get(2).setArguments(bundle);
71 |
72 | fragments.get(1).setArguments(bundle);
73 | vp.setOffscreenPageLimit(3);
74 | vp.setAdapter(new MyPageAdapter(getSupportFragmentManager()));
75 |
76 | btn1.setOnClickListener(new View.OnClickListener() {
77 | @Override
78 | public void onClick(View view) {
79 | vp.setCurrentItem(0);
80 | tv1.setTextColor(Color.parseColor("#0099ff"));
81 | tv2.setTextColor(Color.parseColor("#F7F7F7"));
82 | tv3.setTextColor(Color.parseColor("#F7F7F7"));
83 | imgIndex.setImageResource(R.drawable.index);
84 | imgDongtai.setImageResource(R.drawable.dongtai);
85 | imgMe.setImageResource(R.drawable.me1);
86 |
87 | }
88 | });
89 | btn2.setOnClickListener(new View.OnClickListener() {
90 | @Override
91 | public void onClick(View view) {
92 | vp.setCurrentItem(1);
93 | tv2.setTextColor(Color.parseColor("#0099ff"));
94 | tv1.setTextColor(Color.parseColor("#F7F7F7"));
95 | tv3.setTextColor(Color.parseColor("#F7F7F7"));
96 | imgIndex.setImageResource(R.drawable.index1);
97 | imgDongtai.setImageResource(R.drawable.dongtai1);
98 | imgMe.setImageResource(R.drawable.me1);
99 |
100 | }
101 | });
102 | btn3.setOnClickListener(new View.OnClickListener() {
103 | @Override
104 | public void onClick(View view) {
105 | vp.setCurrentItem(2);
106 | tv3.setTextColor(Color.parseColor("#0099ff"));
107 | tv1.setTextColor(Color.parseColor("#F7F7F7"));
108 | tv2.setTextColor(Color.parseColor("#F7F7F7"));
109 | imgIndex.setImageResource(R.drawable.index1);
110 | imgDongtai.setImageResource(R.drawable.dongtai);
111 | imgMe.setImageResource(R.drawable.me);
112 | }
113 | });
114 |
115 | vp.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
116 | @Override
117 | public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
118 |
119 | }
120 |
121 | @Override
122 | public void onPageSelected(int position) {
123 | switch (position) {
124 | case 0:
125 | tv1.setTextColor(Color.parseColor("#0099ff"));
126 | tv2.setTextColor(Color.parseColor("#F7F7F7"));
127 | tv3.setTextColor(Color.parseColor("#F7F7F7"));
128 | imgIndex.setImageResource(R.drawable.index);
129 | imgDongtai.setImageResource(R.drawable.dongtai);
130 | imgMe.setImageResource(R.drawable.me1);
131 | break;
132 | case 1:
133 | tv2.setTextColor(Color.parseColor("#0099ff"));
134 | tv1.setTextColor(Color.parseColor("#F7F7F7"));
135 | tv3.setTextColor(Color.parseColor("#F7F7F7"));
136 | imgIndex.setImageResource(R.drawable.index1);
137 | imgDongtai.setImageResource(R.drawable.dongtai1);
138 | imgMe.setImageResource(R.drawable.me1);
139 |
140 | break;
141 | case 2:
142 | tv3.setTextColor(Color.parseColor("#0099ff"));
143 | tv1.setTextColor(Color.parseColor("#F7F7F7"));
144 | tv2.setTextColor(Color.parseColor("#F7F7F7"));
145 | imgIndex.setImageResource(R.drawable.index1);
146 | imgDongtai.setImageResource(R.drawable.dongtai);
147 | imgMe.setImageResource(R.drawable.me);
148 | break;
149 |
150 |
151 | }
152 | }
153 |
154 | @Override
155 | public void onPageScrollStateChanged(int state) {
156 |
157 | }
158 | });
159 | }
160 |
161 | class MyPageAdapter extends FragmentPagerAdapter {
162 |
163 | public MyPageAdapter(@NonNull FragmentManager fm) {
164 | super(fm);
165 | }
166 |
167 | @NonNull
168 | @Override
169 | public Fragment getItem(int position) {
170 | return fragments.get(position);
171 | }
172 |
173 | @Override
174 | public int getCount() {
175 | return fragments.size();
176 | }
177 | }
178 | }
179 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/java/com/glc/itbook/RegistActivity.java:
--------------------------------------------------------------------------------
1 | package com.glc.itbook;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import android.util.Log;
8 | import android.view.View;
9 | import android.view.WindowManager;
10 | import android.widget.Button;
11 | import android.widget.EditText;
12 | import android.widget.Toast;
13 |
14 | import com.android.volley.Request;
15 | import com.android.volley.RequestQueue;
16 | import com.android.volley.Response;
17 | import com.android.volley.VolleyError;
18 | import com.android.volley.toolbox.JsonObjectRequest;
19 | import com.android.volley.toolbox.Volley;
20 |
21 | import org.json.JSONException;
22 | import org.json.JSONObject;
23 |
24 | public class RegistActivity extends AppCompatActivity {
25 | private EditText edt_username;
26 | private EditText edt_password;
27 | private EditText edt_address;
28 | private EditText edt_phone;
29 | private Button goLogin;
30 | private Button submit;
31 | @Override
32 | protected void onCreate(Bundle savedInstanceState) {
33 | super.onCreate(savedInstanceState);
34 | setContentView(R.layout.activity_regist);
35 | edt_username=findViewById(R.id.edt_register_username);
36 | edt_password=findViewById(R.id.edt_register_password);
37 | edt_address=findViewById(R.id.edt_register_address);
38 | edt_phone=findViewById(R.id.edt_register_phone);
39 | goLogin=findViewById(R.id.btn_goLogin);
40 | submit=findViewById(R.id.btn_submit);
41 | //透明状态栏
42 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
43 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
44 |
45 | submit.setOnClickListener(new View.OnClickListener() {
46 | @Override
47 | public void onClick(View view) {
48 | String username = edt_username.getText().toString().trim();
49 | String password = edt_password.getText().toString().trim();
50 | String address = edt_address.getText().toString().trim();
51 | String phone = edt_phone.getText().toString().trim();
52 | if(username.equals("")||password.equals("")||address.equals("")||phone.equals("")){
53 | Toast.makeText(RegistActivity.this, "请填写完整", Toast.LENGTH_SHORT).show();
54 | }else {
55 | JSONObject jsonObject=new JSONObject();
56 | try {
57 | jsonObject.put("username",username);
58 | jsonObject.put("password",password);
59 | jsonObject.put("address",address);
60 | jsonObject.put("phone",phone);
61 | } catch (JSONException e) {
62 | e.printStackTrace();
63 | }
64 | String url="http://192.168.1.103:8085/user/register";
65 | RequestQueue requestQueue=Volley.newRequestQueue(RegistActivity.this);
66 | JsonObjectRequest jsonObjectRequest=new JsonObjectRequest(Request.Method.POST, url,jsonObject, new Response.Listener() {
67 | @Override
68 | public void onResponse(JSONObject jsonObject) {
69 | try {
70 | Log.d("注册信息", jsonObject.toString());
71 | String msg = jsonObject.getString("msg");
72 | Toast.makeText(RegistActivity.this, msg, Toast.LENGTH_SHORT).show();
73 | if(msg.equals("注册成功")){
74 | JSONObject detail = jsonObject.getJSONObject("detail");
75 | final String username_login = detail.getString("username");
76 | goLogin.setOnClickListener(new View.OnClickListener() {
77 | @Override
78 | public void onClick(View view) {
79 | Intent intent=new Intent(RegistActivity.this, LoginActivity.class);
80 | intent.putExtra("username1",username_login);
81 | startActivity(intent);
82 | }
83 | });
84 | }
85 | } catch (JSONException e) {
86 | e.printStackTrace();
87 | }
88 | }
89 | }, new Response.ErrorListener() {
90 | @Override
91 | public void onErrorResponse(VolleyError volleyError) {
92 | Toast.makeText(RegistActivity.this, "网络出错", Toast.LENGTH_SHORT).show();
93 | }
94 | });
95 | requestQueue.add(jsonObjectRequest);
96 | }
97 | }
98 | });
99 |
100 | goLogin.setOnClickListener(new View.OnClickListener() {
101 | @Override
102 | public void onClick(View view) {
103 | startActivity(new Intent(RegistActivity.this, LoginActivity.class));
104 | }
105 | });
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/java/com/glc/itbook/UpdateItemActivity.java:
--------------------------------------------------------------------------------
1 | package com.glc.itbook;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.media.Image;
7 | import android.os.Bundle;
8 | import android.util.Log;
9 | import android.view.View;
10 | import android.widget.Button;
11 | import android.widget.EditText;
12 | import android.widget.ImageView;
13 | import android.widget.TextView;
14 | import android.widget.Toast;
15 |
16 | import com.android.volley.Request;
17 | import com.android.volley.RequestQueue;
18 | import com.android.volley.Response;
19 | import com.android.volley.VolleyError;
20 | import com.android.volley.toolbox.JsonObjectRequest;
21 | import com.android.volley.toolbox.Volley;
22 | import com.google.gson.JsonObject;
23 |
24 | import org.json.JSONException;
25 | import org.json.JSONObject;
26 |
27 | import java.io.UnsupportedEncodingException;
28 | import java.net.URLEncoder;
29 |
30 | public class UpdateItemActivity extends AppCompatActivity {
31 | private EditText addBookName;
32 | private EditText addBookimg;
33 | private EditText addBookAuthor;
34 | private EditText addBookinfo;
35 | private EditText addBookLianjie;
36 | private Button addBtn;
37 | private ImageView fanhui;
38 | private int id;
39 | @Override
40 | protected void onCreate(Bundle savedInstanceState) {
41 | super.onCreate(savedInstanceState);
42 | setContentView(R.layout.activity_update_item);
43 | addBookName=findViewById(R.id.edt_addBookName);
44 | addBookimg=findViewById(R.id.edt_addBookimg);
45 | addBookAuthor=findViewById(R.id.edt_addBookAuthor);
46 | addBookinfo=findViewById(R.id.edt_addBookInfo);
47 | addBookLianjie=findViewById(R.id.edt_addBookLianjie);
48 | fanhui=findViewById(R.id.img_fanhuiAdd);
49 | addBtn=findViewById(R.id.btn_Add);
50 |
51 | fanhui.setOnClickListener(new View.OnClickListener() {
52 | @Override
53 | public void onClick(View view) {
54 | finish();
55 | }
56 | });
57 | /* bundle.putInt("id",id);
58 | bundle.putString("shutu",shutu);
59 | bundle.putString("author",author);
60 | bundle.putString("info",info);
61 | bundle.putString("lianjie",lianjie);*/
62 | Intent intent=getIntent();
63 | String name = intent.getStringExtra("name");
64 | id = Integer.parseInt(intent.getStringExtra("id"));
65 | String shutu=intent.getStringExtra("shutu");
66 | String author = intent.getStringExtra("author");
67 | String info = intent.getStringExtra("info");
68 | String lianjie = intent.getStringExtra("lianjie");
69 | addBookName.setText(name);
70 | addBookimg.setText(shutu);
71 | addBookAuthor.setText(author);
72 | addBookinfo.setText(info);
73 | addBookLianjie.setText(lianjie);
74 | addBtn.setOnClickListener(new View.OnClickListener() {
75 | @Override
76 | public void onClick(View view) {
77 | String name1 = addBookName.getText().toString().trim();
78 | String img1 = addBookimg.getText().toString().trim();
79 | String author1 = addBookAuthor.getText().toString().trim();
80 | String info1 = addBookinfo.getText().toString().trim();
81 | String lianjie1 = addBookLianjie.getText().toString().trim();
82 | if(name1.equals("")||img1.equals("")||author1.equals("")||info1.equals("")||lianjie1.equals("")){
83 | Toast.makeText(UpdateItemActivity.this, "请填写完整", Toast.LENGTH_SHORT).show();
84 | }else {
85 | try {
86 | String name11 = URLEncoder.encode(name1, "utf-8");
87 | String img11 = URLEncoder.encode(img1, "utf-8");
88 | String author11 = URLEncoder.encode(author1, "utf-8");
89 | String info11 = URLEncoder.encode(info1, "utf-8");
90 | String lianjie11 = URLEncoder.encode(lianjie1, "utf-8");
91 | updateInfo(id,name11,img11,author11,info11,lianjie11);
92 | } catch (UnsupportedEncodingException e) {
93 | e.printStackTrace();
94 | }
95 | }
96 | }
97 | });
98 |
99 |
100 | }
101 |
102 | private void updateInfo(int id, String book_name, String shutu, String author, String info, String lianjie) {
103 | JSONObject jsonObject=new JSONObject();
104 | String url = "http://192.168.1.103:8085/item/updateItem?id=" + id + "&book_name=" + book_name + "&book_img=" + shutu + "&book_author=" + author + "&book_info=" + info + "&book_download=" + lianjie + "";
105 |
106 | RequestQueue requestQueue= Volley.newRequestQueue(UpdateItemActivity.this);
107 | JsonObjectRequest jsonObjectRequest=new JsonObjectRequest(Request.Method.GET, url, jsonObject, new Response.Listener() {
108 | @Override
109 | public void onResponse(JSONObject jsonObject) {
110 | try {
111 | String info1 = jsonObject.getString("info");
112 | if(info1.equals("修改成功")){
113 | Toast.makeText(UpdateItemActivity.this, "修改成功", Toast.LENGTH_SHORT).show();
114 | }else {
115 | Toast.makeText(UpdateItemActivity.this, "修改失败", Toast.LENGTH_SHORT).show();
116 | }
117 | } catch (JSONException e) {
118 | e.printStackTrace();
119 | }
120 | }
121 | }, new Response.ErrorListener() {
122 | @Override
123 | public void onErrorResponse(VolleyError volleyError) {
124 | Log.d("错误", volleyError.toString());
125 | Toast.makeText(UpdateItemActivity.this, "网络失败", Toast.LENGTH_SHORT).show();
126 | }
127 | });
128 | requestQueue.add(jsonObjectRequest);
129 |
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/java/com/glc/itbook/XiangQingActivity.java:
--------------------------------------------------------------------------------
1 | package com.glc.itbook;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.net.Uri;
7 | import android.os.Bundle;
8 | import android.view.View;
9 | import android.widget.ImageView;
10 | import android.widget.TextView;
11 |
12 | import com.bumptech.glide.Glide;
13 |
14 | public class XiangQingActivity extends AppCompatActivity {
15 | private TextView shuming;
16 | private TextView zuozhe;
17 | private TextView jianjie;
18 | private TextView liulanqi;
19 | private ImageView imgXiangqing;
20 | private String down;
21 | @Override
22 | protected void onCreate(Bundle savedInstanceState) {
23 | super.onCreate(savedInstanceState);
24 | setContentView(R.layout.activity_xiang_qing);
25 | shuming=findViewById(R.id.tv_shuming);
26 | zuozhe=findViewById(R.id.tv_zuozhe);
27 | jianjie=findViewById(R.id.tv_jianjie);
28 | liulanqi=findViewById(R.id.tv_liulanqi);
29 | imgXiangqing=findViewById(R.id.img_imgXiangQing);
30 | Intent intent=getIntent();
31 | String name = intent.getStringExtra("name");
32 | String author = intent.getStringExtra("author");
33 | String jianjieStr= intent.getStringExtra("jianjie");
34 | down = intent.getStringExtra("down");
35 | String imgStr = intent.getStringExtra("img");
36 | shuming.setText("书名:"+name);
37 | zuozhe.setText("作者:"+author);
38 | jianjie.setText("简介:"+jianjieStr);
39 | liulanqi.setText("下载链接:"+down);
40 | Glide.with(XiangQingActivity.this).load(imgStr).into(imgXiangqing);
41 | liulanqi.setOnClickListener(new View.OnClickListener() {
42 | @Override
43 | public void onClick(View view) {
44 | Intent intent1=new Intent(Intent.ACTION_VIEW);
45 | intent1.setData(Uri.parse(down));
46 | startActivity(intent1);
47 | }
48 | });
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/java/com/glc/itbook/bean/Book.java:
--------------------------------------------------------------------------------
1 | package com.glc.itbook.bean;
2 |
3 | import java.util.List;
4 |
5 | public class Book {
6 |
7 | /**
8 | * currentPage : 1
9 | * pageSize : 10
10 | * totalNum : 8516
11 | * isMore : 1
12 | * totalPage : 852
13 | * items : [{"id":1,"book_name":"PowerPoint 2019 For Dummies","book_img":"http://www.allitebooks.org/wp-content/uploads/2020/03/PowerPoint-2019-For-Dummies.jpg","book_author":"Doug Lowe","book_info":"Get up and running fast with the PowerPoint 2019 PowerPoint continues to be the go-to tool for business presentations. The software helps anyone who needs to communicate clearly by creating powerful and effective slideshow presentations featuring data in the form of charts, clip art, sound, and video. You\u2026","book_download":"http://file.allitebooks.com/20200323/PowerPoint 2019 For Dummies.pdf","book_FileSize":" 30.9 MB"},{"id":2,"book_name":"Practical Highcharts with Angular","book_img":"http://www.allitebooks.org/wp-content/uploads/2020/03/Practical-Highcharts-with-Angular.jpg","book_author":"Sourabh Mishra","book_info":"Learn to create stunning animated and interactive charts using Highcharts and Angular. Use and build on your existing knowledge of HTML, CSS, and JavaScript to develop impressive dashboards that will work in all modern browsers. You will learn how to use Highcharts, call backend services for data, and\u2026","book_download":"http://file.allitebooks.com/20200321/Practical Highcharts with Angular.pdf","book_FileSize":" 5.9 MB"},{"id":3,"book_name":"iPad For Seniors For Dummies, 12th Edition","book_img":"http://www.allitebooks.org/wp-content/uploads/2020/03/iPad-For-Seniors-For-Dummies-12th-Edition.jpg","book_author":"Dwight Spivey","book_info":"Get to know the exciting features of your new iPad! The iPad can do almost anything: entertain you, help you stay in touch with the world, boost your productivity, and more. If you have lots of life experience but are a little less tech savvy, iPad For Seniors For\u2026","book_download":"http://file.allitebooks.com/20200320/iPad For Seniors For Dummies, 12th Edition.epub","book_FileSize":" 35.7 MB"},{"id":4,"book_name":"Impractical Python Projects","book_img":"http://www.allitebooks.org/wp-content/uploads/2020/03/Impractical-Python-Projects.jpg","book_author":"Lee Vaughan","book_info":"Impractical Python Projects is a collection of fun and educational projects designed to entertain programmers while enhancing their Python skills. It picks up where the complete beginner books leave off, expanding on existing concepts and introducing new tools that you\u2019ll use every day. And to keep things interesting, each\u2026","book_download":"http://file.allitebooks.com/20200319/Impractical Python Projects.pdf","book_FileSize":" 10.2 MB"},{"id":5,"book_name":"Cognitive Virtual Assistants Using Google Dialogflow","book_img":"http://www.allitebooks.org/wp-content/uploads/2020/03/Cognitive-Virtual-Assistants-Using-Google-Dialogflow.jpg","book_author":"Amit Agrawal","book_info":"Follow a step-by-step, hands-on approach to building production-ready enterprise cognitive virtual assistants using Google Dialogflow. This book provides an overview of the various cognitive technology choices available and takes a deep dive into cognitive virtual agents for handling complex real-life use cases in various industries such as travel\u2026","book_download":"http://file.allitebooks.com/20200318/Cognitive Virtual Assistants Using Google Dialogflow.pdf","book_FileSize":" 6.4 MB"},{"id":6,"book_name":"MySQL 8 Query Performance Tuning","book_img":"http://www.allitebooks.org/wp-content/uploads/2020/03/MySQL-8-Query-Performance-Tuning.jpg","book_author":"Jesper Wisborg Krogh","book_info":"Identify, analyze, and improve poorly performing queries that damage user experience and lead to lost revenue for your business. This book will help you make query tuning an integral part of your daily routine through a multi-step process that includes monitoring of execution times, identifying candidate queries for\u2026","book_download":"http://file.allitebooks.com/20200318/MySQL 8 Query Performance Tuning.pdf","book_FileSize":" 17.7 MB"},{"id":7,"book_name":"PostgreSQL Configuration","book_img":"http://www.allitebooks.org/wp-content/uploads/2020/03/PostgreSQL-Configuration.jpg","book_author":"Baji Shaik","book_info":"Obtain all the skills you need to configure and manage a PostgreSQL database. In this book you will begin by installing and configuring PostgreSQL on a server by focusing on system-level parameter settings before installation. You will also look at key post-installation steps to avoid issues in the\u2026","book_download":"http://file.allitebooks.com/20200317/PostgreSQL Configuration.pdf","book_FileSize":" 2.3 MB"},{"id":8,"book_name":"Teach Yourself VISUALLY iPhone 11, 11Pro, and 11 Pro Max, 5th Edition","book_img":"http://www.allitebooks.org/wp-content/uploads/2020/03/Teach-Yourself-VISUALLY-iPhone-11-11Pro-and-11-Pro-Max-5th-Edition.jpg","book_author":"Guy Hart-Davis","book_info":"Know your new iPhone 11, 11 Pro, and 11 Pro Max from the inside-out with 900 color screen shots! Teach Yourself VISUALLY iPhone is your ultimate guide to getting the most out of your iPhone! Apple\u2019s graphics-driven iOS is perfect for visual learners, so this book uses a visual\u2026","book_download":"http://file.allitebooks.com/20200316/Teach Yourself VISUALLY iPhone 11, 11Pro, and 11 Pro Max, 5th Edition.epub","book_FileSize":" 148 MB"},{"id":9,"book_name":"Head First Go","book_img":"http://www.allitebooks.org/wp-content/uploads/2020/03/Head-First-Go1-400x461.png","book_author":"Jay McGavren","book_info":"What will you learn from this book? Go makes it easy to build software that\u2019s simple, reliable, and efficient. Andthis book makes it easy for programmers like you to get started. Googledesigned Go for high-performance networking and multiprocessing, but\u2014like Python and JavaScript\u2014the language is easy to read and\u2026","book_download":"http://file.allitebooks.com/20200315/Head First Go.pdf","book_FileSize":" 97.5 MB"},{"id":10,"book_name":"Essential ASP.NET Web Forms Development","book_img":"http://www.allitebooks.org/wp-content/uploads/2020/03/Essential-ASP.NET-Web-Forms-Development.jpg","book_author":"Robert E. Beasley","book_info":"Go from beginner to pro using one of the most effective and widely used technology stacks, Microsoft ASP.NET. Beginning with the basics, you will learn how to create interactive, professional-grade, database-driven web applications in no time, using ASP.NET, C#, SQL, Ajax, and JavaScript. Essential ASP.NET Web Forms Development is\u2026","book_download":"http://file.allitebooks.com/20200314/Essential ASP.NET Web Forms Development.pdf","book_FileSize":" 18.9 MB"}]
14 | */
15 |
16 | private int currentPage;
17 | private int pageSize;
18 | private int totalNum;
19 | private int isMore;
20 | private int totalPage;
21 | private List items;
22 |
23 | public int getCurrentPage() {
24 | return currentPage;
25 | }
26 |
27 | public void setCurrentPage(int currentPage) {
28 | this.currentPage = currentPage;
29 | }
30 |
31 | public int getPageSize() {
32 | return pageSize;
33 | }
34 |
35 | public void setPageSize(int pageSize) {
36 | this.pageSize = pageSize;
37 | }
38 |
39 | public int getTotalNum() {
40 | return totalNum;
41 | }
42 |
43 | public void setTotalNum(int totalNum) {
44 | this.totalNum = totalNum;
45 | }
46 |
47 | public int getIsMore() {
48 | return isMore;
49 | }
50 |
51 | public void setIsMore(int isMore) {
52 | this.isMore = isMore;
53 | }
54 |
55 | public int getTotalPage() {
56 | return totalPage;
57 | }
58 |
59 | public void setTotalPage(int totalPage) {
60 | this.totalPage = totalPage;
61 | }
62 |
63 | public List getItems() {
64 | return items;
65 | }
66 |
67 | public void setItems(List items) {
68 | this.items = items;
69 | }
70 |
71 | public static class ItemsBean {
72 | /**
73 | * id : 1
74 | * book_name : PowerPoint 2019 For Dummies
75 | * book_img : http://www.allitebooks.org/wp-content/uploads/2020/03/PowerPoint-2019-For-Dummies.jpg
76 | * book_author : Doug Lowe
77 | * book_info : Get up and running fast with the PowerPoint 2019 PowerPoint continues to be the go-to tool for business presentations. The software helps anyone who needs to communicate clearly by creating powerful and effective slideshow presentations featuring data in the form of charts, clip art, sound, and video. You…
78 | * book_download : http://file.allitebooks.com/20200323/PowerPoint 2019 For Dummies.pdf
79 | * book_FileSize : 30.9 MB
80 | */
81 |
82 | private int id;
83 | private String book_name;
84 | private String book_img;
85 | private String book_author;
86 | private String book_info;
87 | private String book_download;
88 | private String book_FileSize;
89 |
90 | public int getId() {
91 | return id;
92 | }
93 |
94 | public void setId(int id) {
95 | this.id = id;
96 | }
97 |
98 | public String getBook_name() {
99 | return book_name;
100 | }
101 |
102 | public void setBook_name(String book_name) {
103 | this.book_name = book_name;
104 | }
105 |
106 | public String getBook_img() {
107 | return book_img;
108 | }
109 |
110 | public void setBook_img(String book_img) {
111 | this.book_img = book_img;
112 | }
113 |
114 | public String getBook_author() {
115 | return book_author;
116 | }
117 |
118 | public void setBook_author(String book_author) {
119 | this.book_author = book_author;
120 | }
121 |
122 | public String getBook_info() {
123 | return book_info;
124 | }
125 |
126 | public void setBook_info(String book_info) {
127 | this.book_info = book_info;
128 | }
129 |
130 | public String getBook_download() {
131 | return book_download;
132 | }
133 |
134 | public void setBook_download(String book_download) {
135 | this.book_download = book_download;
136 | }
137 |
138 | public String getBook_FileSize() {
139 | return book_FileSize;
140 | }
141 |
142 | public void setBook_FileSize(String book_FileSize) {
143 | this.book_FileSize = book_FileSize;
144 | }
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/java/com/glc/itbook/fragment/Fragment_dongtai.java:
--------------------------------------------------------------------------------
1 | package com.glc.itbook.fragment;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.LinearLayout;
9 | import android.widget.Toast;
10 |
11 | import androidx.annotation.NonNull;
12 | import androidx.annotation.Nullable;
13 | import androidx.fragment.app.Fragment;
14 |
15 | import com.glc.itbook.AddActivity;
16 | import com.glc.itbook.R;
17 | import com.glc.itbook.UpdateActity;
18 |
19 | public class Fragment_dongtai extends Fragment {
20 | private LinearLayout addBook;
21 | private LinearLayout updateBook;
22 | private String username;
23 | @Nullable
24 | @Override
25 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
26 | return inflater.inflate(R.layout.fragment_dongtai,null);
27 | }
28 |
29 | @Override
30 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
31 | super.onViewCreated(view, savedInstanceState);
32 | addBook=view.findViewById(R.id.ly_addBook);
33 | updateBook=view.findViewById(R.id.ly_updateBook);
34 |
35 | username = getArguments().getString("username");
36 |
37 | addBook.setOnClickListener(new View.OnClickListener() {
38 | @Override
39 | public void onClick(View view) {
40 | startActivity(new Intent(getActivity(), AddActivity.class));
41 | }
42 | });
43 |
44 | updateBook.setOnClickListener(new View.OnClickListener() {
45 | @Override
46 | public void onClick(View view) {
47 | if(username.equals("admin")){
48 | startActivity(new Intent(getActivity(), UpdateActity.class));
49 |
50 | }else {
51 | Toast.makeText(getActivity(), "对不起您未有该权限,请联系管理员", Toast.LENGTH_SHORT).show();
52 |
53 |
54 | }
55 | }
56 | });
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/java/com/glc/itbook/fragment/Fragment_index.java:
--------------------------------------------------------------------------------
1 | package com.glc.itbook.fragment;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.content.SharedPreferences;
6 | import android.os.Bundle;
7 | import android.util.Log;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 | import android.widget.AdapterView;
12 | import android.widget.BaseAdapter;
13 | import android.widget.Button;
14 | import android.widget.EditText;
15 | import android.widget.ImageView;
16 | import android.widget.ListView;
17 | import android.widget.TextView;
18 | import android.widget.Toast;
19 |
20 | import androidx.annotation.NonNull;
21 | import androidx.annotation.Nullable;
22 | import androidx.fragment.app.Fragment;
23 | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
24 |
25 | import com.android.volley.Request;
26 | import com.android.volley.RequestQueue;
27 | import com.android.volley.Response;
28 | import com.android.volley.VolleyError;
29 | import com.android.volley.toolbox.JsonObjectRequest;
30 | import com.android.volley.toolbox.Volley;
31 | import com.bumptech.glide.Glide;
32 | import com.glc.itbook.R;
33 | import com.glc.itbook.XiangQingActivity;
34 | import com.glc.itbook.bean.Book;
35 | import com.google.gson.Gson;
36 |
37 | import org.json.JSONObject;
38 |
39 | import java.io.UnsupportedEncodingException;
40 | import java.net.URLEncoder;
41 |
42 | public class Fragment_index extends Fragment {
43 | private ListView mlistView;
44 | private BaseAdapter adapter;
45 | private TextView tvShangye;
46 | private TextView tvNext;
47 | private EditText edtYeMa;
48 | private Button btnTiaozhuan;
49 | private int page = 1;
50 | private TextView tvCurrentPage;
51 | private int totalPage;
52 | private TextView bookName;
53 | private Button souSuo;
54 |
55 |
56 | @Nullable
57 | @Override
58 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
59 | return inflater.inflate(R.layout.fragment_index, null);
60 | }
61 |
62 |
63 | @Override
64 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
65 | super.onViewCreated(view, savedInstanceState);
66 | mlistView = view.findViewById(R.id.menu_list);
67 | tvNext = view.findViewById(R.id.tv_next);
68 | tvShangye = view.findViewById(R.id.tv_shangye);
69 | tvCurrentPage = view.findViewById(R.id.tv_currentPage);
70 | edtYeMa = view.findViewById(R.id.edt_yema);
71 | btnTiaozhuan = view.findViewById(R.id.btn_tiaozhuan);
72 | bookName=view.findViewById(R.id.edt_bookName);
73 | souSuo=view.findViewById(R.id.btn_imgSousuo);
74 |
75 |
76 |
77 |
78 | String bookNameStr = bookName.getText().toString().trim();
79 | selectFenYe(bookNameStr,1);
80 | //上一页
81 | tvShangye.setOnClickListener(new View.OnClickListener() {
82 | @Override
83 | public void onClick(View view) {
84 | if (page > 1) {
85 | String bookNameStr = bookName.getText().toString().trim();
86 | try {
87 | String encode = URLEncoder.encode(bookNameStr, "utf-8");
88 | selectFenYe(encode,--page);
89 | } catch (UnsupportedEncodingException e) {
90 | e.printStackTrace();
91 | }
92 | } else {
93 | Toast.makeText(getActivity(), "当前第一页", Toast.LENGTH_SHORT).show();
94 | }
95 |
96 | }
97 | });
98 | //下一页
99 | tvNext.setOnClickListener(new View.OnClickListener() {
100 | @Override
101 | public void onClick(View view) {
102 | if (page < totalPage) {
103 | String bookNameStr = bookName.getText().toString().trim();
104 | try {
105 | String encode = URLEncoder.encode(bookNameStr, "utf-8");
106 | selectFenYe(encode,++page);
107 | } catch (UnsupportedEncodingException e) {
108 | e.printStackTrace();
109 | }
110 | } else {
111 | Toast.makeText(getActivity(), "到达尾页", Toast.LENGTH_SHORT).show();
112 | }
113 | }
114 | });
115 | //跳转页码
116 | btnTiaozhuan.setOnClickListener(new View.OnClickListener() {
117 | @Override
118 | public void onClick(View view) {
119 | page = Integer.parseInt(edtYeMa.getText().toString().trim());
120 | if (page > 0 && page <= totalPage) {
121 |
122 | String bookNameStr = bookName.getText().toString().trim();
123 | try {
124 | String encode = URLEncoder.encode(bookNameStr, "utf-8");
125 | selectFenYe(encode,page);
126 | } catch (UnsupportedEncodingException e) {
127 | e.printStackTrace();
128 | }
129 | } else {
130 | Toast.makeText(getActivity(), "超过最大页数", Toast.LENGTH_SHORT).show();
131 |
132 | }
133 | }
134 | });
135 |
136 | //搜索按钮
137 | souSuo.setOnClickListener(new View.OnClickListener() {
138 | @Override
139 | public void onClick(View view) {
140 | String bookNameStr = bookName.getText().toString().trim();
141 | try {
142 | String encode = URLEncoder.encode(bookNameStr, "utf-8");
143 | selectFenYe(encode,1);
144 | } catch (UnsupportedEncodingException e) {
145 | e.printStackTrace();
146 | }
147 |
148 | }
149 | });
150 |
151 | }
152 |
153 | //分页搜索显示的数据 -- 默认显示全部
154 | private void selectFenYe(String name,int page){
155 | JSONObject jsonObject = new JSONObject();
156 | String url = "http://192.168.1.103:8085/item/findByPageName?name="+name+"¤tPage="+page+"&pageSize=10";
157 | RequestQueue requestQueue = Volley.newRequestQueue(getActivity());
158 | JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, url, jsonObject, new Response.Listener() {
159 | @Override
160 | public void onResponse(JSONObject jsonObject) {
161 |
162 | Gson gson = new Gson();
163 | final Book book = gson.fromJson(jsonObject.toString(), Book.class);
164 | int currentPage = book.getCurrentPage();
165 | tvCurrentPage.setText("第" + currentPage + "页");
166 | totalPage = book.getTotalPage();
167 | adapter = new BaseAdapter() {
168 | @Override
169 | public int getCount() {
170 | return book.getItems().size();
171 | }
172 |
173 | @Override
174 | public Object getItem(int i) {
175 | return null;
176 | }
177 |
178 | @Override
179 | public long getItemId(int i) {
180 | return 0;
181 | }
182 |
183 | @Override
184 | public View getView(final int i, View view, ViewGroup viewGroup) {
185 | view = View.inflate(getContext(), R.layout.item_booklist, null);
186 | ImageView imageView = view.findViewById(R.id.item_image);
187 | TextView name = view.findViewById(R.id.item_bookName);
188 | final TextView user = view.findViewById(R.id.item_bookUser);
189 | TextView info = view.findViewById(R.id.item_bookInfo);
190 | TextView down = view.findViewById(R.id.item_bookDown);
191 | name.setText("书名:"+book.getItems().get(i).getBook_name());
192 | user.setText("作者:"+book.getItems().get(i).getBook_author());
193 | info.setText("简介:"+book.getItems().get(i).getBook_info());
194 |
195 | mlistView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
196 | @Override
197 | public void onItemClick(AdapterView> adapterView, View view, int i, long l) {
198 | Intent intent=new Intent(getActivity(), XiangQingActivity.class);
199 | Bundle bundle=new Bundle();
200 | bundle.putString("name",book.getItems().get(i).getBook_name());
201 | bundle.putString("author",book.getItems().get(i).getBook_author());
202 | bundle.putString("jianjie",book.getItems().get(i).getBook_info());
203 | bundle.putString("down",book.getItems().get(i).getBook_download());
204 | bundle.putString("img",book.getItems().get(i).getBook_img());
205 | intent.putExtras(bundle);
206 | startActivity(intent);
207 | }
208 | });
209 |
210 | Glide.with(getContext()).load(book.getItems().get(i).getBook_img()).into(imageView);
211 |
212 | return view;
213 | }
214 | };
215 | mlistView.setAdapter(adapter);
216 |
217 | }
218 | }, new Response.ErrorListener() {
219 | @Override
220 | public void onErrorResponse(VolleyError volleyError) {
221 | Toast.makeText(getActivity(), "网络出错", Toast.LENGTH_SHORT).show();
222 | }
223 | });
224 | requestQueue.add(jsonObjectRequest);
225 | }
226 | }
227 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/java/com/glc/itbook/fragment/Fragment_wode.java:
--------------------------------------------------------------------------------
1 | package com.glc.itbook.fragment;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.content.SharedPreferences;
6 | import android.os.Bundle;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 | import android.widget.Button;
11 | import android.widget.ImageView;
12 | import android.widget.LinearLayout;
13 | import android.widget.TextView;
14 |
15 | import androidx.annotation.NonNull;
16 | import androidx.annotation.Nullable;
17 | import androidx.fragment.app.Fragment;
18 |
19 | import com.bumptech.glide.Glide;
20 | import com.bumptech.glide.load.resource.bitmap.CenterCrop;
21 | import com.glc.itbook.BanBenActivity;
22 | import com.glc.itbook.LoginActivity;
23 | import com.glc.itbook.R;
24 |
25 | import jp.wasabeef.glide.transformations.BlurTransformation;
26 | import jp.wasabeef.glide.transformations.CropCircleTransformation;
27 |
28 | public class Fragment_wode extends Fragment {
29 |
30 | private ImageView hBack;
31 | private ImageView hHead;
32 | private TextView muser_name;
33 | private TextView muser_val;
34 | private Button tuichu;
35 |
36 | private LinearLayout lyBanben;
37 | @Nullable
38 | @Override
39 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
40 | return inflater.inflate(R.layout.fragment_wode,null);
41 | }
42 |
43 | @Override
44 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
45 | super.onViewCreated(view, savedInstanceState);
46 | hBack=view.findViewById(R.id.h_back);
47 | hHead=view.findViewById(R.id.h_head);
48 | muser_name=view.findViewById(R.id.user_name);
49 | muser_val=view.findViewById(R.id.user_val);
50 | tuichu=view.findViewById(R.id.btn_tuichudenglu);
51 | lyBanben=view.findViewById(R.id.ly_banben);
52 | tuichu.setOnClickListener(new View.OnClickListener() {
53 | @Override
54 | public void onClick(View view) {
55 | SharedPreferences sharedPreferences=getActivity().getSharedPreferences("data", Context.MODE_PRIVATE);
56 | SharedPreferences.Editor editor=sharedPreferences.edit();
57 | editor.clear();
58 | editor.commit();
59 | startActivity(new Intent(getActivity(), LoginActivity.class));
60 | }
61 | });
62 |
63 | lyBanben.setOnClickListener(new View.OnClickListener() {
64 | @Override
65 | public void onClick(View view) {
66 | startActivity(new Intent(getActivity(), BanBenActivity.class));
67 | }
68 | });
69 |
70 | String username = getArguments().getString("username");
71 | muser_name.setText(username);
72 | String phone = getArguments().getString("phone").replaceAll("(\\d{3})\\d{4}(\\d{4})","$1****$2");
73 | muser_val.setText(phone);
74 |
75 | Glide.with(getActivity()).load(R.drawable.admin).bitmapTransform(new BlurTransformation(getActivity(),25),new CenterCrop(getActivity()))
76 | .into(hBack);
77 |
78 | Glide.with(getActivity()).load(R.drawable.admin).bitmapTransform(new CropCircleTransformation(getActivity())).into(hHead);
79 |
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/drawable/add.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/admin.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/drawable/admin.jpg
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/banben.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/drawable/banben.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/drawable/bg.jpg
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/bg_edit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
7 |
8 |
9 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/bg_edit2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
7 |
8 |
9 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/buttonstyle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | -
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/buttonstyle2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | -
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/dianhua.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/drawable/dianhua.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/dongtai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/drawable/dongtai.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/dongtai1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/drawable/dongtai1.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/index.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/drawable/index.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/index1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/drawable/index1.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/me.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/drawable/me.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/me1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/drawable/me1.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/mima.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/drawable/mima.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/sousuo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/drawable/sousuo.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/updatebook.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/drawable/updatebook.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/youjiantou.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/drawable/youjiantou.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/drawable/zuojiantou.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/drawable/zuojiantou.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/layout/activity_add.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
13 |
19 |
26 |
27 |
31 |
35 |
41 |
49 |
50 |
54 |
60 |
69 |
70 |
74 |
80 |
89 |
90 |
94 |
100 |
109 |
110 |
115 |
121 |
130 |
131 |
132 |
133 |
141 |
142 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/layout/activity_ban_ben.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
13 |
19 |
26 |
27 |
31 |
37 |
44 |
50 |
56 |
57 |
65 |
66 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/layout/activity_login.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
14 |
21 |
22 |
29 |
30 |
37 |
49 |
50 |
58 |
59 |
72 |
73 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
101 |
110 |
119 |
120 |
121 |
122 |
123 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/layout/activity_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
16 |
17 |
18 |
21 |
22 |
28 |
33 |
38 |
45 |
46 |
47 |
48 |
54 |
59 |
64 |
72 |
73 |
74 |
75 |
81 |
86 |
91 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/layout/activity_regist.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
14 |
21 |
22 |
29 |
30 |
37 |
49 |
50 |
58 |
59 |
72 |
80 |
92 |
93 |
101 |
115 |
116 |
124 |
125 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
153 |
154 |
163 |
172 |
173 |
174 |
175 |
176 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/layout/activity_update_actity.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
12 |
13 |
19 |
20 |
23 |
34 |
39 |
47 |
48 |
49 |
50 |
51 |
55 |
56 |
57 |
58 |
63 |
71 |
75 |
82 |
95 |
102 |
103 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/layout/activity_update_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
13 |
19 |
26 |
27 |
31 |
35 |
41 |
49 |
50 |
54 |
60 |
69 |
70 |
74 |
80 |
89 |
90 |
94 |
100 |
109 |
110 |
115 |
121 |
130 |
131 |
132 |
133 |
141 |
142 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/layout/activity_xiang_qing.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
13 |
19 |
25 |
31 |
32 |
37 |
44 |
45 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/layout/fragment_dongtai.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
11 |
16 |
20 |
27 |
28 |
29 |
34 |
35 |
39 |
40 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/layout/fragment_index.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
17 |
18 |
21 |
32 |
37 |
44 |
45 |
46 |
47 |
48 |
49 |
53 |
54 |
55 |
56 |
61 |
69 |
73 |
80 |
93 |
100 |
101 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/layout/fragment_wode.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
13 |
18 |
24 |
31 |
39 |
48 |
49 |
50 |
51 |
52 |
53 |
58 |
62 |
66 |
75 |
81 |
82 |
88 |
92 |
96 |
105 |
111 |
112 |
118 |
122 |
126 |
135 |
141 |
142 |
148 |
153 |
157 |
166 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
189 |
190 |
191 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/layout/item_booklist.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
16 |
17 |
22 |
23 |
28 |
29 |
38 |
39 |
47 |
48 |
51 |
52 |
61 |
62 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/layout/item_booklist2.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
14 |
15 |
20 |
21 |
26 |
27 |
36 |
37 |
45 |
46 |
49 |
50 |
59 |
63 |
73 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/mipmap-hdpi/book.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/mipmap-hdpi/book.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ItBook
3 |
4 |
5 | Hello blank fragment
6 |
7 |
--------------------------------------------------------------------------------
/ItBook/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/ItBook/app/src/test/java/com/glc/itbook/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.glc.itbook;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/ItBook/app/volley.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/app/volley.jar
--------------------------------------------------------------------------------
/ItBook/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
6 | google()
7 | jcenter()
8 |
9 | }
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:3.4.1'
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 | mavenCentral()
23 | maven { url "https://jitpack.io" }
24 | maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
25 |
26 | }
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/ItBook/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 |
21 |
--------------------------------------------------------------------------------
/ItBook/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/ItBook/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/ItBook/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Apr 28 11:17:35 CST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/ItBook/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/ItBook/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/ItBook/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ITBookDemo-springboot-android
2 | 基于安卓原生和springboot后台的图书管理系统
3 |
4 |
5 | [csdn博客地址](https://blog.csdn.net/glc11223344/article/details/105934214)
6 |
7 |
8 | ITBook文件夹是安卓代码
9 |
10 | login-register文件夹是java后台代码
11 |
12 | ## 项目简介
13 | 根据springboot+mybatis后端返回json格式数据,移动端安卓完成登录、注册,图书列表页面的展示(增删改查)功能。
14 |
15 | [登录注册的相关介绍可以查看此csdn博客](https://blog.csdn.net/glc11223344/article/details/105822237)
16 |
17 | ## 工具
18 | **java后台:**
19 | 开发工具:idea
20 | mysql版本:5.7版本
21 | 数据库中图书Item表资源来源于这位大佬 [weixin_43912367](https://blog.csdn.net/weixin_43912367)
22 |
23 | 通过springboot2.x+mybatis+mysql,通过pagehelper插件完成数据的分页功能
24 |
25 |
26 | **安卓前台:**
27 | 开发工具:Android Studio
28 | 接口测试工具:postman
29 | 用到的jar包有volley(网络请求),Gson(解析json),glide(网络图片展示),GsonFormat工具生成json对应的实体类 ,使用fragment+viewPage实现页面的切换
30 | ## java后台
31 | 
32 | 使用的三层架构视图层(ItemController)、业务层(ItemService)、Dao层(ItemMapper)完成整个图书Item单表的CRUD,这里使用到MyBatis分页插件 PageHelper,可以让我们简单的完成数据的分页逻辑。
33 | ## 安卓端
34 | 
35 | 使用的是原生安卓,通过网络请求框架Volley完成对后台数据的获取。通过listview完成数据的展示。
36 |
37 | *对于详细的代码片段因时间原因就不更了可以自行下载*
38 | [这里是后端和安卓端源码Github下载链接,如果对您有帮助不妨给一个star](https://github.com/GAOli-cong/ITBookDemo-springboot-android)
39 |
40 |
41 |
--------------------------------------------------------------------------------
/login-register/.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 |
--------------------------------------------------------------------------------
/login-register/.mvn/wrapper/MavenWrapperDownloader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2007-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | import java.net.*;
18 | import java.io.*;
19 | import java.nio.channels.*;
20 | import java.util.Properties;
21 |
22 | public class MavenWrapperDownloader {
23 |
24 | private static final String WRAPPER_VERSION = "0.5.6";
25 | /**
26 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
27 | */
28 | private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
29 | + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
30 |
31 | /**
32 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
33 | * use instead of the default one.
34 | */
35 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
36 | ".mvn/wrapper/maven-wrapper.properties";
37 |
38 | /**
39 | * Path where the maven-wrapper.jar will be saved to.
40 | */
41 | private static final String MAVEN_WRAPPER_JAR_PATH =
42 | ".mvn/wrapper/maven-wrapper.jar";
43 |
44 | /**
45 | * Name of the property which should be used to override the default download url for the wrapper.
46 | */
47 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
48 |
49 | public static void main(String args[]) {
50 | System.out.println("- Downloader started");
51 | File baseDirectory = new File(args[0]);
52 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
53 |
54 | // If the maven-wrapper.properties exists, read it and check if it contains a custom
55 | // wrapperUrl parameter.
56 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
57 | String url = DEFAULT_DOWNLOAD_URL;
58 | if (mavenWrapperPropertyFile.exists()) {
59 | FileInputStream mavenWrapperPropertyFileInputStream = null;
60 | try {
61 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
62 | Properties mavenWrapperProperties = new Properties();
63 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
64 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
65 | } catch (IOException e) {
66 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
67 | } finally {
68 | try {
69 | if (mavenWrapperPropertyFileInputStream != null) {
70 | mavenWrapperPropertyFileInputStream.close();
71 | }
72 | } catch (IOException e) {
73 | // Ignore ...
74 | }
75 | }
76 | }
77 | System.out.println("- Downloading from: " + url);
78 |
79 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
80 | if (!outputFile.getParentFile().exists()) {
81 | if (!outputFile.getParentFile().mkdirs()) {
82 | System.out.println(
83 | "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
84 | }
85 | }
86 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
87 | try {
88 | downloadFileFromURL(url, outputFile);
89 | System.out.println("Done");
90 | System.exit(0);
91 | } catch (Throwable e) {
92 | System.out.println("- Error downloading");
93 | e.printStackTrace();
94 | System.exit(1);
95 | }
96 | }
97 |
98 | private static void downloadFileFromURL(String urlString, File destination) throws Exception {
99 | if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
100 | String username = System.getenv("MVNW_USERNAME");
101 | char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
102 | Authenticator.setDefault(new Authenticator() {
103 | @Override
104 | protected PasswordAuthentication getPasswordAuthentication() {
105 | return new PasswordAuthentication(username, password);
106 | }
107 | });
108 | }
109 | URL website = new URL(urlString);
110 | ReadableByteChannel rbc;
111 | rbc = Channels.newChannel(website.openStream());
112 | FileOutputStream fos = new FileOutputStream(destination);
113 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
114 | fos.close();
115 | rbc.close();
116 | }
117 |
118 | }
119 |
--------------------------------------------------------------------------------
/login-register/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GAOli-cong/ITBookDemo-springboot-android/a66b3c170ad3a400448d8a185617ba98efbe345f/login-register/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/login-register/.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 |
--------------------------------------------------------------------------------
/login-register/mvnw:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # ----------------------------------------------------------------------------
3 | # Licensed to the Apache Software Foundation (ASF) under one
4 | # or more contributor license agreements. See the NOTICE file
5 | # distributed with this work for additional information
6 | # regarding copyright ownership. The ASF licenses this file
7 | # to you under the Apache License, Version 2.0 (the
8 | # "License"); you may not use this file except in compliance
9 | # with the License. You may obtain a copy of the License at
10 | #
11 | # https://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing,
14 | # software distributed under the License is distributed on an
15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | # KIND, either express or implied. See the License for the
17 | # specific language governing permissions and limitations
18 | # under the License.
19 | # ----------------------------------------------------------------------------
20 |
21 | # ----------------------------------------------------------------------------
22 | # Maven Start Up Batch script
23 | #
24 | # Required ENV vars:
25 | # ------------------
26 | # JAVA_HOME - location of a JDK home dir
27 | #
28 | # Optional ENV vars
29 | # -----------------
30 | # M2_HOME - location of maven2's installed home dir
31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven
32 | # e.g. to debug Maven itself, use
33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files
35 | # ----------------------------------------------------------------------------
36 |
37 | if [ -z "$MAVEN_SKIP_RC" ] ; then
38 |
39 | if [ -f /etc/mavenrc ] ; then
40 | . /etc/mavenrc
41 | fi
42 |
43 | if [ -f "$HOME/.mavenrc" ] ; then
44 | . "$HOME/.mavenrc"
45 | fi
46 |
47 | fi
48 |
49 | # OS specific support. $var _must_ be set to either true or false.
50 | cygwin=false;
51 | darwin=false;
52 | mingw=false
53 | case "`uname`" in
54 | CYGWIN*) cygwin=true ;;
55 | MINGW*) mingw=true;;
56 | Darwin*) darwin=true
57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
59 | if [ -z "$JAVA_HOME" ]; then
60 | if [ -x "/usr/libexec/java_home" ]; then
61 | export JAVA_HOME="`/usr/libexec/java_home`"
62 | else
63 | export JAVA_HOME="/Library/Java/Home"
64 | fi
65 | fi
66 | ;;
67 | esac
68 |
69 | if [ -z "$JAVA_HOME" ] ; then
70 | if [ -r /etc/gentoo-release ] ; then
71 | JAVA_HOME=`java-config --jre-home`
72 | fi
73 | fi
74 |
75 | if [ -z "$M2_HOME" ] ; then
76 | ## resolve links - $0 may be a link to maven's home
77 | PRG="$0"
78 |
79 | # need this for relative symlinks
80 | while [ -h "$PRG" ] ; do
81 | ls=`ls -ld "$PRG"`
82 | link=`expr "$ls" : '.*-> \(.*\)$'`
83 | if expr "$link" : '/.*' > /dev/null; then
84 | PRG="$link"
85 | else
86 | PRG="`dirname "$PRG"`/$link"
87 | fi
88 | done
89 |
90 | saveddir=`pwd`
91 |
92 | M2_HOME=`dirname "$PRG"`/..
93 |
94 | # make it fully qualified
95 | M2_HOME=`cd "$M2_HOME" && pwd`
96 |
97 | cd "$saveddir"
98 | # echo Using m2 at $M2_HOME
99 | fi
100 |
101 | # For Cygwin, ensure paths are in UNIX format before anything is touched
102 | if $cygwin ; then
103 | [ -n "$M2_HOME" ] &&
104 | M2_HOME=`cygpath --unix "$M2_HOME"`
105 | [ -n "$JAVA_HOME" ] &&
106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
107 | [ -n "$CLASSPATH" ] &&
108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
109 | fi
110 |
111 | # For Mingw, ensure paths are in UNIX format before anything is touched
112 | if $mingw ; then
113 | [ -n "$M2_HOME" ] &&
114 | M2_HOME="`(cd "$M2_HOME"; pwd)`"
115 | [ -n "$JAVA_HOME" ] &&
116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
117 | fi
118 |
119 | if [ -z "$JAVA_HOME" ]; then
120 | javaExecutable="`which javac`"
121 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
122 | # readlink(1) is not available as standard on Solaris 10.
123 | readLink=`which readlink`
124 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
125 | if $darwin ; then
126 | javaHome="`dirname \"$javaExecutable\"`"
127 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
128 | else
129 | javaExecutable="`readlink -f \"$javaExecutable\"`"
130 | fi
131 | javaHome="`dirname \"$javaExecutable\"`"
132 | javaHome=`expr "$javaHome" : '\(.*\)/bin'`
133 | JAVA_HOME="$javaHome"
134 | export JAVA_HOME
135 | fi
136 | fi
137 | fi
138 |
139 | if [ -z "$JAVACMD" ] ; then
140 | if [ -n "$JAVA_HOME" ] ; then
141 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
142 | # IBM's JDK on AIX uses strange locations for the executables
143 | JAVACMD="$JAVA_HOME/jre/sh/java"
144 | else
145 | JAVACMD="$JAVA_HOME/bin/java"
146 | fi
147 | else
148 | JAVACMD="`which java`"
149 | fi
150 | fi
151 |
152 | if [ ! -x "$JAVACMD" ] ; then
153 | echo "Error: JAVA_HOME is not defined correctly." >&2
154 | echo " We cannot execute $JAVACMD" >&2
155 | exit 1
156 | fi
157 |
158 | if [ -z "$JAVA_HOME" ] ; then
159 | echo "Warning: JAVA_HOME environment variable is not set."
160 | fi
161 |
162 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
163 |
164 | # traverses directory structure from process work directory to filesystem root
165 | # first directory with .mvn subdirectory is considered project base directory
166 | find_maven_basedir() {
167 |
168 | if [ -z "$1" ]
169 | then
170 | echo "Path not specified to find_maven_basedir"
171 | return 1
172 | fi
173 |
174 | basedir="$1"
175 | wdir="$1"
176 | while [ "$wdir" != '/' ] ; do
177 | if [ -d "$wdir"/.mvn ] ; then
178 | basedir=$wdir
179 | break
180 | fi
181 | # workaround for JBEAP-8937 (on Solaris 10/Sparc)
182 | if [ -d "${wdir}" ]; then
183 | wdir=`cd "$wdir/.."; pwd`
184 | fi
185 | # end of workaround
186 | done
187 | echo "${basedir}"
188 | }
189 |
190 | # concatenates all lines of a file
191 | concat_lines() {
192 | if [ -f "$1" ]; then
193 | echo "$(tr -s '\n' ' ' < "$1")"
194 | fi
195 | }
196 |
197 | BASE_DIR=`find_maven_basedir "$(pwd)"`
198 | if [ -z "$BASE_DIR" ]; then
199 | exit 1;
200 | fi
201 |
202 | ##########################################################################################
203 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
204 | # This allows using the maven wrapper in projects that prohibit checking in binary data.
205 | ##########################################################################################
206 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
207 | if [ "$MVNW_VERBOSE" = true ]; then
208 | echo "Found .mvn/wrapper/maven-wrapper.jar"
209 | fi
210 | else
211 | if [ "$MVNW_VERBOSE" = true ]; then
212 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
213 | fi
214 | if [ -n "$MVNW_REPOURL" ]; then
215 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
216 | else
217 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
218 | fi
219 | while IFS="=" read key value; do
220 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
221 | esac
222 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
223 | if [ "$MVNW_VERBOSE" = true ]; then
224 | echo "Downloading from: $jarUrl"
225 | fi
226 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
227 | if $cygwin; then
228 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
229 | fi
230 |
231 | if command -v wget > /dev/null; then
232 | if [ "$MVNW_VERBOSE" = true ]; then
233 | echo "Found wget ... using wget"
234 | fi
235 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
236 | wget "$jarUrl" -O "$wrapperJarPath"
237 | else
238 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
239 | fi
240 | elif command -v curl > /dev/null; then
241 | if [ "$MVNW_VERBOSE" = true ]; then
242 | echo "Found curl ... using curl"
243 | fi
244 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
245 | curl -o "$wrapperJarPath" "$jarUrl" -f
246 | else
247 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
248 | fi
249 |
250 | else
251 | if [ "$MVNW_VERBOSE" = true ]; then
252 | echo "Falling back to using Java to download"
253 | fi
254 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
255 | # For Cygwin, switch paths to Windows format before running javac
256 | if $cygwin; then
257 | javaClass=`cygpath --path --windows "$javaClass"`
258 | fi
259 | if [ -e "$javaClass" ]; then
260 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
261 | if [ "$MVNW_VERBOSE" = true ]; then
262 | echo " - Compiling MavenWrapperDownloader.java ..."
263 | fi
264 | # Compiling the Java class
265 | ("$JAVA_HOME/bin/javac" "$javaClass")
266 | fi
267 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
268 | # Running the downloader
269 | if [ "$MVNW_VERBOSE" = true ]; then
270 | echo " - Running MavenWrapperDownloader.java ..."
271 | fi
272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
273 | fi
274 | fi
275 | fi
276 | fi
277 | ##########################################################################################
278 | # End of extension
279 | ##########################################################################################
280 |
281 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
282 | if [ "$MVNW_VERBOSE" = true ]; then
283 | echo $MAVEN_PROJECTBASEDIR
284 | fi
285 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
286 |
287 | # For Cygwin, switch paths to Windows format before running java
288 | if $cygwin; then
289 | [ -n "$M2_HOME" ] &&
290 | M2_HOME=`cygpath --path --windows "$M2_HOME"`
291 | [ -n "$JAVA_HOME" ] &&
292 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
293 | [ -n "$CLASSPATH" ] &&
294 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
295 | [ -n "$MAVEN_PROJECTBASEDIR" ] &&
296 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
297 | fi
298 |
299 | # Provide a "standardized" way to retrieve the CLI args that will
300 | # work with both Windows and non-Windows executions.
301 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
302 | export MAVEN_CMD_LINE_ARGS
303 |
304 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
305 |
306 | exec "$JAVACMD" \
307 | $MAVEN_OPTS \
308 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
309 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
310 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
311 |
--------------------------------------------------------------------------------
/login-register/mvnw.cmd:
--------------------------------------------------------------------------------
1 | @REM ----------------------------------------------------------------------------
2 | @REM Licensed to the Apache Software Foundation (ASF) under one
3 | @REM or more contributor license agreements. See the NOTICE file
4 | @REM distributed with this work for additional information
5 | @REM regarding copyright ownership. The ASF licenses this file
6 | @REM to you under the Apache License, Version 2.0 (the
7 | @REM "License"); you may not use this file except in compliance
8 | @REM with the License. You may obtain a copy of the License at
9 | @REM
10 | @REM https://www.apache.org/licenses/LICENSE-2.0
11 | @REM
12 | @REM Unless required by applicable law or agreed to in writing,
13 | @REM software distributed under the License is distributed on an
14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | @REM KIND, either express or implied. See the License for the
16 | @REM specific language governing permissions and limitations
17 | @REM under the License.
18 | @REM ----------------------------------------------------------------------------
19 |
20 | @REM ----------------------------------------------------------------------------
21 | @REM Maven Start Up Batch script
22 | @REM
23 | @REM Required ENV vars:
24 | @REM JAVA_HOME - location of a JDK home dir
25 | @REM
26 | @REM Optional ENV vars
27 | @REM M2_HOME - location of maven2's installed home dir
28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
31 | @REM e.g. to debug Maven itself, use
32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
34 | @REM ----------------------------------------------------------------------------
35 |
36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
37 | @echo off
38 | @REM set title of command window
39 | title %0
40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
42 |
43 | @REM set %HOME% to equivalent of $HOME
44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
45 |
46 | @REM Execute a user defined script before this one
47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending
49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
51 | :skipRcPre
52 |
53 | @setlocal
54 |
55 | set ERROR_CODE=0
56 |
57 | @REM To isolate internal variables from possible post scripts, we use another setlocal
58 | @setlocal
59 |
60 | @REM ==== START VALIDATION ====
61 | if not "%JAVA_HOME%" == "" goto OkJHome
62 |
63 | echo.
64 | echo Error: JAVA_HOME not found in your environment. >&2
65 | echo Please set the JAVA_HOME variable in your environment to match the >&2
66 | echo location of your Java installation. >&2
67 | echo.
68 | goto error
69 |
70 | :OkJHome
71 | if exist "%JAVA_HOME%\bin\java.exe" goto init
72 |
73 | echo.
74 | echo Error: JAVA_HOME is set to an invalid directory. >&2
75 | echo JAVA_HOME = "%JAVA_HOME%" >&2
76 | echo Please set the JAVA_HOME variable in your environment to match the >&2
77 | echo location of your Java installation. >&2
78 | echo.
79 | goto error
80 |
81 | @REM ==== END VALIDATION ====
82 |
83 | :init
84 |
85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
86 | @REM Fallback to current working directory if not found.
87 |
88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
90 |
91 | set EXEC_DIR=%CD%
92 | set WDIR=%EXEC_DIR%
93 | :findBaseDir
94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound
95 | cd ..
96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound
97 | set WDIR=%CD%
98 | goto findBaseDir
99 |
100 | :baseDirFound
101 | set MAVEN_PROJECTBASEDIR=%WDIR%
102 | cd "%EXEC_DIR%"
103 | goto endDetectBaseDir
104 |
105 | :baseDirNotFound
106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
107 | cd "%EXEC_DIR%"
108 |
109 | :endDetectBaseDir
110 |
111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
112 |
113 | @setlocal EnableExtensions EnableDelayedExpansion
114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
116 |
117 | :endReadAdditionalConfig
118 |
119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
122 |
123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
124 |
125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
127 | )
128 |
129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data.
131 | if exist %WRAPPER_JAR% (
132 | if "%MVNW_VERBOSE%" == "true" (
133 | echo Found %WRAPPER_JAR%
134 | )
135 | ) else (
136 | if not "%MVNW_REPOURL%" == "" (
137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
138 | )
139 | if "%MVNW_VERBOSE%" == "true" (
140 | echo Couldn't find %WRAPPER_JAR%, downloading it ...
141 | echo Downloading from: %DOWNLOAD_URL%
142 | )
143 |
144 | powershell -Command "&{"^
145 | "$webclient = new-object System.Net.WebClient;"^
146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
148 | "}"^
149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
150 | "}"
151 | if "%MVNW_VERBOSE%" == "true" (
152 | echo Finished downloading %WRAPPER_JAR%
153 | )
154 | )
155 | @REM End of extension
156 |
157 | @REM Provide a "standardized" way to retrieve the CLI args that will
158 | @REM work with both Windows and non-Windows executions.
159 | set MAVEN_CMD_LINE_ARGS=%*
160 |
161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
162 | if ERRORLEVEL 1 goto error
163 | goto end
164 |
165 | :error
166 | set ERROR_CODE=1
167 |
168 | :end
169 | @endlocal & set ERROR_CODE=%ERROR_CODE%
170 |
171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending
173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
175 | :skipRcPost
176 |
177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause
179 |
180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
181 |
182 | exit /B %ERROR_CODE%
183 |
--------------------------------------------------------------------------------
/login-register/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 2.2.6.RELEASE
9 |
10 |
11 | com.glc
12 | login-register
13 | 0.0.1-SNAPSHOT
14 | login-register
15 | Demo project for Spring Boot
16 |
17 |
18 | 1.8
19 |
20 |
21 |
22 |
23 | org.springframework.boot
24 | spring-boot-starter-jdbc
25 |
26 |
27 | org.springframework.boot
28 | spring-boot-starter-web
29 |
30 |
31 | org.mybatis.spring.boot
32 | mybatis-spring-boot-starter
33 | 2.1.2
34 |
35 |
36 | mysql
37 | mysql-connector-java
38 | runtime
39 |
40 |
41 | com.alibaba
42 | druid
43 | 1.1.8
44 |
45 |
46 |
47 |
48 |
49 | com.github.pagehelper
50 | pagehelper-spring-boot-starter
51 | 1.2.5
52 |
53 |
54 |
55 |
56 | com.google.code.gson
57 | gson
58 |
59 |
60 |
61 | org.springframework.boot
62 | spring-boot-starter-test
63 | test
64 |
65 |
66 | org.junit.vintage
67 | junit-vintage-engine
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | org.springframework.boot
77 | spring-boot-maven-plugin
78 |
79 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/login-register/src/main/java/com/glc/loginregister/LoginRegisterApplication.java:
--------------------------------------------------------------------------------
1 | package com.glc.loginregister;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class LoginRegisterApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(LoginRegisterApplication.class, args);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/login-register/src/main/java/com/glc/loginregister/controller/ItemController.java:
--------------------------------------------------------------------------------
1 | package com.glc.loginregister.controller;
2 |
3 |
4 | import com.glc.loginregister.entity.Item;
5 | import com.glc.loginregister.entity.Message;
6 | import com.glc.loginregister.entity.PageBean;
7 | import com.glc.loginregister.entity.User;
8 | import com.glc.loginregister.mapper.ItemMapper;
9 | import com.glc.loginregister.service.ItemService;
10 | import org.springframework.beans.factory.annotation.Autowired;
11 | import org.springframework.context.annotation.Import;
12 | import org.springframework.web.bind.annotation.RequestBody;
13 | import org.springframework.web.bind.annotation.RequestMapping;
14 | import org.springframework.web.bind.annotation.ResponseBody;
15 | import org.springframework.web.bind.annotation.RestController;
16 |
17 | import java.util.List;
18 |
19 | @RestController
20 | @RequestMapping("/item")
21 | public class ItemController {
22 |
23 |
24 | @Autowired
25 | private ItemService itemService;
26 |
27 | /**
28 | * 分页显示所有数据
29 | * @param currentPage
30 | * @param pageSize
31 | * @return
32 | *
33 | *
34 | * http://localhost:8080/item/findByPage?currentPage=1&pageSize=10
35 | */
36 | @RequestMapping("/findByPage")
37 | @ResponseBody
38 | public PageBean itemsPage( int currentPage, int pageSize){
39 | return itemService.findItemByPage(currentPage,pageSize);
40 | }
41 |
42 |
43 | /**
44 | * 根据book_name名称查询记录信息
45 | * @param name
46 | * @param currentPage
47 | * @param pageSize
48 | * @return
49 | */
50 | @RequestMapping("/findByPageName")
51 | @ResponseBody
52 | public PageBean itemsPageByName(String name,int currentPage, int pageSize){
53 | return itemService.findItemByName(name,currentPage,pageSize);
54 | }
55 |
56 | /**
57 | * 添加
58 | * @param item
59 | * @return
60 | */
61 | @RequestMapping("/insertItem")
62 | @ResponseBody
63 | public Message insertItem(Item item){
64 | Integer integer = itemService.insertItem(item);
65 | Message message=new Message();
66 | if(integer>=1){
67 | message.setInfo("添加成功");
68 | return message;
69 | }else {
70 | message.setInfo("添加失败");
71 | return message;
72 | }
73 | }
74 |
75 |
76 | /**
77 | * 删除
78 | * @param
79 | * @return
80 | */
81 | @RequestMapping("/deleteItem")
82 | @ResponseBody
83 | public Message deleteItem(int id){
84 | Integer integer = itemService.deleteItem(id);
85 | Message message=new Message();
86 | if(integer>=1){
87 | message.setInfo("删除成功");
88 | return message;
89 | }else {
90 | message.setInfo("删除失败");
91 | return message;
92 | }
93 | }
94 |
95 |
96 | /**
97 | * 修改
98 | *
99 | * @param item
100 | * @return
101 | */
102 | @RequestMapping("/updateItem")
103 | @ResponseBody
104 | public Message updateItem(Item item){
105 | Integer integer = itemService.updateItem(item);
106 | Message message=new Message();
107 | if(integer>=1){
108 | message.setInfo("修改成功");
109 | return message;
110 | }else {
111 | message.setInfo("修改失败");
112 | return message;
113 | }
114 | }
115 |
116 |
117 |
118 | }
119 |
--------------------------------------------------------------------------------
/login-register/src/main/java/com/glc/loginregister/controller/UserController.java:
--------------------------------------------------------------------------------
1 | package com.glc.loginregister.controller;
2 |
3 |
4 | import com.glc.loginregister.entity.Result;
5 | import com.glc.loginregister.entity.User;
6 | import com.glc.loginregister.service.UserService;
7 | import org.springframework.beans.factory.annotation.Autowired;
8 | import org.springframework.web.bind.annotation.PostMapping;
9 | import org.springframework.web.bind.annotation.RequestBody;
10 | import org.springframework.web.bind.annotation.RequestMapping;
11 | import org.springframework.web.bind.annotation.RestController;
12 |
13 | @RestController
14 | @RequestMapping("user")
15 | public class UserController {
16 | @Autowired
17 | private UserService userService;
18 |
19 | /**
20 | * 注册
21 | * @param user
22 | * @return
23 | */
24 | @PostMapping("/register")
25 | public Result register(@RequestBody User user){
26 | return userService.rgister(user);
27 | }
28 |
29 | @PostMapping("/login")
30 | public Result login(@RequestBody User user){
31 | return userService.login(user);
32 | }
33 |
34 |
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/login-register/src/main/java/com/glc/loginregister/entity/Item.java:
--------------------------------------------------------------------------------
1 | package com.glc.loginregister.entity;
2 |
3 | public class Item {
4 | private Integer id;
5 | private String book_name;
6 | private String book_img;
7 | private String book_author;
8 | private String book_info;
9 | private String book_download;
10 | private String book_FileSize;
11 |
12 | public Integer getId() {
13 | return id;
14 | }
15 |
16 | public void setId(Integer id) {
17 | this.id = id;
18 | }
19 |
20 | public String getBook_name() {
21 | return book_name;
22 | }
23 |
24 | public void setBook_name(String book_name) {
25 | this.book_name = book_name;
26 | }
27 |
28 | public String getBook_img() {
29 | return book_img;
30 | }
31 |
32 | public void setBook_img(String book_img) {
33 | this.book_img = book_img;
34 | }
35 |
36 | public String getBook_author() {
37 | return book_author;
38 | }
39 |
40 | public void setBook_author(String book_author) {
41 | this.book_author = book_author;
42 | }
43 |
44 | public String getBook_info() {
45 | return book_info;
46 | }
47 |
48 | public void setBook_info(String book_info) {
49 | this.book_info = book_info;
50 | }
51 |
52 | public String getBook_download() {
53 | return book_download;
54 | }
55 |
56 | public void setBook_download(String book_download) {
57 | this.book_download = book_download;
58 | }
59 |
60 | public String getBook_FileSize() {
61 | return book_FileSize;
62 | }
63 |
64 | public void setBook_FileSize(String book_FileSize) {
65 | this.book_FileSize = book_FileSize;
66 | }
67 |
68 | @Override
69 | public String toString() {
70 | return "Item{" +
71 | "id=" + id +
72 | ", book_name='" + book_name + '\'' +
73 | ", book_img='" + book_img + '\'' +
74 | ", book_author='" + book_author + '\'' +
75 | ", book_info='" + book_info + '\'' +
76 | ", book_download='" + book_download + '\'' +
77 | ", book_FileSize='" + book_FileSize + '\'' +
78 | '}';
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/login-register/src/main/java/com/glc/loginregister/entity/Message.java:
--------------------------------------------------------------------------------
1 | package com.glc.loginregister.entity;
2 |
3 | public class Message {
4 | private String info;
5 |
6 | public String getInfo() {
7 | return info;
8 | }
9 |
10 | public Message setInfo(String info) {
11 | this.info = info;
12 | return null;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/login-register/src/main/java/com/glc/loginregister/entity/PageBean.java:
--------------------------------------------------------------------------------
1 | package com.glc.loginregister.entity;
2 |
3 | import java.util.List;
4 |
5 | public class PageBean {
6 | // 当前页
7 | private Integer currentPage = 1;
8 | // 每页显示的总条数
9 | private Integer pageSize = 10;
10 | // 总条数
11 | private Integer totalNum;
12 | // 是否有下一页
13 | private Integer isMore;
14 | // 总页数
15 | private Integer totalPage;
16 | // 开始索引
17 | // private Integer startIndex;
18 | // 分页结果
19 | private List items;
20 |
21 | public PageBean() {
22 | super();
23 | }
24 |
25 | public PageBean(Integer currentPage, Integer pageSize, Integer totalNum) {
26 | super();
27 | this.currentPage = currentPage;
28 | this.pageSize = pageSize;
29 | this.totalNum = totalNum;
30 | this.totalPage = (this.totalNum+this.pageSize-1)/this.pageSize;
31 | //this.startIndex = (this.currentPage-1)*this.pageSize;
32 | this.isMore = this.currentPage >= this.totalPage?0:1;
33 | }
34 |
35 | public Integer getCurrentPage() {
36 | return currentPage;
37 | }
38 |
39 | public void setCurrentPage(Integer currentPage) {
40 | this.currentPage = currentPage;
41 | }
42 |
43 | public Integer getPageSize() {
44 | return pageSize;
45 | }
46 |
47 | public void setPageSize(Integer pageSize) {
48 | this.pageSize = pageSize;
49 | }
50 |
51 | public Integer getTotalNum() {
52 | return totalNum;
53 | }
54 |
55 | public void setTotalNum(Integer totalNum) {
56 | this.totalNum = totalNum;
57 | }
58 |
59 | public Integer getIsMore() {
60 | return isMore;
61 | }
62 |
63 | public void setIsMore(Integer isMore) {
64 | this.isMore = isMore;
65 | }
66 |
67 | public Integer getTotalPage() {
68 | return totalPage;
69 | }
70 |
71 | public void setTotalPage(Integer totalPage) {
72 | this.totalPage = totalPage;
73 | }
74 |
75 | // public Integer getStartIndex() {
76 | // return startIndex;
77 | // }
78 | //
79 | // public void setStartIndex(Integer startIndex) {
80 | // this.startIndex = startIndex;
81 | // }
82 |
83 | public List getItems() {
84 | return items;
85 | }
86 |
87 | public void setItems(List items) {
88 | this.items = items;
89 | }
90 | }
91 |
92 |
--------------------------------------------------------------------------------
/login-register/src/main/java/com/glc/loginregister/entity/Result.java:
--------------------------------------------------------------------------------
1 | package com.glc.loginregister.entity;
2 |
3 | public class Result {
4 | private String msg;
5 | private boolean success;
6 | private T detail;
7 |
8 | public String getMsg() {
9 | return msg;
10 | }
11 |
12 | public void setMsg(String msg) {
13 | this.msg = msg;
14 | }
15 |
16 | public boolean isSuccess() {
17 | return success;
18 | }
19 |
20 | public void setSuccess(boolean success) {
21 | this.success = success;
22 | }
23 |
24 | public T getDetail() {
25 | return detail;
26 | }
27 |
28 | public void setDetail(T detail) {
29 | this.detail = detail;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/login-register/src/main/java/com/glc/loginregister/entity/User.java:
--------------------------------------------------------------------------------
1 | package com.glc.loginregister.entity;
2 |
3 | public class User {
4 | private Long id;
5 | private String username;
6 | private String password;
7 | private String address;
8 | private String phone;
9 |
10 | public Long getId() {
11 | return id;
12 | }
13 |
14 | public void setId(Long id) {
15 | this.id = id;
16 | }
17 |
18 | public String getUsername() {
19 | return username;
20 | }
21 |
22 | public void setUsername(String username) {
23 | this.username = username;
24 | }
25 |
26 | public String getPassword() {
27 | return password;
28 | }
29 |
30 | public void setPassword(String password) {
31 | this.password = password;
32 | }
33 |
34 | public String getPhone() {
35 | return phone;
36 | }
37 |
38 | public void setPhone(String phone) {
39 | this.phone = phone;
40 | }
41 |
42 | public String getAddress() {
43 | return address;
44 | }
45 |
46 | public void setAddress(String address) {
47 | this.address = address;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/login-register/src/main/java/com/glc/loginregister/mapper/ItemMapper.java:
--------------------------------------------------------------------------------
1 | package com.glc.loginregister.mapper;
2 |
3 | import com.glc.loginregister.entity.Item;
4 | import org.apache.ibatis.annotations.*;
5 | import org.springframework.stereotype.Repository;
6 |
7 | import java.util.List;
8 |
9 | @Mapper
10 | @Repository
11 | public interface ItemMapper {
12 |
13 | /**
14 | * 查询所有记录
15 | * @return
16 | */
17 | @Select("SELECT * FROM item")
18 | public List- listItem();
19 |
20 | /**
21 | * 查询总数
22 | * @return
23 | */
24 | @Select("SELECT count(*) from item")
25 | Integer countItem();
26 |
27 |
28 | @Select("SELECT * FROM item WHERE book_name LIKE '%${value}%'")
29 | public List
- listItemByName(String name);
30 |
31 |
32 | /**
33 | * 模糊查询的总记录数
34 | * @return
35 | */
36 | @Select("SELECT COUNT(*) FROM item WHERE book_name LIKE '%${value}%';")
37 | Integer countItemByName(String name);
38 |
39 |
40 | /**
41 | * 添加
42 | * @param item
43 | * @return
44 | */
45 | @Insert("INSERT INTO item (id, book_name, book_img, book_author, book_info, book_download, book_FileSize)\n" +
46 | " VALUES(#{id},#{book_name},#{book_img},#{book_author},#{book_info},#{book_download},#{book_FileSize});")
47 | @Options(useGeneratedKeys = true,keyProperty = "id",keyColumn = "id")
48 | Integer insertItem(Item item);
49 |
50 |
51 | /**
52 | * 删除
53 | * @param id
54 | * @return
55 | */
56 | @Delete(" DELETE FROM item WHERE id=#{id}")
57 | Integer deleteItem(int id);
58 |
59 |
60 | /**
61 | * 修改
62 | * @param item
63 | * @return
64 | */
65 | @Update("UPDATE item SET book_name=#{book_name},book_img=#{book_img},book_author=#{book_author},book_info=#{book_info},book_download=#{book_download},book_FileSize=#{book_FileSize} WHERE id=#{id}")
66 | @Options(useGeneratedKeys = true,keyProperty = "id",keyColumn = "id")
67 | Integer updateItem(Item item);
68 | }
69 |
--------------------------------------------------------------------------------
/login-register/src/main/java/com/glc/loginregister/mapper/UserMapper.java:
--------------------------------------------------------------------------------
1 | package com.glc.loginregister.mapper;
2 |
3 |
4 | import com.glc.loginregister.entity.User;
5 | import org.apache.ibatis.annotations.*;
6 | import org.springframework.stereotype.Repository;
7 | import org.springframework.stereotype.Service;
8 |
9 | @Mapper
10 | @Repository
11 | public interface UserMapper {
12 |
13 |
14 | /**
15 | *查看用户名是否已经存在
16 | * @param username
17 | * @return
18 | */
19 | @Select("select u.username,u.password from usermessage u where u.username=#{username}")
20 | User findUserByName(@Param("username") String username);
21 |
22 |
23 | @Select("SELECT * FROM usermessage WHERE id=#{id}")
24 | User findUserById(@Param("id") Long id);
25 |
26 |
27 | /**
28 | * 注册
29 | * @param user
30 | */
31 | @Insert("insert into usermessage values(#{id},#{username},#{password},#{address},#{phone})")
32 | @Options(useGeneratedKeys = true,keyProperty = "id",keyColumn = "id")
33 | void register(User user);
34 |
35 |
36 | /**
37 | * 登录
38 | * @param user
39 | * @return
40 | */
41 | @Select("select u.id from usermessage u where u.username=#{username} and password=#{password}")
42 | Long login(User user);
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/login-register/src/main/java/com/glc/loginregister/service/ItemService.java:
--------------------------------------------------------------------------------
1 | package com.glc.loginregister.service;
2 |
3 |
4 | import com.github.pagehelper.PageHelper;
5 | import com.github.pagehelper.PageInfo;
6 | import com.glc.loginregister.entity.Item;
7 | import com.glc.loginregister.entity.PageBean;
8 | import com.glc.loginregister.mapper.ItemMapper;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import org.springframework.stereotype.Service;
11 |
12 | import java.util.HashMap;
13 | import java.util.List;
14 | import java.util.Map;
15 |
16 | @Service
17 | public class ItemService {
18 | @Autowired
19 | private ItemMapper itemMapper;
20 |
21 |
22 | public PageBean findItemByPage(Integer currentPage, Integer pageSize) {
23 | //设置分页信息,分别是当前页数和每页显示的总记录数【记住:必须在mapper接口中的方法执行之前设置该分页信息】
24 | PageHelper.startPage(currentPage, pageSize);
25 |
26 | List
- allItems = itemMapper.listItem(); //全部商品
27 | int countNums = itemMapper.countItem(); //总记录数
28 | PageBean
- pageBean =new PageBean<>();
29 | pageBean.setItems(allItems);//分页结果
30 | pageBean.setCurrentPage(currentPage);//当前页
31 | pageBean.setPageSize(pageSize);//设置每页显示条数
32 | pageBean.setTotalNum(countNums);//设置总条数
33 |
34 |
35 | //计算分页数
36 | int pageConnt=(countNums+pageSize-1)/pageSize;
37 | pageBean.setTotalPage(pageConnt);//设置总页数
38 | if(currentPage();
50 | param.put("name",name);
51 | List
- items = itemMapper.listItemByName(name);
52 | int countNums = itemMapper.countItemByName(name);
53 | PageBean
- pageBean =new PageBean<>();
54 | pageBean.setItems(items);//分页结果
55 | pageBean.setCurrentPage(currentPage);//当前页
56 | pageBean.setPageSize(pageSize);//设置每页显示条数
57 | pageBean.setTotalNum(countNums);//设置总条数
58 |
59 | //计算分页数
60 | int pageConnt=(countNums+pageSize-1)/pageSize;
61 | pageBean.setTotalPage(pageConnt);//设置总页数
62 | if(currentPage