Skip to content

Commit 37019e3

Browse files
committed
emmm
1 parent c2366c6 commit 37019e3

10 files changed

Lines changed: 47 additions & 66 deletions

File tree

fre/src/header/footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default function Footer(props) {
22
return <footer class='wrap section'>
3-
<p>© 2024 yootoo.cc <a href="https://github.com/cliclitv" class='github'>Github</a></p>
3+
<p>© 2025 fubook.net <a href="https://github.com/cliclitv" class='github'>Github</a></p>
44

55
</footer>
66
}

fre/src/login/login.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function Login() {
1717
}
1818

1919
function login() {
20-
post("https://www.yootoo.cc/user/login", { email:name, pwd }).then((res: any) => {
20+
post("https://www.fubook.net/user/login", { email:name, pwd }).then((res: any) => {
2121
console.log(res)
2222
if (res.code === 200) {
2323
window.localStorage.setItem('token', res.data)

fre/src/util/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { get, post } from './post'
2-
const host = 'https://www.yootoo.cc'
2+
export const host = 'https://www.fubook.net'
33

44
export function getPosts(tag, page, pageSize) {
55
return get(`${host}/posts?&tag=${tag}&page=${page}&size=${pageSize}`)

src/main/java/bcy/api/UserApi.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
package bcy.api;
22

3+
import java.util.List;
4+
import java.util.Map;
5+
36
import org.springframework.beans.factory.annotation.Autowired;
7+
import org.springframework.jdbc.core.JdbcTemplate;
48
import org.springframework.web.bind.annotation.RestController;
59

610
import bcy.dao.JsonResponse;
11+
import bcy.dao.Post;
712
import bcy.dao.User;
813
import bcy.service.UserService;
14+
import jakarta.annotation.Resource;
915

1016
import org.springframework.web.bind.annotation.PostMapping;
1117
import org.springframework.web.bind.annotation.RequestBody;
1218
import org.springframework.web.bind.annotation.CrossOrigin;
1319
import org.springframework.web.bind.annotation.GetMapping;
1420
import org.springframework.web.bind.annotation.PathVariable;
1521

16-
1722
@RestController
1823
@CrossOrigin(origins = "*")
1924
public class UserApi {
2025
@Autowired
2126
private UserService userService;
22-
27+
28+
@Resource
29+
private JdbcTemplate jdbcTemplate;
2330

2431
@GetMapping("/user/{id}")
2532
public JsonResponse<User> getUser(@PathVariable String id) {
@@ -40,6 +47,10 @@ public JsonResponse<String> login(@RequestBody User user) {
4047
return new JsonResponse<>(token);
4148

4249
}
43-
50+
51+
@GetMapping("users")
52+
public List<Map<String, Object>> userList() {
53+
return jdbcTemplate.queryForList("SELECT * FROM user");
54+
}
4455

4556
}

src/main/java/bcy/service/UserService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
package bcy.service;
22

3+
import java.util.List;
4+
import java.util.Map;
5+
36
import org.springframework.beans.factory.annotation.Autowired;
7+
import org.springframework.jdbc.core.JdbcTemplate;
48
import org.springframework.stereotype.Service;
9+
import org.springframework.web.bind.annotation.GetMapping;
510

611
import bcy.dao.User;
712
import bcy.dao.UserDao;
813
import bcy.service.util.ConditionException;
914
import bcy.service.util.MD5Util;
1015
import bcy.service.util.TokenUtil;
16+
import jakarta.annotation.Resource;
1117

1218
@Service
1319
public class UserService {

src/main/resources/mapper/Comment.xml

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/main/resources/mapper/Follow.xml

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/main/resources/mapper/Notice.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/main/resources/mapper/Post.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<select id="getPosts" resultType="bcy.dao.Post">
1212
select posts.id,posts.title,posts.content,posts.tag,posts.createTime,posts.updateTime,posts.pv,posts.uid,users.name,users.email,(select count(*) from
1313
follows where tid=posts.id and type="collect") as collects,(select count(*) from
14-
comments where pid=posts.id) as cv
14+
reply where pid=posts.id) as cv
1515
from posts LEFT JOIN users ON posts.uid = users.id where title != "删除"
1616
<if test="tags != null and tags.length > 0">
1717
and (1=2
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3+
4+
<mapper namespace="bcy.dao.ReplyDao">
5+
6+
7+
<select id="getReplyById" parameterType="java.lang.Long" resultType="bcy.dao.Reply">
8+
select * from reply where id = #{id}
9+
</select>
10+
11+
<insert id="addReply" parameterType="bcy.dao.Reply" >
12+
insert into reply (content, pid, uid, cid, createTime) values (#{content}, #{pid}, #{uid}, #{cid}, #{createTime})
13+
</insert>
14+
15+
<select id="getReply" resultType="bcy.dao.Reply">
16+
select * from reply LEFT JOIN users ON reply.uid = users.id where 1=1
17+
<if test="pid != null and pid != 0 ">
18+
and pid=#{pid}
19+
</if>
20+
order by createTime desc limit #{start}, #{size}
21+
</select>
22+
23+
</mapper>

0 commit comments

Comments
 (0)