Before Width: | Height: | Size: 270 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 810 KiB |
After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 730 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 36 KiB |
@ -0,0 +1,2 @@
|
|||||||
|
[LocalizedFileNames]
|
||||||
|
ÐèÇóÆ¥Åä (1).png=@ÐèÇóÆ¥Åä (1),0
|
Before Width: | Height: | Size: 266 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 745 KiB |
Before Width: | Height: | Size: 190 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 760 KiB |
Before Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 445 KiB |
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 217 KiB |
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="WEB_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$/walktofree" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
@ -1,117 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="home-container">
|
|
||||||
<h1>首页</h1>
|
|
||||||
|
|
||||||
<div class="search-container">
|
|
||||||
<input type="text" class="search-input" placeholder="世界这么大出去看看吧">
|
|
||||||
<button class="search-button" @click="gotoSearchPage()">搜索</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="image-container">
|
|
||||||
<img src="../../photos/background.png" alt="图片描述" class="search-image">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="footer-nav">
|
|
||||||
<button>首页</button>
|
|
||||||
<button @click="gotomessage()">消息</button>
|
|
||||||
<button @click="gotomine()">我的</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
/* 添加样式以定义图片的大小和位置 */
|
|
||||||
.image-container {
|
|
||||||
text-align: center; /* 或者根据你的需求来设置 */
|
|
||||||
margin-top: 20px; /* 你可以根据需要调整这个值 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.home-container {
|
|
||||||
/* 添加你的样式 */
|
|
||||||
text-align: center;
|
|
||||||
padding: 20px;
|
|
||||||
/* 可能需要为内容添加一些底部空间以容纳底部导航 */
|
|
||||||
padding-bottom: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-container {
|
|
||||||
/* 定义搜索框容器的样式 */
|
|
||||||
text-align: center;
|
|
||||||
margin-bottom: 20px; /* 根据需要添加一些底部间距 */
|
|
||||||
display: flex;
|
|
||||||
align-items: center; /* 垂直居中 */
|
|
||||||
justify-content: center; /* 水平居中(如果不需要完全居中,可以去掉这个)*/
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-input {
|
|
||||||
/* 定义搜索框的样式 */
|
|
||||||
flex: 1; /* 占据剩余空间 */
|
|
||||||
padding: 10px;
|
|
||||||
border-radius: 5px;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-button {
|
|
||||||
/* 定义搜索按钮的样式 */
|
|
||||||
margin-left: 10px; /* 与搜索框之间的间距 */
|
|
||||||
padding: 10px 20px;
|
|
||||||
border: none;
|
|
||||||
border-radius: 5px;
|
|
||||||
background-color: #ccc;
|
|
||||||
color: #333;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-button:hover {
|
|
||||||
/* 搜索按钮点击时的样式 */
|
|
||||||
background-color: #bbb;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-nav {
|
|
||||||
/* 定义底部导航的样式 */
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-around;
|
|
||||||
padding: 10px;
|
|
||||||
background-color: #f5f5f5; /* 示例背景色 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-nav button {
|
|
||||||
/* 定义按钮的样式 */
|
|
||||||
flex: 1;
|
|
||||||
border: none;
|
|
||||||
padding: 10px;
|
|
||||||
background-color: #ccc;
|
|
||||||
color: #333;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-nav button:hover {
|
|
||||||
/* 按钮点击时的样式 */
|
|
||||||
background-color: #bbb;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'Home',
|
|
||||||
methods: {
|
|
||||||
gotohome() {
|
|
||||||
this.$router.push('/home');
|
|
||||||
},
|
|
||||||
gotomessage() {
|
|
||||||
this.$router.push('/message');
|
|
||||||
},
|
|
||||||
gotomine() {
|
|
||||||
this.$router.push('/mine');
|
|
||||||
},
|
|
||||||
gotoSearchPage() {
|
|
||||||
this.$router.push('/searchPage');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -0,0 +1,16 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<label for="user-input"></label>
|
||||||
|
<input type="text" id="user-input" v-model="userInput" placeholder="请输入">
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
userInput: '', // 初始化为空字符串
|
||||||
|
};
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,68 @@
|
|||||||
|
<template>
|
||||||
|
<div class="footer-nav">
|
||||||
|
<div class="button-with-icon" @click="gotohome()">
|
||||||
|
<el-icon><House /></el-icon>
|
||||||
|
<span>首页</span>
|
||||||
|
</div>
|
||||||
|
<div class="button-with-icon" @click="gotomessage()()">
|
||||||
|
<el-icon><ChatDotSquare /></el-icon>
|
||||||
|
<span>消息</span>
|
||||||
|
</div>
|
||||||
|
<div class="button-with-icon" @click="gotomine()">
|
||||||
|
<el-icon><User /></el-icon>
|
||||||
|
<span>我的</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'Home',
|
||||||
|
methods: {
|
||||||
|
gotohome() {
|
||||||
|
this.$router.push('/home');
|
||||||
|
},
|
||||||
|
gotomessage() {
|
||||||
|
this.$router.push('/message');
|
||||||
|
},
|
||||||
|
gotomine() {
|
||||||
|
this.$router.push('/mine');
|
||||||
|
},
|
||||||
|
gotoSearchPage() {
|
||||||
|
this.$router.push('/searchPage');
|
||||||
|
},
|
||||||
|
gotoAddDemandPage() {
|
||||||
|
this.$router.push('/addDemandPage');
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.footer-nav {
|
||||||
|
/* 定义底部导航的样式 */
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
padding: 10px;
|
||||||
|
background-color: #f5f5f5; /* 示例背景色 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-with-icon {
|
||||||
|
/* 定义按钮的样式 */
|
||||||
|
flex: 1;
|
||||||
|
border: none;
|
||||||
|
padding: 10px;
|
||||||
|
background-color: #ccc;
|
||||||
|
color: #333;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-nav button:hover {
|
||||||
|
/* 按钮点击时的样式 */
|
||||||
|
background-color: #bbb;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,11 +0,0 @@
|
|||||||
<script setup>
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
@ -1,67 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="home-container">
|
|
||||||
<h1>消息页面</h1>
|
|
||||||
|
|
||||||
<!-- 在这里添加你的主页内容 -->
|
|
||||||
|
|
||||||
<div class="footer-nav">
|
|
||||||
<button @click="gotohome()">首页</button>
|
|
||||||
<button @click="gotomessage()">消息</button>
|
|
||||||
<button @click="gotomine()">我的</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.home-container {
|
|
||||||
/* 添加你的样式 */
|
|
||||||
text-align: center;
|
|
||||||
padding: 20px;
|
|
||||||
/* 可能需要为内容添加一些底部空间以容纳底部导航 */
|
|
||||||
padding-bottom: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-nav {
|
|
||||||
/* 定义底部导航的样式 */
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-around;
|
|
||||||
padding: 10px;
|
|
||||||
background-color: #f5f5f5; /* 示例背景色 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-nav button {
|
|
||||||
/* 定义按钮的样式 */
|
|
||||||
flex: 1;
|
|
||||||
border: none;
|
|
||||||
padding: 10px;
|
|
||||||
background-color: #ccc;
|
|
||||||
color: #333;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-nav button:hover {
|
|
||||||
/* 按钮点击时的样式 */
|
|
||||||
background-color: #bbb;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'Message',
|
|
||||||
methods: {
|
|
||||||
gotohome() {
|
|
||||||
this.$router.push('/home');
|
|
||||||
},
|
|
||||||
gotomessage() {
|
|
||||||
this.$router.push('/message');
|
|
||||||
},
|
|
||||||
gotomine() {
|
|
||||||
this.$router.push('/mine');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -0,0 +1,28 @@
|
|||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'return',
|
||||||
|
methods: {
|
||||||
|
gotohome() {
|
||||||
|
this.$router.push('/home');
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<div class="return">
|
||||||
|
<button class="return-button" @click="gotohome()">返回</button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<style>.return-button {
|
||||||
|
/* 定义返回按钮的样式 */
|
||||||
|
position: fixed; /* 使按钮位置固定 */
|
||||||
|
top: 10px;
|
||||||
|
left: 10px;
|
||||||
|
margin: 0;
|
||||||
|
padding: 10px 20px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #ccc;
|
||||||
|
color: #333;
|
||||||
|
cursor: pointer;
|
||||||
|
} </style>
|
@ -0,0 +1,6 @@
|
|||||||
|
export type AreaList = {
|
||||||
|
code: string;
|
||||||
|
level: number;
|
||||||
|
name: string;
|
||||||
|
areaList: AreaList[];
|
||||||
|
};
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.softegg.freetogo.Demand.Dao;
|
||||||
|
|
||||||
|
import com.softegg.freetogo.Demand.bean.Demands;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:继承Jpa数据库接口类
|
||||||
|
* @author:wuyifan
|
||||||
|
* @date:2024/5/10 19:50
|
||||||
|
*/
|
||||||
|
public interface DemandsRepository extends JpaRepository<Demands, Integer> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
package com.softegg.freetogo.Demand.bean;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:数据库中表demand的对应实体类
|
||||||
|
* @author:wuyifan
|
||||||
|
* @date:2024/5/10 11:36
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name="demands")
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class Demands {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Integer uid;
|
||||||
|
@Column
|
||||||
|
private String phone;//游客手机号码
|
||||||
|
@Column
|
||||||
|
private boolean touristGender;//游客性别 ture:male, false:female
|
||||||
|
@Column
|
||||||
|
private String nickname;//发布需求的游客昵称信息
|
||||||
|
@Column
|
||||||
|
private String createTime;//需求发布时间
|
||||||
|
@Column
|
||||||
|
private String departureDate;//游客需求起始日期
|
||||||
|
@Column
|
||||||
|
private String endDate;//游客需求结束日期
|
||||||
|
@Column
|
||||||
|
private String sumDay;//游客旅游总天数
|
||||||
|
@Column
|
||||||
|
private String city;//发布需求的目的城市
|
||||||
|
@Column
|
||||||
|
private String message;//需求备注内容
|
||||||
|
// @Column
|
||||||
|
// private boolean guideGender;//希望导游性别
|
||||||
|
// @Column
|
||||||
|
// private int status;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,92 @@
|
|||||||
|
package com.softegg.freetogo.Demand.service;
|
||||||
|
|
||||||
|
import com.softegg.freetogo.Demand.Dao.DemandsRepository;
|
||||||
|
import com.softegg.freetogo.Demand.bean.Demands;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:数据库操作接口实现类
|
||||||
|
* @author:wuyifan
|
||||||
|
* @date:2024/5/10 19:50
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class DemandsServiceImpl implements DemandsService {
|
||||||
|
@Autowired
|
||||||
|
private DemandsRepository DemandsRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 查找所有游客需求
|
||||||
|
* @param: null
|
||||||
|
* @return: java.util.List<com.softegg.freetogo.Demand.Bean.Demands>
|
||||||
|
* @author: wuyifan
|
||||||
|
* @date: 2024/5/10 19:53
|
||||||
|
*/
|
||||||
|
public List<Demands> findAll() {
|
||||||
|
System.out.println("查询成功");
|
||||||
|
return DemandsRepository.findAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 以demand为游客需求入库
|
||||||
|
* @param: demand
|
||||||
|
* @return: void
|
||||||
|
* @author: wuyifan
|
||||||
|
* @date: 2024/5/10 19:55
|
||||||
|
*/
|
||||||
|
public void add(Demands demand) {
|
||||||
|
DemandsRepository.save(demand);
|
||||||
|
System.out.println("添加成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 删除对应序号id的需求
|
||||||
|
* @param: id
|
||||||
|
* @return: void
|
||||||
|
* @author: wuyifan
|
||||||
|
* @date: 2024/5/10 19:59
|
||||||
|
*/
|
||||||
|
public void deleteById(int id) {
|
||||||
|
DemandsRepository.deleteById(id);
|
||||||
|
System.out.println("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 获得对应序号id的需求
|
||||||
|
* @param: id
|
||||||
|
* @return: com.softegg.freetogo.Demand.Bean.Demands
|
||||||
|
* @author: wuyifan
|
||||||
|
* @date: 2024/5/10 20:02
|
||||||
|
*/
|
||||||
|
public Demands getDemandById(int id) {
|
||||||
|
return DemandsRepository.findById(id).orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 更新需求信息
|
||||||
|
* @param: demand
|
||||||
|
* @return: void
|
||||||
|
* @author: wuyifan
|
||||||
|
* @date: 2024/5/10 20:05
|
||||||
|
*/
|
||||||
|
public void update(Demands demand) {
|
||||||
|
DemandsRepository.save(demand);
|
||||||
|
System.out.println("更新成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @description: 判断相同需求是否已经入库
|
||||||
|
// * @param: id
|
||||||
|
// * @return: boolean
|
||||||
|
// * @author: wuyifan
|
||||||
|
// * @date: 2024/5/10 20:05
|
||||||
|
// */
|
||||||
|
// public boolean isRegister(int id) {
|
||||||
|
// Demands demand = DemandsRepository.findById(id);
|
||||||
|
// System.out.println(demand);
|
||||||
|
// return users != null;
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.softegg.freetogo.Evaluate.Dao;
|
||||||
|
|
||||||
|
import com.softegg.freetogo.Evaluate.bean.Evaluations;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 继承Jpa数据库接口类
|
||||||
|
* @author: zhanglinhao
|
||||||
|
* @date: 2024/5/10 9:27
|
||||||
|
*/
|
||||||
|
public interface EvaluateRepository extends JpaRepository<Evaluations, Integer> {
|
||||||
|
List<Evaluations> findByEditorPhone(String phone);
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
package com.softegg.freetogo.Evaluate.bean;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author:zhanglinhao
|
||||||
|
* @date:2024/5/10 9:07
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "evaluation")
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class Evaluations {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private int eid;
|
||||||
|
@Column(name = "etorname")
|
||||||
|
private String editorName;
|
||||||
|
@Column(name = "etorphone")
|
||||||
|
private String editorPhone;
|
||||||
|
@Column(name = "etedname")
|
||||||
|
private String editedName;
|
||||||
|
@Column(name = "etedphone")
|
||||||
|
private String editedPhone;
|
||||||
|
@Column(name = "createtime")
|
||||||
|
private String ct;
|
||||||
|
@Column(name = "modifytime")
|
||||||
|
private String mt;
|
||||||
|
@Column
|
||||||
|
private String ebody;
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.softegg.freetogo.Evaluate.controller;
|
||||||
|
|
||||||
|
import com.softegg.freetogo.Evaluate.bean.Evaluations;
|
||||||
|
import com.softegg.freetogo.Evaluate.service.EvaluateService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 对评价的操作
|
||||||
|
* @author: zhanglinhao
|
||||||
|
* @date: 2024/5/11 17:33
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/evaluate")
|
||||||
|
public class EvaluationController {
|
||||||
|
@Autowired
|
||||||
|
EvaluateService evaluateService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 获取所有需求
|
||||||
|
* @param: null
|
||||||
|
* @return: java.util.List<com.softegg.freetogo.Evaluate.bean.Evaluations>
|
||||||
|
* @author: zhanglinhao
|
||||||
|
* @date: 2024/5/12 0:11
|
||||||
|
*/
|
||||||
|
@GetMapping("findAllEvaluation")
|
||||||
|
public List<Evaluations> findAllEvaluation() {
|
||||||
|
return evaluateService.evaluationList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 添加评价
|
||||||
|
* @param: ebody
|
||||||
|
* @return: void
|
||||||
|
* @author: zhanglinhao
|
||||||
|
* @date: 2024/5/12 0:28
|
||||||
|
*/
|
||||||
|
@PostMapping("addEvaluation")
|
||||||
|
public void addEvaluation(@RequestBody Map<String, Evaluations> ebody) {
|
||||||
|
Evaluations evaluation = ebody.get("evaluation");
|
||||||
|
evaluateService.addEvaluation(evaluation);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 通过手机获取评价
|
||||||
|
* @param: phone
|
||||||
|
* @return: java.util.List<com.softegg.freetogo.Evaluate.bean.Evaluations>
|
||||||
|
* @author: zhanglinhao
|
||||||
|
* @date: 2024/5/12 0:30
|
||||||
|
*/
|
||||||
|
@GetMapping("evaluationByPhone")
|
||||||
|
public List<Evaluations> evaluationByPhone(String phone) {
|
||||||
|
return evaluateService.getEListByPhone(phone);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.softegg.freetogo.Evaluate.service;
|
||||||
|
|
||||||
|
import com.softegg.freetogo.Evaluate.bean.Evaluations;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author:zhanglinhao
|
||||||
|
* @date:2024/5/10 8:52
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public interface EvaluateService {
|
||||||
|
List<Evaluations> evaluationList();//获取所有评论
|
||||||
|
<<<<<<< HEAD
|
||||||
|
List<Evaluations> getEListByPhone(String phone);//根据电话筛选评价
|
||||||
|
void addEvaluation(Evaluations evaluation);//添加评论
|
||||||
|
|
||||||
|
=======
|
||||||
|
|
||||||
|
List<Evaluations> getEListByPhone(String phone);//根据电话筛选评价
|
||||||
|
|
||||||
|
void addEvaluation(Evaluations evaluation);//添加评论
|
||||||
|
|
||||||
|
void editEvaluation(int eid, String ebody);//编辑评论
|
||||||
|
|
||||||
|
void deleteEvaluation(int eid);//删除评论
|
||||||
|
>>>>>>> zhanglinhao_branch
|
||||||
|
}
|
@ -0,0 +1,109 @@
|
|||||||
|
package com.softegg.freetogo.Evaluate.service;
|
||||||
|
|
||||||
|
import com.softegg.freetogo.Evaluate.Dao.EvaluateRepository;
|
||||||
|
import com.softegg.freetogo.Evaluate.bean.Evaluations;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author:zhanglinhao
|
||||||
|
* @date:2024/5/10 9:25
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class EvaluateServiceImpl implements EvaluateService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
EvaluateRepository evaluateRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 获取所有评论
|
||||||
|
* @param: null
|
||||||
|
* @return: void
|
||||||
|
* @author: zhanglinhao
|
||||||
|
* @date: 2024/5/10 9:25
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Evaluations> evaluationList() {
|
||||||
|
System.out.println("查询评论");
|
||||||
|
return evaluateRepository.findAll();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @description: 根据电话筛选评价
|
||||||
|
* @param: phone
|
||||||
|
* @return: java.util.List<com.softegg.freetogo.Evaluate.bean.Evaluations>
|
||||||
|
* @author: zhanglinhao
|
||||||
|
* @date: 2024/5/11 16:28
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Evaluations> getEListByPhone(String phone) {
|
||||||
|
System.out.println("查询"+phone+"的评论");
|
||||||
|
return evaluateRepository.findByEditorPhone(phone);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 根据电话筛选评价
|
||||||
|
* @param: phone
|
||||||
|
* @return: java.util.List<com.softegg.freetogo.Evaluate.bean.Evaluations>
|
||||||
|
* @author: zhanglinhao
|
||||||
|
* @date: 2024/5/11 16:28
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Evaluations> getEListByPhone(String phone) {
|
||||||
|
System.out.println("查询" + phone + "的评论");
|
||||||
|
return evaluateRepository.findByEditorPhone(phone);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 添加评论
|
||||||
|
* @param: evaluation
|
||||||
|
* @return: void
|
||||||
|
* @author: zhanglinhao
|
||||||
|
* @date: 2024/5/10 21:20
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void addEvaluation(Evaluations evaluation) {
|
||||||
|
evaluateRepository.save(evaluation);
|
||||||
|
System.out.println("添加评论" + evaluation.getEbody());
|
||||||
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
/**
|
||||||
|
* @description: 编辑评论
|
||||||
|
* @param: eid
|
||||||
|
* @return: void
|
||||||
|
* @author: zhanglinhao
|
||||||
|
* @date: 2024/5/11 17:10
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void editEvaluation(int eid, String ebody) {
|
||||||
|
System.out.println("编辑评论:" + eid);
|
||||||
|
Optional<Evaluations> opt = evaluateRepository.findById(eid);
|
||||||
|
if (opt.isPresent()) {
|
||||||
|
Evaluations evaluation = opt.get();
|
||||||
|
evaluation.setEbody(ebody);
|
||||||
|
evaluateRepository.save(evaluation);
|
||||||
|
System.out.println("编辑成功:" + eid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 删除评论
|
||||||
|
* @param: eid
|
||||||
|
* @return: void
|
||||||
|
* @author: zhanglinhao
|
||||||
|
* @date: 2024/5/11 17:28
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void deleteEvaluation(int eid) {
|
||||||
|
evaluateRepository.deleteById(eid);
|
||||||
|
System.out.println("删除评论:" + eid);
|
||||||
|
}
|
||||||
|
|
||||||
|
>>>>>>> zhanglinhao_branch
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.softegg.freetogo;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
public class FreeToGoApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(FreeToGoApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,81 @@
|
|||||||
|
package com.softegg.freetogo.Login.controller;
|
||||||
|
|
||||||
|
import com.softegg.freetogo.Login.service.LoginService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:登录服务前后端交互
|
||||||
|
* @author:zhanglinhao
|
||||||
|
* @date:2024/5/9 9:35
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
//@CrossOrigin(origins = "*")
|
||||||
|
@RequestMapping("/Login")
|
||||||
|
public class LoginController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
LoginService loginService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 登录的交互逻辑
|
||||||
|
* @param: map
|
||||||
|
* @return: java.lang.String
|
||||||
|
* @author: zhanglinhao
|
||||||
|
* @date: 2024/5/9 22:44
|
||||||
|
*/
|
||||||
|
@PostMapping("login")
|
||||||
|
public int Login(@RequestBody Map<String, Object> map) {
|
||||||
|
System.out.println(map);
|
||||||
|
<<<<<<< HEAD
|
||||||
|
System.out.println("phone:"+map.get("phone").toString());
|
||||||
|
System.out.println("password"+map.get("password").toString());
|
||||||
|
int tag = loginService.loginAccount(map.get("name").toString(), map.get("password").toString());
|
||||||
|
System.out.println("LoginTag:"+tag);
|
||||||
|
=======
|
||||||
|
System.out.println("phone:" + map.get("phone").toString());
|
||||||
|
System.out.println("password" + map.get("password").toString());
|
||||||
|
int tag = loginService.loginAccount(map.get("name").toString(), map.get("password").toString());
|
||||||
|
System.out.println("LoginTag:" + tag);
|
||||||
|
>>>>>>> zhanglinhao_branch
|
||||||
|
return switch (tag) {
|
||||||
|
case 1000 -> 1;//登陆成功
|
||||||
|
case 1001 -> 2;//密码或账号错误
|
||||||
|
case 1002 -> 3;//该账户未注册
|
||||||
|
case 1005 -> 6;//未输入账号密码
|
||||||
|
case 1006 -> 7;//未输入账号
|
||||||
|
case 1007 -> 8;//未输入密码
|
||||||
|
case 1008 -> 9;//身份证输入错误
|
||||||
|
default -> 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 注册的交互逻辑
|
||||||
|
* @param: map
|
||||||
|
* @return: java.lang.String
|
||||||
|
* @author: zhanglinhao
|
||||||
|
* @date: 2024/5/9 22:45
|
||||||
|
*/
|
||||||
|
@PostMapping("register")
|
||||||
|
public int Register(@RequestBody Map<String, Object> map) {
|
||||||
|
System.out.println(map);
|
||||||
|
<<<<<<< HEAD
|
||||||
|
int tag = loginService.registerAccount((String)map.get("name"), (String)map.get("password"),(String)map.get("phone"),(String)map.get("nickname"),(String)map.get("IDCard"));
|
||||||
|
System.out.println("RegisterTag:"+tag);
|
||||||
|
=======
|
||||||
|
int tag = loginService.registerAccount((String) map.get("name"), (String) map.get("password"), (String) map.get("phone"), (String) map.get("nickname"), (String) map.get("IDCard"));
|
||||||
|
System.out.println("RegisterTag:" + tag);
|
||||||
|
>>>>>>> zhanglinhao_branch
|
||||||
|
return switch (tag) {
|
||||||
|
case 1003 -> 4;//该账户已经注册
|
||||||
|
case 1004 -> 5;//注册成功
|
||||||
|
default -> 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.softegg.freetogo.Login.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:抽象登录服务接口类
|
||||||
|
* @author:zhanglinhao
|
||||||
|
* @date:2024/5/9 8:37
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public interface LoginService {
|
||||||
|
int loginAccount(String phone, String password);//登录
|
||||||
|
// int registerAccount(String phone, String password);
|
||||||
|
|
||||||
|
int registerAccount(String name,
|
||||||
|
String password,
|
||||||
|
String phone,
|
||||||
|
String nickname,
|
||||||
|
String IDCard);//注册
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
1000->1 登录成功
|
||||||
|
1001->2 密码或账号错误
|
||||||
|
1002->3 该账户未注册
|
||||||
|
1003->4 该账户已经注册
|
||||||
|
1004->5 注册成功
|
||||||
|
1005->6 未输入账号密码
|
||||||
|
1006->7 未输入账号
|
||||||
|
1007->8 身份证输入错误
|
||||||
|
1008->9
|
@ -0,0 +1,41 @@
|
|||||||
|
package com.softegg.freetogo.SendDemand.controller;
|
||||||
|
|
||||||
|
import com.softegg.freetogo.SendDemand.service.SendDemandService;
|
||||||
|
import com.softegg.freetogo.Demand.Dao.DemandsRepository;
|
||||||
|
import com.softegg.freetogo.Demand.bean.Demands;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
/**
|
||||||
|
* @description:登录服务前后端交互
|
||||||
|
* @author:wuyifan
|
||||||
|
* @date:2024/5/10 23:09
|
||||||
|
*/
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
//@CrossOrigin(origins = "*")
|
||||||
|
@RequestMapping("/SendDemand")
|
||||||
|
public class SendDemandController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
SendDemandService sendDemandService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 发送需求的交互逻辑
|
||||||
|
* @param: map
|
||||||
|
* @return: java.lang.String
|
||||||
|
* @author: zhanglinhao
|
||||||
|
* @date: 2024/5/9 22:45
|
||||||
|
*/
|
||||||
|
@PostMapping("register")
|
||||||
|
public int SendDemand(@RequestBody Map<String, Object> map) {
|
||||||
|
return switch (sendDemandService.sendnewDemandAccount(map.get("city").toString(), map.get("phone").toString())){
|
||||||
|
case 1005 -> 1;//需求发送成功
|
||||||
|
default -> 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.softegg.freetogo.SendDemand.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:抽象需求发送服务接口类
|
||||||
|
* @author:wuyifan
|
||||||
|
* @date:2024/5/10 23:31
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public interface SendDemandService {
|
||||||
|
int sendnewDemandAccount(String city, String phone);
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.softegg.freetogo.User.Dao;
|
||||||
|
|
||||||
|
import com.softegg.freetogo.User.bean.Users;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:继承Jpa数据库接口类
|
||||||
|
* @author:zhanglinhao
|
||||||
|
* @date:2024/5/8 8:50
|
||||||
|
*/
|
||||||
|
public interface UsersRepository extends JpaRepository<Users, Integer> {
|
||||||
|
Users findByPhone(String phone);//自定义函数,根据手机号进行查找返回对应对象
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
package com.softegg.freetogo.User.bean;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:数据库中表users的对应实体类
|
||||||
|
* @author:zhanglinhao
|
||||||
|
* @date:2024/5/7 15:36
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "users")
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class Users {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Integer uid;
|
||||||
|
@Column
|
||||||
|
private String name;
|
||||||
|
@Column
|
||||||
|
private String email;
|
||||||
|
@Column
|
||||||
|
private String password;
|
||||||
|
@Column
|
||||||
|
private String createtime;
|
||||||
|
@Column
|
||||||
|
private String IDCard;
|
||||||
|
@Column
|
||||||
|
private int reputation;
|
||||||
|
@Column
|
||||||
|
private boolean gender;//ture:male, false:female
|
||||||
|
@Column
|
||||||
|
private boolean membertype;//true:guide, false:visitor
|
||||||
|
@Column
|
||||||
|
private String phone;
|
||||||
|
@Column
|
||||||
|
private String nickname;
|
||||||
|
@Column
|
||||||
|
private int status;
|
||||||
|
|
||||||
|
public Users(String name, String email, String psw, String ct, int rpt, String phone, String nkn, String idc, boolean gender, boolean type, int status) {
|
||||||
|
this.name = name;
|
||||||
|
this.email = email;
|
||||||
|
this.password = psw;
|
||||||
|
this.createtime = ct;
|
||||||
|
this.reputation = rpt;
|
||||||
|
this.phone = phone;
|
||||||
|
this.nickname = nkn;
|
||||||
|
this.IDCard = idc;
|
||||||
|
this.gender = gender;
|
||||||
|
this.membertype = type;
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.softegg.freetogo.User.service;
|
||||||
|
|
||||||
|
import com.softegg.freetogo.User.bean.Users;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:数据库操作抽象接口类
|
||||||
|
* @author:zhanglinhaon
|
||||||
|
* @date:2024/5/7 16:06
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public interface UsersService {
|
||||||
|
List<Users> findAll();//查找所有用户
|
||||||
|
|
||||||
|
void add(Users user);//以user为用户入库
|
||||||
|
|
||||||
|
void deleteById(int id);//删除对应id用户
|
||||||
|
|
||||||
|
Users getUserById(int id);//获得对应id用户
|
||||||
|
|
||||||
|
void update(Users user);//更新用户信息
|
||||||
|
|
||||||
|
boolean isRegister(String phone);//判断该手机号(账号)是否已经入库
|
||||||
|
|
||||||
|
Users getUserByPhone(String phone);//根据手机号获得用户
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
spring.application.name=FreeToGo
|
||||||
|
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||||
|
spring.datasource.url=jdbc:mysql://localhost:3306/freetogo?useSSL=false&useUnicode=true&characterEncoding=utf-8
|
||||||
|
spring.datasource.username=root
|
||||||
|
spring.datasource.password=zlh1260788704
|
@ -0,0 +1,10 @@
|
|||||||
|
spring:
|
||||||
|
jpa:
|
||||||
|
hibernate:
|
||||||
|
ddl-auto: none
|
||||||
|
show-sql: true
|
||||||
|
datasource:
|
||||||
|
username: root
|
||||||
|
password: zlh1260788704
|
||||||
|
url: dbc:mysql://localhost:3306/freetogo?useSSL=false&useUnicode=true&characterEncoding=utf-8
|
||||||
|
driverClassName: com.mysql.jdbc.Driver
|