mirror of
https://github.com/201206030/novel-plus.git
synced 2025-07-01 15:26:37 +00:00
Compare commits
27 Commits
release_v2
...
v3.1.0
Author | SHA1 | Date | |
---|---|---|---|
bdc81f7676 | |||
f31c86f362 | |||
45d8902429 | |||
ff9696bb7e | |||
cacebcaa33 | |||
355cb80458 | |||
a8c74d061c | |||
a713b66c1b | |||
e9d915c1fe | |||
cd3520971d | |||
dc4c9138ee | |||
f830600c3e | |||
154210719f | |||
11e744e6a8 | |||
944ef912e2 | |||
2ce51d5fc0 | |||
2f4b671d84 | |||
6ffd8d90d7 | |||
1e2b6f4103 | |||
24c7175872 | |||
a6b009cc84 | |||
04afa759a7 | |||
1be39a0f13 | |||
2fd0349a80 | |||
79fd85ab9b | |||
0b22bbb111 | |||
7f4d315f25 |
24
.gitignore
vendored
24
.gitignore
vendored
@ -1,18 +1,6 @@
|
|||||||
/.idea
|
**/logs
|
||||||
/cachedata
|
**/.idea
|
||||||
/logs
|
**/cachedata
|
||||||
/novel-common/target
|
**/target
|
||||||
/novel-front/target
|
**/*.iml
|
||||||
/novel-front/*.iml
|
|
||||||
/novel-common/*.iml
|
|
||||||
/novel-mobile/target
|
|
||||||
/novel-mobile/*.iml
|
|
||||||
/novel-front/novel-front.iml
|
|
||||||
/novel-crawl/novel-crawl.iml
|
|
||||||
/novel-crawl/target
|
|
||||||
/novel-admin/target
|
|
||||||
/*.iml
|
|
||||||
/novel-admin/*.iml
|
|
||||||
.DS_Store
|
|
||||||
/novel-admin/cachedata
|
|
||||||
/novel-admin/logs
|
|
||||||
|
@ -1,135 +0,0 @@
|
|||||||
package com.java2nb.system.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.ui.Model;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
|
|
||||||
|
|
||||||
import com.java2nb.system.domain.UserDO;
|
|
||||||
import com.java2nb.system.service.UserService;
|
|
||||||
import com.java2nb.common.utils.PageBean;
|
|
||||||
import com.java2nb.common.utils.Query;
|
|
||||||
import com.java2nb.common.utils.R;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @author xiongxy
|
|
||||||
* @email 1179705413@qq.com
|
|
||||||
* @date 2020-12-01 03:46:33
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Controller
|
|
||||||
@RequestMapping("/system/user")
|
|
||||||
public class UserController {
|
|
||||||
@Autowired
|
|
||||||
private UserService userService;
|
|
||||||
|
|
||||||
@GetMapping()
|
|
||||||
@RequiresPermissions("system:user:user")
|
|
||||||
String User() {
|
|
||||||
return "system/user/user";
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation(value = "获取列表", notes = "获取列表")
|
|
||||||
@ResponseBody
|
|
||||||
@GetMapping("/list")
|
|
||||||
@RequiresPermissions("system:user:user")
|
|
||||||
public R list(@RequestParam Map<String, Object> params) {
|
|
||||||
//查询列表数据
|
|
||||||
Query query = new Query(params);
|
|
||||||
List<UserDO> userList = userService.list(query);
|
|
||||||
int total = userService.count(query);
|
|
||||||
PageBean pageBean = new PageBean(userList, total);
|
|
||||||
return R.ok().put("data", pageBean);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation(value = "新增页面", notes = "新增页面")
|
|
||||||
@GetMapping("/add")
|
|
||||||
@RequiresPermissions("system:user:add")
|
|
||||||
String add() {
|
|
||||||
return "system/user/add";
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation(value = "修改页面", notes = "修改页面")
|
|
||||||
@GetMapping("/edit/{id}")
|
|
||||||
@RequiresPermissions("system:user:edit")
|
|
||||||
String edit(@PathVariable("id") Long id, Model model) {
|
|
||||||
UserDO user = userService.get(id);
|
|
||||||
model.addAttribute("user", user);
|
|
||||||
return "system/user/edit";
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation(value = "查看页面", notes = "查看页面")
|
|
||||||
@GetMapping("/detail/{id}")
|
|
||||||
@RequiresPermissions("system:user:detail")
|
|
||||||
String detail(@PathVariable("id") Long id, Model model) {
|
|
||||||
UserDO user = userService.get(id);
|
|
||||||
model.addAttribute("user", user);
|
|
||||||
return "system/user/detail";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "新增", notes = "新增")
|
|
||||||
@ResponseBody
|
|
||||||
@PostMapping("/save")
|
|
||||||
@RequiresPermissions("system:user:add")
|
|
||||||
public R save( UserDO user) {
|
|
||||||
if (userService.save(user) > 0) {
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
return R.error();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "修改", notes = "修改")
|
|
||||||
@ResponseBody
|
|
||||||
@RequestMapping("/update")
|
|
||||||
@RequiresPermissions("system:user:edit")
|
|
||||||
public R update( UserDO user) {
|
|
||||||
userService.update(user);
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "删除", notes = "删除")
|
|
||||||
@PostMapping("/remove")
|
|
||||||
@ResponseBody
|
|
||||||
@RequiresPermissions("system:user:remove")
|
|
||||||
public R remove( Long id) {
|
|
||||||
if (userService.remove(id) > 0) {
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
return R.error();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "批量删除", notes = "批量删除")
|
|
||||||
@PostMapping("/batchRemove")
|
|
||||||
@ResponseBody
|
|
||||||
@RequiresPermissions("system:user:batchRemove")
|
|
||||||
public R remove(@RequestParam("ids[]") Long[] ids) {
|
|
||||||
userService.batchRemove(ids);
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,177 +0,0 @@
|
|||||||
package com.java2nb.system.domain;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
|
||||||
|
|
||||||
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @author xiongxy
|
|
||||||
* @email 1179705413@qq.com
|
|
||||||
* @date 2020-12-01 03:46:33
|
|
||||||
*/
|
|
||||||
public class UserDO implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
|
|
||||||
//主键
|
|
||||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
|
||||||
//所以通过序列化成字符串来解决
|
|
||||||
@JsonSerialize(using = LongToStringSerializer.class)
|
|
||||||
private Long id;
|
|
||||||
//登录名
|
|
||||||
private String username;
|
|
||||||
//登录密码
|
|
||||||
private String password;
|
|
||||||
//昵称
|
|
||||||
private String nickName;
|
|
||||||
//用户头像
|
|
||||||
private String userPhoto;
|
|
||||||
//用户性别,0:男,1:女
|
|
||||||
private Integer userSex;
|
|
||||||
//账户余额
|
|
||||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
|
||||||
//所以通过序列化成字符串来解决
|
|
||||||
@JsonSerialize(using = LongToStringSerializer.class)
|
|
||||||
private Long accountBalance;
|
|
||||||
//用户状态,0:正常
|
|
||||||
private Integer status;
|
|
||||||
//创建时间
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date createTime;
|
|
||||||
//更新时间
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置:主键
|
|
||||||
*/
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:主键
|
|
||||||
*/
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:登录名
|
|
||||||
*/
|
|
||||||
public void setUsername(String username) {
|
|
||||||
this.username = username;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:登录名
|
|
||||||
*/
|
|
||||||
public String getUsername() {
|
|
||||||
return username;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:登录密码
|
|
||||||
*/
|
|
||||||
public void setPassword(String password) {
|
|
||||||
this.password = password;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:登录密码
|
|
||||||
*/
|
|
||||||
public String getPassword() {
|
|
||||||
return password;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:昵称
|
|
||||||
*/
|
|
||||||
public void setNickName(String nickName) {
|
|
||||||
this.nickName = nickName;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:昵称
|
|
||||||
*/
|
|
||||||
public String getNickName() {
|
|
||||||
return nickName;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:用户头像
|
|
||||||
*/
|
|
||||||
public void setUserPhoto(String userPhoto) {
|
|
||||||
this.userPhoto = userPhoto;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:用户头像
|
|
||||||
*/
|
|
||||||
public String getUserPhoto() {
|
|
||||||
return userPhoto;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:用户性别,0:男,1:女
|
|
||||||
*/
|
|
||||||
public void setUserSex(Integer userSex) {
|
|
||||||
this.userSex = userSex;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:用户性别,0:男,1:女
|
|
||||||
*/
|
|
||||||
public Integer getUserSex() {
|
|
||||||
return userSex;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:账户余额
|
|
||||||
*/
|
|
||||||
public void setAccountBalance(Long accountBalance) {
|
|
||||||
this.accountBalance = accountBalance;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:账户余额
|
|
||||||
*/
|
|
||||||
public Long getAccountBalance() {
|
|
||||||
return accountBalance;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:用户状态,0:正常
|
|
||||||
*/
|
|
||||||
public void setStatus(Integer status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:用户状态,0:正常
|
|
||||||
*/
|
|
||||||
public Integer getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:创建时间
|
|
||||||
*/
|
|
||||||
public void setCreateTime(Date createTime) {
|
|
||||||
this.createTime = createTime;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:创建时间
|
|
||||||
*/
|
|
||||||
public Date getCreateTime() {
|
|
||||||
return createTime;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:更新时间
|
|
||||||
*/
|
|
||||||
public void setUpdateTime(Date updateTime) {
|
|
||||||
this.updateTime = updateTime;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:更新时间
|
|
||||||
*/
|
|
||||||
public Date getUpdateTime() {
|
|
||||||
return updateTime;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
package com.java2nb.system.service;
|
|
||||||
|
|
||||||
import com.java2nb.system.domain.UserDO;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @author xiongxy
|
|
||||||
* @email 1179705413@qq.com
|
|
||||||
* @date 2020-12-01 03:46:33
|
|
||||||
*/
|
|
||||||
public interface UserService {
|
|
||||||
|
|
||||||
UserDO get(Long id);
|
|
||||||
|
|
||||||
List<UserDO> list(Map<String, Object> map);
|
|
||||||
|
|
||||||
int count(Map<String, Object> map);
|
|
||||||
|
|
||||||
int save(UserDO user);
|
|
||||||
|
|
||||||
int update(UserDO user);
|
|
||||||
|
|
||||||
int remove(Long id);
|
|
||||||
|
|
||||||
int batchRemove(Long[] ids);
|
|
||||||
}
|
|
@ -1,55 +0,0 @@
|
|||||||
package com.java2nb.system.service.impl;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.java2nb.system.dao.UserDao;
|
|
||||||
import com.java2nb.system.domain.UserDO;
|
|
||||||
import com.java2nb.system.service.UserService;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class UserServiceImpl implements UserService {
|
|
||||||
@Autowired
|
|
||||||
private UserDao userDao;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public UserDO get(Long id){
|
|
||||||
return userDao.get(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<UserDO> list(Map<String, Object> map){
|
|
||||||
return userDao.list(map);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int count(Map<String, Object> map){
|
|
||||||
return userDao.count(map);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int save(UserDO user){
|
|
||||||
return userDao.save(user);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int update(UserDO user){
|
|
||||||
return userDao.update(user);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int remove(Long id){
|
|
||||||
return userDao.remove(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int batchRemove(Long[] ids){
|
|
||||||
return userDao.batchRemove(ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,138 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
|
|
||||||
<mapper namespace="com.java2nb.system.dao.UserDao">
|
|
||||||
|
|
||||||
<select id="get" resultType="com.java2nb.system.domain.UserDO">
|
|
||||||
select `id`,`username`,`password`,`nick_name`,`user_photo`,`user_sex`,`account_balance`,`status`,`create_time`,`update_time` from user where id = #{value}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="list" resultType="com.java2nb.system.domain.UserDO">
|
|
||||||
select `id`,`username`,`password`,`nick_name`,`user_photo`,`user_sex`,`account_balance`,`status`,`create_time`,`update_time` from user
|
|
||||||
<where>
|
|
||||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
|
||||||
<if test="username != null and username != ''"> and username = #{username} </if>
|
|
||||||
<if test="password != null and password != ''"> and password = #{password} </if>
|
|
||||||
<if test="nickName != null and nickName != ''"> and nick_name = #{nickName} </if>
|
|
||||||
<if test="userPhoto != null and userPhoto != ''"> and user_photo = #{userPhoto} </if>
|
|
||||||
<if test="userSex != null and userSex != ''"> and user_sex = #{userSex} </if>
|
|
||||||
<if test="accountBalance != null and accountBalance != ''"> and account_balance = #{accountBalance} </if>
|
|
||||||
<if test="status != null and status != ''"> and status = #{status} </if>
|
|
||||||
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
|
||||||
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
|
||||||
</where>
|
|
||||||
<choose>
|
|
||||||
<when test="sort != null and sort.trim() != ''">
|
|
||||||
order by ${sort} ${order}
|
|
||||||
</when>
|
|
||||||
<otherwise>
|
|
||||||
order by id desc
|
|
||||||
</otherwise>
|
|
||||||
</choose>
|
|
||||||
<if test="offset != null and limit != null">
|
|
||||||
limit #{offset}, #{limit}
|
|
||||||
</if>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="count" resultType="int">
|
|
||||||
select count(*) from user
|
|
||||||
<where>
|
|
||||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
|
||||||
<if test="username != null and username != ''"> and username = #{username} </if>
|
|
||||||
<if test="password != null and password != ''"> and password = #{password} </if>
|
|
||||||
<if test="nickName != null and nickName != ''"> and nick_name = #{nickName} </if>
|
|
||||||
<if test="userPhoto != null and userPhoto != ''"> and user_photo = #{userPhoto} </if>
|
|
||||||
<if test="userSex != null and userSex != ''"> and user_sex = #{userSex} </if>
|
|
||||||
<if test="accountBalance != null and accountBalance != ''"> and account_balance = #{accountBalance} </if>
|
|
||||||
<if test="status != null and status != ''"> and status = #{status} </if>
|
|
||||||
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
|
||||||
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id="save" parameterType="com.java2nb.system.domain.UserDO">
|
|
||||||
insert into user
|
|
||||||
(
|
|
||||||
`id`,
|
|
||||||
`username`,
|
|
||||||
`password`,
|
|
||||||
`nick_name`,
|
|
||||||
`user_photo`,
|
|
||||||
`user_sex`,
|
|
||||||
`account_balance`,
|
|
||||||
`status`,
|
|
||||||
`create_time`,
|
|
||||||
`update_time`
|
|
||||||
)
|
|
||||||
values
|
|
||||||
(
|
|
||||||
#{id},
|
|
||||||
#{username},
|
|
||||||
#{password},
|
|
||||||
#{nickName},
|
|
||||||
#{userPhoto},
|
|
||||||
#{userSex},
|
|
||||||
#{accountBalance},
|
|
||||||
#{status},
|
|
||||||
#{createTime},
|
|
||||||
#{updateTime}
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<insert id="saveSelective" parameterType="com.java2nb.system.domain.UserDO">
|
|
||||||
insert into user
|
|
||||||
(
|
|
||||||
<if test="id != null"> `id`, </if>
|
|
||||||
<if test="username != null"> `username`, </if>
|
|
||||||
<if test="password != null"> `password`, </if>
|
|
||||||
<if test="nickName != null"> `nick_name`, </if>
|
|
||||||
<if test="userPhoto != null"> `user_photo`, </if>
|
|
||||||
<if test="userSex != null"> `user_sex`, </if>
|
|
||||||
<if test="accountBalance != null"> `account_balance`, </if>
|
|
||||||
<if test="status != null"> `status`, </if>
|
|
||||||
<if test="createTime != null"> `create_time`, </if>
|
|
||||||
<if test="updateTime != null"> `update_time` </if>
|
|
||||||
)
|
|
||||||
values
|
|
||||||
(
|
|
||||||
<if test="id != null"> #{id}, </if>
|
|
||||||
<if test="username != null"> #{username}, </if>
|
|
||||||
<if test="password != null"> #{password}, </if>
|
|
||||||
<if test="nickName != null"> #{nickName}, </if>
|
|
||||||
<if test="userPhoto != null"> #{userPhoto}, </if>
|
|
||||||
<if test="userSex != null"> #{userSex}, </if>
|
|
||||||
<if test="accountBalance != null"> #{accountBalance}, </if>
|
|
||||||
<if test="status != null"> #{status}, </if>
|
|
||||||
<if test="createTime != null"> #{createTime}, </if>
|
|
||||||
<if test="updateTime != null"> #{updateTime} </if>
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="update" parameterType="com.java2nb.system.domain.UserDO">
|
|
||||||
update user
|
|
||||||
<set>
|
|
||||||
<if test="username != null">`username` = #{username}, </if>
|
|
||||||
<if test="password != null">`password` = #{password}, </if>
|
|
||||||
<if test="nickName != null">`nick_name` = #{nickName}, </if>
|
|
||||||
<if test="userPhoto != null">`user_photo` = #{userPhoto}, </if>
|
|
||||||
<if test="userSex != null">`user_sex` = #{userSex}, </if>
|
|
||||||
<if test="accountBalance != null">`account_balance` = #{accountBalance}, </if>
|
|
||||||
<if test="status != null">`status` = #{status}, </if>
|
|
||||||
<if test="createTime != null">`create_time` = #{createTime}, </if>
|
|
||||||
<if test="updateTime != null">`update_time` = #{updateTime}</if>
|
|
||||||
</set>
|
|
||||||
where id = #{id}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<delete id="remove">
|
|
||||||
delete from user where id = #{value}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<delete id="batchRemove">
|
|
||||||
delete from user where id in
|
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
||||||
#{id}
|
|
||||||
</foreach>
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
</mapper>
|
|
@ -1,113 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<head th:include="include :: header"></head>
|
|
||||||
<body class="gray-bg">
|
|
||||||
<div class="wrapper wrapper-content ">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-12">
|
|
||||||
<div class="ibox float-e-margins">
|
|
||||||
<div class="ibox-content">
|
|
||||||
<form class="form-horizontal m-t" id="signupForm">
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">登录名:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input id="username" name="username"
|
|
||||||
class="form-control"
|
|
||||||
type="text">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">登录密码:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input id="password" name="password"
|
|
||||||
class="form-control"
|
|
||||||
type="text">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">昵称:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input id="nickName" name="nickName"
|
|
||||||
class="form-control"
|
|
||||||
type="text">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">用户头像:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input id="userPhoto" name="userPhoto"
|
|
||||||
class="form-control"
|
|
||||||
type="text">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">用户性别,0:男,1:女:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input id="userSex" name="userSex"
|
|
||||||
class="form-control"
|
|
||||||
type="text">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">账户余额:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input id="accountBalance" name="accountBalance"
|
|
||||||
class="form-control"
|
|
||||||
type="text">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">用户状态,0:正常:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input id="status" name="status"
|
|
||||||
class="form-control"
|
|
||||||
type="text">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">创建时间:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input type="text" class="laydate-icon layer-date form-control"
|
|
||||||
id="createTime"
|
|
||||||
name="createTime"
|
|
||||||
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
|
||||||
style="background-color: #fff;" readonly="readonly"/>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">更新时间:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input type="text" class="laydate-icon layer-date form-control"
|
|
||||||
id="updateTime"
|
|
||||||
name="updateTime"
|
|
||||||
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
|
||||||
style="background-color: #fff;" readonly="readonly"/>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="col-sm-8 col-sm-offset-3">
|
|
||||||
<button type="submit" class="btn btn-primary">提交</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div th:include="include::footer"></div>
|
|
||||||
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
|
|
||||||
<script type="text/javascript" src="/js/appjs/system/user/add.js">
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,115 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<head th:include="include :: header"></head>
|
|
||||||
<body class="gray-bg">
|
|
||||||
<div class="wrapper wrapper-content ">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-12">
|
|
||||||
<div class="ibox float-e-margins">
|
|
||||||
<div class="ibox-content">
|
|
||||||
<form class="form-horizontal m-t" id="signupForm">
|
|
||||||
<input id="id" name="id" th:value="${user.id}"
|
|
||||||
type="hidden">
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">登录名:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input id="username" name="username"
|
|
||||||
th:value="${user.username}"
|
|
||||||
class="form-control"
|
|
||||||
type="text">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">登录密码:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input id="password" name="password"
|
|
||||||
th:value="${user.password}"
|
|
||||||
class="form-control"
|
|
||||||
type="text">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">昵称:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input id="nickName" name="nickName"
|
|
||||||
th:value="${user.nickName}"
|
|
||||||
class="form-control"
|
|
||||||
type="text">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">用户头像:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input id="userPhoto" name="userPhoto"
|
|
||||||
th:value="${user.userPhoto}"
|
|
||||||
class="form-control"
|
|
||||||
type="text">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">用户性别,0:男,1:女:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input id="userSex" name="userSex"
|
|
||||||
th:value="${user.userSex}"
|
|
||||||
class="form-control"
|
|
||||||
type="text">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">账户余额:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input id="accountBalance" name="accountBalance"
|
|
||||||
th:value="${user.accountBalance}"
|
|
||||||
class="form-control"
|
|
||||||
type="text">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">用户状态,0:正常:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input id="status" name="status"
|
|
||||||
th:value="${user.status}"
|
|
||||||
class="form-control"
|
|
||||||
type="text">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">创建时间:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input type="text" class="laydate-icon layer-date form-control"
|
|
||||||
id="createTime"
|
|
||||||
name="createTime"
|
|
||||||
th:value="${user.createTime}==null?null:${#dates.format(user.createTime,'yyyy-MM-dd HH:mm:ss')}"
|
|
||||||
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
|
||||||
style="background-color: #fff;" readonly="readonly"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">更新时间:</label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<input type="text" class="laydate-icon layer-date form-control"
|
|
||||||
id="updateTime"
|
|
||||||
name="updateTime"
|
|
||||||
th:value="${user.updateTime}==null?null:${#dates.format(user.updateTime,'yyyy-MM-dd HH:mm:ss')}"
|
|
||||||
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
|
||||||
style="background-color: #fff;" readonly="readonly"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="col-sm-8 col-sm-offset-3">
|
|
||||||
<button type="submit" class="btn btn-primary">提交</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div th:include="include::footer"></div>
|
|
||||||
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
|
|
||||||
<script type="text/javascript" src="/js/appjs/system/user/edit.js">
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
43
README.md
43
README.md
@ -6,23 +6,14 @@
|
|||||||
|
|
||||||
基于小说精品屋-plus构建的Spring Cloud 微服务小说门户平台。
|
基于小说精品屋-plus构建的Spring Cloud 微服务小说门户平台。
|
||||||
|
|
||||||
Gitee仓库地址: https://gitee.com/xiongxyang/novel-cloud
|
|
||||||
|
|
||||||
GitHub仓库地址: https://github.com/201206030/novel-cloud
|
GitHub仓库地址: https://github.com/201206030/novel-cloud
|
||||||
|
|
||||||
#### 示例网站
|
Gitee仓库地址: https://gitee.com/novel_dev_team/novel-cloud
|
||||||
|
|
||||||
[网站1,点击前往](http://www.bqmfxs.cn)
|
#### 演示地址
|
||||||
|
|
||||||
[网站2,点击前往](http://iyuedu.space)
|
[点击前往](http://47.106.243.172:8888/)
|
||||||
|
|
||||||
[网站3,点击前往](http://suxiange.com)
|
|
||||||
|
|
||||||
[网站4,点击前往](http://ruoshu.com)
|
|
||||||
|
|
||||||
[网站5,点击前往](https://www.jingjiao.net)
|
|
||||||
|
|
||||||
[网站6,点击前往](http://www.shucheng.in)
|
|
||||||
|
|
||||||
#### 前言
|
#### 前言
|
||||||
|
|
||||||
@ -85,6 +76,10 @@ novel-plus -- 父工程
|
|||||||
| Layui | 前端UI
|
| Layui | 前端UI
|
||||||
|
|
||||||
|
|
||||||
|
#### 接口文档
|
||||||
|
|
||||||
|
[点击查看接口文档示例](./doc/api.md)
|
||||||
|
|
||||||
#### PC站截图
|
#### PC站截图
|
||||||
|
|
||||||
1. 首页
|
1. 首页
|
||||||
@ -143,19 +138,19 @@ novel-plus -- 父工程
|
|||||||
|
|
||||||
1. 首页
|
1. 首页
|
||||||
|
|
||||||

|
<img src="https://s3.ax1x.com/2020/12/04/DbsSoj.jpg" alt="index" style="zoom:33%;" />
|
||||||
|
|
||||||
2. 小说详情页
|
2. 小说列表页
|
||||||
|
|
||||||

|
<img src="https://s3.ax1x.com/2020/12/04/DbrfsO.jpg" alt="微信图片_20190904181558" style="zoom: 33%;" />
|
||||||
|
|
||||||
3. 目录页
|
3. 小说详情页
|
||||||
|
|
||||||

|
<img src="https://s3.ax1x.com/2020/12/04/DbsklV.jpg" alt="QQ图片20191018161901" style="zoom:33%;" />
|
||||||
|
|
||||||
4. 小说阅读页
|
4. 小说阅读页
|
||||||
|
|
||||||

|
<img src="https://s3.ax1x.com/2020/12/04/Dbsew4.jpg" alt="QQ图片20191018161901" style="zoom:33%;" />
|
||||||
|
|
||||||
#### 爬虫管理系统截图
|
#### 爬虫管理系统截图
|
||||||
|
|
||||||
@ -169,6 +164,8 @@ novel-plus -- 父工程
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
#### 安装步骤
|
#### 安装步骤
|
||||||
@ -204,14 +201,18 @@ docker安装教程:[点击前往](https://my.oschina.net/java2nb/blog/4271989)
|
|||||||
|
|
||||||
#### 代码仓库
|
#### 代码仓库
|
||||||
|
|
||||||
Gitee仓库地址: https://gitee.com/xiongxyang/novel-plus
|
|
||||||
|
|
||||||
GitHub仓库地址: https://github.com/201206030/novel-plus
|
GitHub仓库地址: https://github.com/201206030/novel-plus
|
||||||
|
|
||||||
|
Gitee仓库地址: https://gitee.com/novel_dev_team/novel-plus
|
||||||
|
|
||||||
#### QQ交流群
|
#### QQ交流群
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
#### 微信公众号(发布最新更新资讯)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
#### 赞赏支持
|
#### 赞赏支持
|
||||||
|
|
||||||
开源项目不易,若此项目能得到你的青睐,那么你可以赞赏支持作者持续开发与维护。
|
开源项目不易,若此项目能得到你的青睐,那么你可以赞赏支持作者持续开发与维护。
|
||||||
@ -227,7 +228,7 @@ docker安装教程:[点击前往](https://my.oschina.net/java2nb/blog/4271989)
|
|||||||
本项目提供的爬虫工具仅用于采集项目初期的测试数据,请勿用于商业盈利。
|
本项目提供的爬虫工具仅用于采集项目初期的测试数据,请勿用于商业盈利。
|
||||||
用户使用本系统从事任何违法违规的事情,一切后果由用户自行承担,作者不承担任何责任。
|
用户使用本系统从事任何违法违规的事情,一切后果由用户自行承担,作者不承担任何责任。
|
||||||
|
|
||||||
#### 备注
|
### 备注
|
||||||
|
|
||||||
精品小说屋所有相关项目均已在开源中国公开,感兴趣的可进入[开源中国](https://www.oschina.net/p/fiction_house)按关键字`精品小说屋`搜索。
|
精品小说屋所有相关项目均已在开源中国公开,感兴趣的可进入[开源中国](https://www.oschina.net/p/fiction_house)按关键字`精品小说屋`搜索。
|
||||||
|
|
||||||
|
116
doc/api.md
Normal file
116
doc/api.md
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
|
||||||
|
<h1 class="curproject-name"> 小说精品屋-plus </h1>
|
||||||
|
小说精品屋-plus接口
|
||||||
|
|
||||||
|
|
||||||
|
# 作家模块
|
||||||
|
|
||||||
|
## 小说章节分页列表查询接口
|
||||||
|
<a id=小说章节分页列表查询接口> </a>
|
||||||
|
### 基本信息
|
||||||
|
|
||||||
|
**Path:** /book/queryIndexList
|
||||||
|
|
||||||
|
**Method:** GET
|
||||||
|
|
||||||
|
**接口描述:**
|
||||||
|
<p>作家后台章节管理页面需要请求该接口获取小说章节分页列表信息</p>
|
||||||
|
|
||||||
|
|
||||||
|
### 请求参数
|
||||||
|
**Query**
|
||||||
|
|
||||||
|
| 参数名称 | 是否必须 | 示例 | 备注 |
|
||||||
|
| ------------ | ------------ | ------------ | ------------ |
|
||||||
|
| bookId | 是 | 1334337530296893441 | 小说ID |
|
||||||
|
| curr | 否 | 1 | 查询页码,默认1 |
|
||||||
|
| limit | 否 | 5 | 分页大小,默认5 |
|
||||||
|
|
||||||
|
### 返回数据
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead class="ant-table-thead">
|
||||||
|
<tr>
|
||||||
|
<th key=name>名称</th><th key=type>类型</th><th key=required>是否必须</th><th key=default>默认值</th><th key=desc>备注</th><th key=sub>其他信息</th>
|
||||||
|
</tr>
|
||||||
|
</thead><tbody className="ant-table-tbody"><tr key=0-0><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> code</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应状态吗,200表示成功</span></td><td key=5></td></tr><tr key=0-1><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> msg</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应信息</span></td><td key=5></td></tr><tr key=0-2><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> data</span></td><td key=1><span>object</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应数据</span></td><td key=5></td></tr><tr key=0-2-0><td key=0><span style="padding-left: 20px"><span style="color: #8c8a8a">├─</span> total</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">总数量</span></td><td key=5></td></tr><tr key=0-2-1><td key=0><span style="padding-left: 20px"><span style="color: #8c8a8a">├─</span> list</span></td><td key=1><span>object []</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">章节数据集合</span></td><td key=5><p key=3><span style="font-weight: '700'">item 类型: </span><span>object</span></p></td></tr><tr key=0-2-1-0><td key=0><span style="padding-left: 40px"><span style="color: #8c8a8a">├─</span> id</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">章节ID</span></td><td key=5></td></tr><tr key=0-2-1-1><td key=0><span style="padding-left: 40px"><span style="color: #8c8a8a">├─</span> bookId</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">小说ID</span></td><td key=5></td></tr><tr key=0-2-1-2><td key=0><span style="padding-left: 40px"><span style="color: #8c8a8a">├─</span> indexName</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">章节名</span></td><td key=5></td></tr><tr key=0-2-1-3><td key=0><span style="padding-left: 40px"><span style="color: #8c8a8a">├─</span> isVip</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">是否收费,1:收费,0:免费</span></td><td key=5></td></tr><tr key=0-2-1-4><td key=0><span style="padding-left: 40px"><span style="color: #8c8a8a">├─</span> updateTime</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">更新时间</span></td><td key=5></td></tr><tr key=0-2-2><td key=0><span style="padding-left: 20px"><span style="color: #8c8a8a">├─</span> pageNum</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">页码</span></td><td key=5></td></tr><tr key=0-2-3><td key=0><span style="padding-left: 20px"><span style="color: #8c8a8a">├─</span> pageSize</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">分页大小</span></td><td key=5></td></tr><tr key=0-2-4><td key=0><span style="padding-left: 20px"><span style="color: #8c8a8a">├─</span> size</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">当前页数量</span></td><td key=5></td></tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
## 小说章节删除接口
|
||||||
|
<a id=小说章节删除接口> </a>
|
||||||
|
### 基本信息
|
||||||
|
|
||||||
|
**Path:** /author/deleteIndex/{indexId}
|
||||||
|
|
||||||
|
**Method:** DELETE
|
||||||
|
|
||||||
|
**接口描述:**
|
||||||
|
<p>作家后台章节管理页面点击删除按钮请求该接口删除小说章节内容</p>
|
||||||
|
|
||||||
|
|
||||||
|
### 请求参数
|
||||||
|
**Headers**
|
||||||
|
|
||||||
|
| 参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
|
||||||
|
| ------------ | ------------ | ------------ | ------------ | ------------ |
|
||||||
|
| Content-Type | application/x-www-form-urlencoded | 是 | | |
|
||||||
|
| Authorization | | 是 | eyJhbGciOiJIUzUxMiJ9.eyJleHAiOjE2MDgzNDg0NzksInN1YiI6IntcImlkXCI6MTI1NTA2MDMyODMyMjAyNzUyMCxcInVzZXJuYW1lXCI6XCIxMzU2MDQyMTMyNFwiLFwibmlja05hbWVcIjpcIjEzNTYwNDIxMzI0XCJ9IiwiY3JlYXRlZCI6MTYwNzc0MzY3OTkxM30.0qhwis_zPb6t8wGNejMhDZ2iHCL9Tgh2UHd1gcQBCp8t6RW3ggSwtfo4l_RgMT_v8jOkLW91GzTVWlNnTE6LCA | 认证JWT,请求登录接口成功后返回 |
|
||||||
|
**路径参数**
|
||||||
|
|
||||||
|
| 参数名称 | 示例 | 备注 |
|
||||||
|
| ------------ | ------------ | ------------ |
|
||||||
|
| indexId | 1337603246936645632 | 章节ID |
|
||||||
|
|
||||||
|
### 返回数据
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead class="ant-table-thead">
|
||||||
|
<tr>
|
||||||
|
<th key=name>名称</th><th key=type>类型</th><th key=required>是否必须</th><th key=default>默认值</th><th key=desc>备注</th><th key=sub>其他信息</th>
|
||||||
|
</tr>
|
||||||
|
</thead><tbody className="ant-table-tbody"><tr key=0-0><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> code</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应状态吗,200表示成功</span></td><td key=5></td></tr><tr key=0-1><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> msg</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应信息</span></td><td key=5></td></tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
## 小说章节发布接口
|
||||||
|
<a id=小说章节发布接口> </a>
|
||||||
|
### 基本信息
|
||||||
|
|
||||||
|
**Path:** /author/addBookContent
|
||||||
|
|
||||||
|
**Method:** POST
|
||||||
|
|
||||||
|
**接口描述:**
|
||||||
|
<p>作家后台章节发布页面点击提交按钮请求该接口新增小说章节内容</p>
|
||||||
|
|
||||||
|
|
||||||
|
### 请求参数
|
||||||
|
**Headers**
|
||||||
|
|
||||||
|
| 参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
|
||||||
|
| ------------ | ------------ | ------------ | ------------ | ------------ |
|
||||||
|
| Content-Type | application/x-www-form-urlencoded | 是 | | |
|
||||||
|
| Authorization | | 是 | eyJhbGciOiJIUzUxMiJ9.eyJleHAiOjE2MDgzNDg0NzksInN1YiI6IntcImlkXCI6MTI1NTA2MDMyODMyMjAyNzUyMCxcInVzZXJuYW1lXCI6XCIxMzU2MDQyMTMyNFwiLFwibmlja05hbWVcIjpcIjEzNTYwNDIxMzI0XCJ9IiwiY3JlYXRlZCI6MTYwNzc0MzY3OTkxM30.0qhwis_zPb6t8wGNejMhDZ2iHCL9Tgh2UHd1gcQBCp8t6RW3ggSwtfo4l_RgMT_v8jOkLW91GzTVWlNnTE6LCA | 认证JWT,请求登录接口成功后返回 |
|
||||||
|
**Body**
|
||||||
|
|
||||||
|
| 参数名称 | 参数类型 | 是否必须 | 示例 | 备注 |
|
||||||
|
| ------------ | ------------ | ------------ | ------------ | ------------ |
|
||||||
|
| bookId | text | 是 | 1334337530296893441 | 小说ID |
|
||||||
|
| indexName | text | 是 | 第六章未婚妻(下) | 章节名 |
|
||||||
|
| content | text | 是 | 开始之时,李七夜还是生疏无比,那怕他对于刀术的所有奥义了然于胸,但是,他出刀之时依然会颤抖,无法达到妙及巅毫的要求。 | 章节内容 |
|
||||||
|
| isVip | text | 是 | 1 | 是否收费,1:收费,0:免费 |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### 返回数据
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead class="ant-table-thead">
|
||||||
|
<tr>
|
||||||
|
<th key=name>名称</th><th key=type>类型</th><th key=required>是否必须</th><th key=default>默认值</th><th key=desc>备注</th><th key=sub>其他信息</th>
|
||||||
|
</tr>
|
||||||
|
</thead><tbody className="ant-table-tbody"><tr key=0-0><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> code</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应状态吗,200表示成功</span></td><td key=5></td></tr><tr key=0-1><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> msg</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应信息</span></td><td key=5></td></tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.java2nb</groupId>
|
<groupId>com.java2nb</groupId>
|
||||||
<artifactId>novel-admin</artifactId>
|
<artifactId>novel-admin</artifactId>
|
||||||
<version>2.10.0</version>
|
<version>3.1.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>novel-admin</name>
|
<name>novel-admin</name>
|
||||||
|
@ -14,7 +14,7 @@ public class XssAndSqlHttpServletRequestWrapper extends HttpServletRequestWrappe
|
|||||||
/**
|
/**
|
||||||
* 假如有有html 代码是自己传来的 需要设定对应的name 不过滤
|
* 假如有有html 代码是自己传来的 需要设定对应的name 不过滤
|
||||||
*/
|
*/
|
||||||
private static final List<String> noFilterNames = Arrays.asList("attach","push_ip");
|
private static final List<String> noFilterNames = Arrays.asList("attach","push_ip","content");
|
||||||
|
|
||||||
public XssAndSqlHttpServletRequestWrapper(HttpServletRequest request) {
|
public XssAndSqlHttpServletRequestWrapper(HttpServletRequest request) {
|
||||||
super(request);
|
super(request);
|
||||||
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.CategoryDO;
|
||||||
|
import com.java2nb.novel.service.CategoryService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻类别表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:03:41
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/category")
|
||||||
|
public class CategoryController {
|
||||||
|
@Autowired
|
||||||
|
private CategoryService categoryService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:category:category")
|
||||||
|
String Category() {
|
||||||
|
return "novel/category/category";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取新闻类别表列表", notes = "获取新闻类别表列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:category:category")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<CategoryDO> categoryList = categoryService.list(query);
|
||||||
|
int total = categoryService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(categoryList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增新闻类别表页面", notes = "新增新闻类别表页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:category:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/category/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改新闻类别表页面", notes = "修改新闻类别表页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:category:edit")
|
||||||
|
String edit(@PathVariable("id") Integer id, Model model) {
|
||||||
|
CategoryDO category = categoryService.get(id);
|
||||||
|
model.addAttribute("category", category);
|
||||||
|
return "novel/category/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看新闻类别表页面", notes = "查看新闻类别表页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:category:detail")
|
||||||
|
String detail(@PathVariable("id") Integer id, Model model) {
|
||||||
|
CategoryDO category = categoryService.get(id);
|
||||||
|
model.addAttribute("category", category);
|
||||||
|
return "novel/category/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增新闻类别表", notes = "新增新闻类别表")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:category:add")
|
||||||
|
public R save( CategoryDO category) {
|
||||||
|
if (categoryService.save(category) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改新闻类别表", notes = "修改新闻类别表")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:category:edit")
|
||||||
|
public R update( CategoryDO category) {
|
||||||
|
categoryService.update(category);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除新闻类别表", notes = "删除新闻类别表")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:category:remove")
|
||||||
|
public R remove( Integer id) {
|
||||||
|
if (categoryService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除新闻类别表", notes = "批量删除新闻类别表")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:category:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Integer[] ids) {
|
||||||
|
categoryService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.NewsDO;
|
||||||
|
import com.java2nb.novel.service.NewsService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:05:51
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/news")
|
||||||
|
public class NewsController {
|
||||||
|
@Autowired
|
||||||
|
private NewsService newsService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:news:news")
|
||||||
|
String News() {
|
||||||
|
return "novel/news/news";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取新闻表列表", notes = "获取新闻表列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:news:news")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<NewsDO> newsList = newsService.list(query);
|
||||||
|
int total = newsService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(newsList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增新闻表页面", notes = "新增新闻表页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:news:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/news/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改新闻表页面", notes = "修改新闻表页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:news:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
NewsDO news = newsService.get(id);
|
||||||
|
model.addAttribute("news", news);
|
||||||
|
return "novel/news/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看新闻表页面", notes = "查看新闻表页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:news:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
NewsDO news = newsService.get(id);
|
||||||
|
model.addAttribute("news", news);
|
||||||
|
return "novel/news/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增新闻表", notes = "新增新闻表")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:news:add")
|
||||||
|
public R save( NewsDO news) {
|
||||||
|
if (newsService.save(news) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改新闻表", notes = "修改新闻表")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:news:edit")
|
||||||
|
public R update( NewsDO news) {
|
||||||
|
newsService.update(news);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除新闻表", notes = "删除新闻表")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:news:remove")
|
||||||
|
public R remove( Long id) {
|
||||||
|
if (newsService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除新闻表", notes = "批量删除新闻表")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:news:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
newsService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.CategoryDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻类别表
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:03:41
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface CategoryDao {
|
||||||
|
|
||||||
|
CategoryDO get(Integer id);
|
||||||
|
|
||||||
|
List<CategoryDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(CategoryDO category);
|
||||||
|
|
||||||
|
int update(CategoryDO category);
|
||||||
|
|
||||||
|
int remove(Integer id);
|
||||||
|
|
||||||
|
int batchRemove(Integer[] ids);
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
package com.java2nb.system.dao;
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
import com.java2nb.system.domain.UserDO;
|
import com.java2nb.novel.domain.NewsDO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -8,23 +8,23 @@ import java.util.Map;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* 新闻表
|
||||||
* @author xiongxy
|
* @author xiongxy
|
||||||
* @email 1179705413@qq.com
|
* @email 1179705413@qq.com
|
||||||
* @date 2020-12-01 03:46:33
|
* @date 2020-12-01 10:05:51
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface UserDao {
|
public interface NewsDao {
|
||||||
|
|
||||||
UserDO get(Long id);
|
NewsDO get(Long id);
|
||||||
|
|
||||||
List<UserDO> list(Map<String,Object> map);
|
List<NewsDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
int count(Map<String,Object> map);
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
int save(UserDO user);
|
int save(NewsDO news);
|
||||||
|
|
||||||
int update(UserDO user);
|
int update(NewsDO news);
|
||||||
|
|
||||||
int remove(Long id);
|
int remove(Long id);
|
||||||
|
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻类别表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:03:41
|
||||||
|
*/
|
||||||
|
public class CategoryDO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
private Integer id;
|
||||||
|
//分类名
|
||||||
|
private String name;
|
||||||
|
//排序
|
||||||
|
private Integer sort;
|
||||||
|
//
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long createUserId;
|
||||||
|
//
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long updateUserId;
|
||||||
|
//
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:分类名
|
||||||
|
*/
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:分类名
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:排序
|
||||||
|
*/
|
||||||
|
public void setSort(Integer sort) {
|
||||||
|
this.sort = sort;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:排序
|
||||||
|
*/
|
||||||
|
public Integer getSort() {
|
||||||
|
return sort;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:
|
||||||
|
*/
|
||||||
|
public void setCreateUserId(Long createUserId) {
|
||||||
|
this.createUserId = createUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:
|
||||||
|
*/
|
||||||
|
public Long getCreateUserId() {
|
||||||
|
return createUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:
|
||||||
|
*/
|
||||||
|
public void setUpdateUserId(Long updateUserId) {
|
||||||
|
this.updateUserId = updateUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:
|
||||||
|
*/
|
||||||
|
public Long getUpdateUserId() {
|
||||||
|
return updateUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:
|
||||||
|
*/
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:
|
||||||
|
*/
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
}
|
180
novel-admin/src/main/java/com/java2nb/novel/domain/NewsDO.java
Normal file
180
novel-admin/src/main/java/com/java2nb/novel/domain/NewsDO.java
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:05:51
|
||||||
|
*/
|
||||||
|
public class NewsDO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//类别ID
|
||||||
|
private Integer catId;
|
||||||
|
//分类名
|
||||||
|
private String catName;
|
||||||
|
//来源
|
||||||
|
private String sourceName;
|
||||||
|
//标题
|
||||||
|
private String title;
|
||||||
|
//内容
|
||||||
|
private String content;
|
||||||
|
//发布时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//发布人ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long createUserId;
|
||||||
|
//更新时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
//更新人ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long updateUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:类别ID
|
||||||
|
*/
|
||||||
|
public void setCatId(Integer catId) {
|
||||||
|
this.catId = catId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:类别ID
|
||||||
|
*/
|
||||||
|
public Integer getCatId() {
|
||||||
|
return catId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:分类名
|
||||||
|
*/
|
||||||
|
public void setCatName(String catName) {
|
||||||
|
this.catName = catName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:分类名
|
||||||
|
*/
|
||||||
|
public String getCatName() {
|
||||||
|
return catName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:来源
|
||||||
|
*/
|
||||||
|
public void setSourceName(String sourceName) {
|
||||||
|
this.sourceName = sourceName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:来源
|
||||||
|
*/
|
||||||
|
public String getSourceName() {
|
||||||
|
return sourceName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:标题
|
||||||
|
*/
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:标题
|
||||||
|
*/
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:内容
|
||||||
|
*/
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:内容
|
||||||
|
*/
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:发布时间
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:发布时间
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:发布人ID
|
||||||
|
*/
|
||||||
|
public void setCreateUserId(Long createUserId) {
|
||||||
|
this.createUserId = createUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:发布人ID
|
||||||
|
*/
|
||||||
|
public Long getCreateUserId() {
|
||||||
|
return createUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:更新时间
|
||||||
|
*/
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:更新时间
|
||||||
|
*/
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:更新人ID
|
||||||
|
*/
|
||||||
|
public void setUpdateUserId(Long updateUserId) {
|
||||||
|
this.updateUserId = updateUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:更新人ID
|
||||||
|
*/
|
||||||
|
public Long getUpdateUserId() {
|
||||||
|
return updateUserId;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.CategoryDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻类别表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:03:41
|
||||||
|
*/
|
||||||
|
public interface CategoryService {
|
||||||
|
|
||||||
|
CategoryDO get(Integer id);
|
||||||
|
|
||||||
|
List<CategoryDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(CategoryDO category);
|
||||||
|
|
||||||
|
int update(CategoryDO category);
|
||||||
|
|
||||||
|
int remove(Integer id);
|
||||||
|
|
||||||
|
int batchRemove(Integer[] ids);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.NewsDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:05:51
|
||||||
|
*/
|
||||||
|
public interface NewsService {
|
||||||
|
|
||||||
|
NewsDO get(Long id);
|
||||||
|
|
||||||
|
List<NewsDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(NewsDO news);
|
||||||
|
|
||||||
|
int update(NewsDO news);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.CategoryDao;
|
||||||
|
import com.java2nb.novel.domain.CategoryDO;
|
||||||
|
import com.java2nb.novel.service.CategoryService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CategoryServiceImpl implements CategoryService {
|
||||||
|
@Autowired
|
||||||
|
private CategoryDao categoryDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CategoryDO get(Integer id){
|
||||||
|
return categoryDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CategoryDO> list(Map<String, Object> map){
|
||||||
|
return categoryDao.list(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map){
|
||||||
|
return categoryDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(CategoryDO category){
|
||||||
|
category.setCreateTime(new Date());
|
||||||
|
return categoryDao.save(category);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(CategoryDO category){
|
||||||
|
category.setUpdateTime(new Date());
|
||||||
|
return categoryDao.update(category);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Integer id){
|
||||||
|
return categoryDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Integer[] ids){
|
||||||
|
return categoryDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.NewsDao;
|
||||||
|
import com.java2nb.novel.domain.NewsDO;
|
||||||
|
import com.java2nb.novel.service.NewsService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class NewsServiceImpl implements NewsService {
|
||||||
|
@Autowired
|
||||||
|
private NewsDao newsDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NewsDO get(Long id){
|
||||||
|
return newsDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<NewsDO> list(Map<String, Object> map){
|
||||||
|
return newsDao.list(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map){
|
||||||
|
return newsDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(NewsDO news){
|
||||||
|
news.setCreateTime(new Date());
|
||||||
|
return newsDao.save(news);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(NewsDO news){
|
||||||
|
news.setUpdateTime(new Date());
|
||||||
|
return newsDao.update(news);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Long id){
|
||||||
|
return newsDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Long[] ids){
|
||||||
|
return newsDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -138,7 +138,7 @@
|
|||||||
DATE_FORMAT( create_time, "%Y-%m-%d" ) AS staDate,
|
DATE_FORMAT( create_time, "%Y-%m-%d" ) AS staDate,
|
||||||
COUNT( 1 ) authorCount
|
COUNT( 1 ) authorCount
|
||||||
FROM
|
FROM
|
||||||
AUTHOR
|
author
|
||||||
WHERE
|
WHERE
|
||||||
create_time >= #{minDate}
|
create_time >= #{minDate}
|
||||||
GROUP BY
|
GROUP BY
|
||||||
|
@ -294,7 +294,7 @@
|
|||||||
DATE_FORMAT( create_time, "%Y-%m-%d" ) AS staDate,
|
DATE_FORMAT( create_time, "%Y-%m-%d" ) AS staDate,
|
||||||
COUNT( 1 ) bookCount
|
COUNT( 1 ) bookCount
|
||||||
FROM
|
FROM
|
||||||
BOOK
|
book
|
||||||
WHERE
|
WHERE
|
||||||
create_time >= #{minDate}
|
create_time >= #{minDate}
|
||||||
GROUP BY
|
GROUP BY
|
||||||
|
117
novel-admin/src/main/resources/mybatis/novel/CategoryMapper.xml
Normal file
117
novel-admin/src/main/resources/mybatis/novel/CategoryMapper.xml
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.java2nb.novel.dao.CategoryDao">
|
||||||
|
|
||||||
|
<select id="get" resultType="com.java2nb.novel.domain.CategoryDO">
|
||||||
|
select `id`,`name`,`sort`,`create_user_id`,`create_time`,`update_user_id`,`update_time` from news_category where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.java2nb.novel.domain.CategoryDO">
|
||||||
|
select `id`,`name`,`sort`,`create_user_id`,`create_time`,`update_user_id`,`update_time` from news_category
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="name != null and name != ''"> and name = #{name} </if>
|
||||||
|
<if test="sort != null and sort != ''"> and sort = #{sort} </if>
|
||||||
|
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="updateUserId != null and updateUserId != ''"> and update_user_id = #{updateUserId} </if>
|
||||||
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||||
|
</where>
|
||||||
|
<choose>
|
||||||
|
<when test="sort != null and sort.trim() != ''">
|
||||||
|
order by ${sort} ${order}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
order by id desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
<if test="offset != null and limit != null">
|
||||||
|
limit #{offset}, #{limit}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="count" resultType="int">
|
||||||
|
select count(*) from news_category
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="name != null and name != ''"> and name = #{name} </if>
|
||||||
|
<if test="sort != null and sort != ''"> and sort = #{sort} </if>
|
||||||
|
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="updateUserId != null and updateUserId != ''"> and update_user_id = #{updateUserId} </if>
|
||||||
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="com.java2nb.novel.domain.CategoryDO">
|
||||||
|
insert into news_category
|
||||||
|
(
|
||||||
|
`id`,
|
||||||
|
`name`,
|
||||||
|
`sort`,
|
||||||
|
`create_user_id`,
|
||||||
|
`create_time`,
|
||||||
|
`update_user_id`,
|
||||||
|
`update_time`
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
#{id},
|
||||||
|
#{name},
|
||||||
|
#{sort},
|
||||||
|
#{createUserId},
|
||||||
|
#{createTime},
|
||||||
|
#{updateUserId},
|
||||||
|
#{updateTime}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.CategoryDO">
|
||||||
|
insert into news_category
|
||||||
|
(
|
||||||
|
<if test="id != null"> `id`, </if>
|
||||||
|
<if test="name != null"> `name`, </if>
|
||||||
|
<if test="sort != null"> `sort`, </if>
|
||||||
|
<if test="createUserId != null"> `create_user_id`, </if>
|
||||||
|
<if test="createTime != null"> `create_time`, </if>
|
||||||
|
<if test="updateUserId != null"> `update_user_id`, </if>
|
||||||
|
<if test="updateTime != null"> `update_time` </if>
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
<if test="id != null"> #{id}, </if>
|
||||||
|
<if test="name != null"> #{name}, </if>
|
||||||
|
<if test="sort != null"> #{sort}, </if>
|
||||||
|
<if test="createUserId != null"> #{createUserId}, </if>
|
||||||
|
<if test="createTime != null"> #{createTime}, </if>
|
||||||
|
<if test="updateUserId != null"> #{updateUserId}, </if>
|
||||||
|
<if test="updateTime != null"> #{updateTime} </if>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.java2nb.novel.domain.CategoryDO">
|
||||||
|
update news_category
|
||||||
|
<set>
|
||||||
|
<if test="name != null">`name` = #{name}, </if>
|
||||||
|
<if test="sort != null">`sort` = #{sort}, </if>
|
||||||
|
<if test="createUserId != null">`create_user_id` = #{createUserId}, </if>
|
||||||
|
<if test="createTime != null">`create_time` = #{createTime}, </if>
|
||||||
|
<if test="updateUserId != null">`update_user_id` = #{updateUserId}, </if>
|
||||||
|
<if test="updateTime != null">`update_time` = #{updateTime}</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="remove">
|
||||||
|
delete from news_category where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="batchRemove">
|
||||||
|
delete from news_category where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
138
novel-admin/src/main/resources/mybatis/novel/NewsMapper.xml
Normal file
138
novel-admin/src/main/resources/mybatis/novel/NewsMapper.xml
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.java2nb.novel.dao.NewsDao">
|
||||||
|
|
||||||
|
<select id="get" resultType="com.java2nb.novel.domain.NewsDO">
|
||||||
|
select `id`,`cat_id`,`cat_name`,`source_name`,`title`,`content`,`create_time`,`create_user_id`,`update_time`,`update_user_id` from news where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.java2nb.novel.domain.NewsDO">
|
||||||
|
select `id`,`cat_id`,`cat_name`,`source_name`,`title`,`content`,`create_time`,`create_user_id`,`update_time`,`update_user_id` from news
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="catId != null and catId != ''"> and cat_id = #{catId} </if>
|
||||||
|
<if test="catName != null and catName != ''"> and cat_name = #{catName} </if>
|
||||||
|
<if test="sourceName != null and sourceName != ''"> and source_name = #{sourceName} </if>
|
||||||
|
<if test="title != null and title != ''"> and title like concat('%',#{title},'%') </if>
|
||||||
|
<if test="content != null and content != ''"> and content = #{content} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
|
||||||
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||||
|
<if test="updateUserId != null and updateUserId != ''"> and update_user_id = #{updateUserId} </if>
|
||||||
|
</where>
|
||||||
|
<choose>
|
||||||
|
<when test="sort != null and sort.trim() != ''">
|
||||||
|
order by ${sort} ${order}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
order by id desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
<if test="offset != null and limit != null">
|
||||||
|
limit #{offset}, #{limit}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="count" resultType="int">
|
||||||
|
select count(*) from news
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="catId != null and catId != ''"> and cat_id = #{catId} </if>
|
||||||
|
<if test="catName != null and catName != ''"> and cat_name = #{catName} </if>
|
||||||
|
<if test="sourceName != null and sourceName != ''"> and source_name = #{sourceName} </if>
|
||||||
|
<if test="title != null and title != ''"> and title = #{title} </if>
|
||||||
|
<if test="content != null and content != ''"> and content = #{content} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
|
||||||
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||||
|
<if test="updateUserId != null and updateUserId != ''"> and update_user_id = #{updateUserId} </if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="com.java2nb.novel.domain.NewsDO">
|
||||||
|
insert into news
|
||||||
|
(
|
||||||
|
`id`,
|
||||||
|
`cat_id`,
|
||||||
|
`cat_name`,
|
||||||
|
`source_name`,
|
||||||
|
`title`,
|
||||||
|
`content`,
|
||||||
|
`create_time`,
|
||||||
|
`create_user_id`,
|
||||||
|
`update_time`,
|
||||||
|
`update_user_id`
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
#{id},
|
||||||
|
#{catId},
|
||||||
|
#{catName},
|
||||||
|
#{sourceName},
|
||||||
|
#{title},
|
||||||
|
#{content},
|
||||||
|
#{createTime},
|
||||||
|
#{createUserId},
|
||||||
|
#{updateTime},
|
||||||
|
#{updateUserId}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.NewsDO">
|
||||||
|
insert into news
|
||||||
|
(
|
||||||
|
<if test="id != null"> `id`, </if>
|
||||||
|
<if test="catId != null"> `cat_id`, </if>
|
||||||
|
<if test="catName != null"> `cat_name`, </if>
|
||||||
|
<if test="sourceName != null"> `source_name`, </if>
|
||||||
|
<if test="title != null"> `title`, </if>
|
||||||
|
<if test="content != null"> `content`, </if>
|
||||||
|
<if test="createTime != null"> `create_time`, </if>
|
||||||
|
<if test="createUserId != null"> `create_user_id`, </if>
|
||||||
|
<if test="updateTime != null"> `update_time`, </if>
|
||||||
|
<if test="updateUserId != null"> `update_user_id` </if>
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
<if test="id != null"> #{id}, </if>
|
||||||
|
<if test="catId != null"> #{catId}, </if>
|
||||||
|
<if test="catName != null"> #{catName}, </if>
|
||||||
|
<if test="sourceName != null"> #{sourceName}, </if>
|
||||||
|
<if test="title != null"> #{title}, </if>
|
||||||
|
<if test="content != null"> #{content}, </if>
|
||||||
|
<if test="createTime != null"> #{createTime}, </if>
|
||||||
|
<if test="createUserId != null"> #{createUserId}, </if>
|
||||||
|
<if test="updateTime != null"> #{updateTime}, </if>
|
||||||
|
<if test="updateUserId != null"> #{updateUserId} </if>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.java2nb.novel.domain.NewsDO">
|
||||||
|
update news
|
||||||
|
<set>
|
||||||
|
<if test="catId != null">`cat_id` = #{catId}, </if>
|
||||||
|
<if test="catName != null">`cat_name` = #{catName}, </if>
|
||||||
|
<if test="sourceName != null">`source_name` = #{sourceName}, </if>
|
||||||
|
<if test="title != null">`title` = #{title}, </if>
|
||||||
|
<if test="content != null">`content` = #{content}, </if>
|
||||||
|
<if test="createTime != null">`create_time` = #{createTime}, </if>
|
||||||
|
<if test="createUserId != null">`create_user_id` = #{createUserId}, </if>
|
||||||
|
<if test="updateTime != null">`update_time` = #{updateTime}, </if>
|
||||||
|
<if test="updateUserId != null">`update_user_id` = #{updateUserId}</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="remove">
|
||||||
|
delete from news where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="batchRemove">
|
||||||
|
delete from news where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
@ -142,7 +142,7 @@
|
|||||||
DATE_FORMAT( create_time, "%Y-%m-%d" ) AS staDate,
|
DATE_FORMAT( create_time, "%Y-%m-%d" ) AS staDate,
|
||||||
COUNT( 1 ) userCount
|
COUNT( 1 ) userCount
|
||||||
FROM
|
FROM
|
||||||
USER
|
user
|
||||||
WHERE
|
WHERE
|
||||||
create_time >= #{minDate}
|
create_time >= #{minDate}
|
||||||
GROUP BY
|
GROUP BY
|
||||||
|
@ -74,7 +74,7 @@ function save() {
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
cache: true,
|
cache: true,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/system/user/save",
|
url: "/novel/category/save",
|
||||||
data: $('#signupForm').serialize(),// 你的formid
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
async: false,
|
async: false,
|
||||||
error: function (request) {
|
error: function (request) {
|
||||||
@ -100,8 +100,12 @@ function validateRule() {
|
|||||||
$("#signupForm").validate({
|
$("#signupForm").validate({
|
||||||
ignore: "",
|
ignore: "",
|
||||||
rules: {
|
rules: {
|
||||||
},
|
name: {
|
||||||
|
required: true
|
||||||
|
}, },
|
||||||
messages: {
|
messages: {
|
||||||
}
|
name: {
|
||||||
|
required: icon + "请选择分类名"
|
||||||
|
}, }
|
||||||
})
|
})
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
var prefix = "/system/user"
|
var prefix = "/novel/category"
|
||||||
$(function () {
|
$(function () {
|
||||||
load();
|
load();
|
||||||
});
|
});
|
||||||
@ -59,67 +59,23 @@ function load() {
|
|||||||
return arguments[2] + 1;
|
return arguments[2] + 1;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
field: 'id',
|
|
||||||
title: '主键'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'username',
|
|
||||||
title: '登录名'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
{
|
||||||
{
|
field: 'name',
|
||||||
field: 'password',
|
title: '分类名'
|
||||||
title: '登录密码'
|
},
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'nickName',
|
|
||||||
title: '昵称'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
{
|
||||||
{
|
field: 'sort',
|
||||||
field: 'userPhoto',
|
title: '排序'
|
||||||
title: '用户头像'
|
},
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'userSex',
|
|
||||||
title: '用户性别,0:男,1:女'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'accountBalance',
|
|
||||||
title: '账户余额'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'status',
|
|
||||||
title: '用户状态,0:正常'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
{
|
||||||
{
|
|
||||||
field: 'createTime',
|
|
||||||
title: '创建时间'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'updateTime',
|
|
||||||
title: '更新时间'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
title: '操作',
|
title: '操作',
|
||||||
field: 'id',
|
field: 'id',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
@ -133,14 +89,16 @@ function load() {
|
|||||||
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
|
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
|
||||||
+ row.id
|
+ row.id
|
||||||
+ '\')"><i class="fa fa-remove"></i></a> ';
|
+ '\')"><i class="fa fa-remove"></i></a> ';
|
||||||
return d + e + r;
|
return e + r;
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function reLoad() {
|
function reLoad() {
|
||||||
$('#exampleTable').bootstrapTable('refresh');
|
$('#exampleTable').bootstrapTable('refresh');
|
||||||
}
|
}
|
||||||
|
|
||||||
function add() {
|
function add() {
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
@ -151,6 +109,7 @@ function add() {
|
|||||||
content: prefix + '/add' // iframe的url
|
content: prefix + '/add' // iframe的url
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function detail(id) {
|
function detail(id) {
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
@ -161,6 +120,7 @@ function detail(id) {
|
|||||||
content: prefix + '/detail/' + id // iframe的url
|
content: prefix + '/detail/' + id // iframe的url
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function edit(id) {
|
function edit(id) {
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
@ -171,6 +131,7 @@ function edit(id) {
|
|||||||
content: prefix + '/edit/' + id // iframe的url
|
content: prefix + '/edit/' + id // iframe的url
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove(id) {
|
function remove(id) {
|
||||||
layer.confirm('确定要删除选中的记录?', {
|
layer.confirm('确定要删除选中的记录?', {
|
||||||
btn: ['确定', '取消']
|
btn: ['确定', '取消']
|
||||||
@ -195,6 +156,7 @@ function remove(id) {
|
|||||||
|
|
||||||
function resetPwd(id) {
|
function resetPwd(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function batchRemove() {
|
function batchRemove() {
|
||||||
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
||||||
if (rows.length == 0) {
|
if (rows.length == 0) {
|
@ -70,7 +70,7 @@ function update() {
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
cache: true,
|
cache: true,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/system/user/update",
|
url: "/novel/category/update",
|
||||||
data: $('#signupForm').serialize(),// 你的formid
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
async: false,
|
async: false,
|
||||||
error: function (request) {
|
error: function (request) {
|
||||||
@ -96,8 +96,14 @@ function validateRule() {
|
|||||||
$("#signupForm").validate({
|
$("#signupForm").validate({
|
||||||
ignore: "",
|
ignore: "",
|
||||||
rules: {
|
rules: {
|
||||||
},
|
name:
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
}, },
|
||||||
messages: {
|
messages: {
|
||||||
}
|
name:
|
||||||
|
{
|
||||||
|
required: icon + "请选择分类名"
|
||||||
|
}, }
|
||||||
})
|
})
|
||||||
}
|
}
|
123
novel-admin/src/main/resources/static/js/appjs/novel/news/add.js
Normal file
123
novel-admin/src/main/resources/static/js/appjs/novel/news/add.js
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function save() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/news/save",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
parent.reLoad();
|
||||||
|
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
|
||||||
|
parent.layer.close(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {
|
||||||
|
catId: {
|
||||||
|
required: true
|
||||||
|
}, catName: {
|
||||||
|
required: true
|
||||||
|
}, title: {
|
||||||
|
required: true
|
||||||
|
}, content: {
|
||||||
|
required: true
|
||||||
|
}, },
|
||||||
|
messages: {
|
||||||
|
catId: {
|
||||||
|
required: icon + "请选择类别ID"
|
||||||
|
}, catName: {
|
||||||
|
required: icon + "请选择分类名"
|
||||||
|
}, title: {
|
||||||
|
required: icon + "请选择标题"
|
||||||
|
}, content: {
|
||||||
|
required: icon + "请选择内容"
|
||||||
|
}, }
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,127 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
editor.txt.html($("#" + relName).val());
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function update() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/news/update",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
parent.reLoad();
|
||||||
|
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
|
||||||
|
parent.layer.close(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {
|
||||||
|
catId:
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
}, catName:
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
}, title:
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
}, content:
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
}, },
|
||||||
|
messages: {
|
||||||
|
catId:
|
||||||
|
{
|
||||||
|
required: icon + "请选择类别ID"
|
||||||
|
}, catName:
|
||||||
|
{
|
||||||
|
required: icon + "请选择分类名"
|
||||||
|
}, title:
|
||||||
|
{
|
||||||
|
required: icon + "请选择标题"
|
||||||
|
}, content:
|
||||||
|
{
|
||||||
|
required: icon + "请选择内容"
|
||||||
|
}, }
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,206 @@
|
|||||||
|
var prefix = "/novel/news"
|
||||||
|
$(function () {
|
||||||
|
load();
|
||||||
|
});
|
||||||
|
|
||||||
|
function load() {
|
||||||
|
$('#exampleTable')
|
||||||
|
.bootstrapTable(
|
||||||
|
{
|
||||||
|
method: 'get', // 服务器数据的请求方式 get or post
|
||||||
|
url: prefix + "/list", // 服务器数据的加载地址
|
||||||
|
// showRefresh : true,
|
||||||
|
// showToggle : true,
|
||||||
|
// showColumns : true,
|
||||||
|
iconSize: 'outline',
|
||||||
|
toolbar: '#exampleToolbar',
|
||||||
|
striped: true, // 设置为true会有隔行变色效果
|
||||||
|
dataType: "json", // 服务器返回的数据类型
|
||||||
|
pagination: true, // 设置为true会在底部显示分页条
|
||||||
|
// queryParamsType : "limit",
|
||||||
|
// //设置为limit则会发送符合RESTFull格式的参数
|
||||||
|
singleSelect: false, // 设置为true将禁止多选
|
||||||
|
// contentType : "application/x-www-form-urlencoded",
|
||||||
|
// //发送到服务器的数据编码类型
|
||||||
|
pageSize: 10, // 如果设置了分页,每页数据条数
|
||||||
|
pageNumber: 1, // 如果设置了分布,首页页码
|
||||||
|
//search : true, // 是否显示搜索框
|
||||||
|
showColumns: false, // 是否显示内容下拉框(选择显示的列)
|
||||||
|
sidePagination: "server", // 设置在哪里进行分页,可选值为"client" 或者 "server"
|
||||||
|
queryParams: function (params) {
|
||||||
|
//说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对
|
||||||
|
var queryParams = getFormJson("searchForm");
|
||||||
|
queryParams.limit = params.limit;
|
||||||
|
queryParams.offset = params.offset;
|
||||||
|
return queryParams;
|
||||||
|
},
|
||||||
|
// //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
|
||||||
|
// queryParamsType = 'limit' ,返回参数必须包含
|
||||||
|
// limit, offset, search, sort, order 否则, 需要包含:
|
||||||
|
// pageSize, pageNumber, searchText, sortName,
|
||||||
|
// sortOrder.
|
||||||
|
// 返回false将会终止请求
|
||||||
|
responseHandler: function (rs) {
|
||||||
|
|
||||||
|
if (rs.code == 0) {
|
||||||
|
return rs.data;
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(rs.msg)
|
||||||
|
return {total: 0, rows: []};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
formatter: function () {
|
||||||
|
return arguments[2] + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'catName',
|
||||||
|
title: '分类名'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'sourceName',
|
||||||
|
title: '来源'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'title',
|
||||||
|
title: '标题'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '发布时间'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
field: 'id',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-file"></i></a> ';
|
||||||
|
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-edit"></i></a> ';
|
||||||
|
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-remove"></i></a> ';
|
||||||
|
return e + r;
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function reLoad() {
|
||||||
|
$('#exampleTable').bootstrapTable('refresh');
|
||||||
|
}
|
||||||
|
|
||||||
|
function add() {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '增加',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/add' // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function detail(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '详情',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/detail/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function edit(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '编辑',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/edit/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function remove(id) {
|
||||||
|
layer.confirm('确定要删除选中的记录?', {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
}, function () {
|
||||||
|
$.ajax({
|
||||||
|
url: prefix + "/remove",
|
||||||
|
type: "post",
|
||||||
|
data: {
|
||||||
|
'id': id
|
||||||
|
},
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetPwd(id) {
|
||||||
|
}
|
||||||
|
|
||||||
|
function batchRemove() {
|
||||||
|
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
||||||
|
if (rows.length == 0) {
|
||||||
|
layer.msg("请选择要删除的数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
layer.confirm("确认要删除选中的'" + rows.length + "'条数据吗?", {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
// 按钮
|
||||||
|
}, function () {
|
||||||
|
var ids = new Array();
|
||||||
|
// 遍历所有选择的行数据,取每条数据对应的ID
|
||||||
|
$.each(rows, function (i, row) {
|
||||||
|
ids[i] = row['id'];
|
||||||
|
});
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
"ids": ids
|
||||||
|
},
|
||||||
|
url: prefix + '/batchRemove',
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
-- 菜单SQL
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES ('1', '新闻类别表', 'novel/category', 'novel:category:category', '1', 'fa', '6');
|
||||||
|
|
||||||
|
-- 按钮父菜单ID
|
||||||
|
set @parentId = @@identity;
|
||||||
|
|
||||||
|
-- 菜单对应按钮SQL
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '查看', null, 'novel:category:detail', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '新增', null, 'novel:category:add', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '修改', null, 'novel:category:edit', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '删除', null, 'novel:category:remove', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '批量删除', null, 'novel:category:batchRemove', '2', null, '6';
|
@ -1,18 +1,18 @@
|
|||||||
-- 菜单SQL
|
-- 菜单SQL
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
VALUES ('1', '', 'system/user', 'system:user:user', '1', 'fa', '6');
|
VALUES ('1', '新闻表', 'novel/news', 'novel:news:news', '1', 'fa', '6');
|
||||||
|
|
||||||
-- 按钮父菜单ID
|
-- 按钮父菜单ID
|
||||||
set @parentId = @@identity;
|
set @parentId = @@identity;
|
||||||
|
|
||||||
-- 菜单对应按钮SQL
|
-- 菜单对应按钮SQL
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
SELECT @parentId, '查看', null, 'system:user:detail', '2', null, '6';
|
SELECT @parentId, '查看', null, 'novel:news:detail', '2', null, '6';
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
SELECT @parentId, '新增', null, 'system:user:add', '2', null, '6';
|
SELECT @parentId, '新增', null, 'novel:news:add', '2', null, '6';
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
SELECT @parentId, '修改', null, 'system:user:edit', '2', null, '6';
|
SELECT @parentId, '修改', null, 'novel:news:edit', '2', null, '6';
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
SELECT @parentId, '删除', null, 'system:user:remove', '2', null, '6';
|
SELECT @parentId, '删除', null, 'novel:news:remove', '2', null, '6';
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
SELECT @parentId, '批量删除', null, 'system:user:batchRemove', '2', null, '6';
|
SELECT @parentId, '批量删除', null, 'novel:news:batchRemove', '2', null, '6';
|
@ -0,0 +1,46 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<head th:include="include :: header"></head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="wrapper wrapper-content ">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-content">
|
||||||
|
<form class="form-horizontal m-t" id="signupForm">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">分类名:</label>
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<input id="name" name="name"
|
||||||
|
class="form-control"
|
||||||
|
type="text" maxlength="10">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">排序:</label>
|
||||||
|
<div class="col-sm-2">
|
||||||
|
<input id="sort" name="sort"
|
||||||
|
class="form-control"
|
||||||
|
type="number" maxlength="2">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-sm-8 col-sm-offset-3">
|
||||||
|
<button type="submit" class="btn btn-primary">提交</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div th:include="include::footer"></div>
|
||||||
|
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
|
||||||
|
<script type="text/javascript" src="/js/appjs/novel/category/add.js">
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,57 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<head th:include="include :: header"></head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="wrapper wrapper-content ">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="ibox">
|
||||||
|
<div class="ibox-body">
|
||||||
|
<div class="fixed-table-toolbar">
|
||||||
|
<div class="columns pull-left">
|
||||||
|
<button shiro:hasPermission="novel:category:add" type="button"
|
||||||
|
class="btn btn-primary" onclick="add()">
|
||||||
|
<i class="fa fa-plus" aria-hidden="true"></i>添加
|
||||||
|
</button>
|
||||||
|
<button shiro:hasPermission="novel:category:batchRemove" type="button"
|
||||||
|
class="btn btn-danger"
|
||||||
|
onclick="batchRemove()">
|
||||||
|
<i class="fa fa-trash" aria-hidden="true"></i>删除
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<table id="exampleTable" data-mobile-responsive="true">
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--shiro控制bootstraptable行内按钮看见性 -->
|
||||||
|
<div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var s_detail_h = 'hidden';
|
||||||
|
var s_edit_h = 'hidden';
|
||||||
|
var s_remove_h = 'hidden';
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<div shiro:hasPermission="test:order:detail">
|
||||||
|
<script type="text/javascript">
|
||||||
|
s_detail_h = '';
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<div shiro:hasPermission="novel:category:edit">
|
||||||
|
<script type="text/javascript">
|
||||||
|
s_edit_h = '';
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<div shiro:hasPermission="novel:category:remove">
|
||||||
|
<script type="text/javascript">
|
||||||
|
var s_remove_h = '';
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<div th:include="include :: footer"></div>
|
||||||
|
<script type="text/javascript" src="/js/appjs/novel/category/category.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,80 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<head th:include="include :: header"></head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="wrapper wrapper-content ">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-content">
|
||||||
|
<form class="form-horizontal m-t" id="signupForm">
|
||||||
|
<input id="id" name="id" th:value="${category.id}"
|
||||||
|
type="hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">分类名:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${category.name}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">排序:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${category.sort}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${category.createUserId}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${category.createTime}==null?null:${#dates.format(category.createTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${category.updateUserId}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${category.updateTime}==null?null:${#dates.format(category.updateTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div th:include="include::footer"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,48 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<head th:include="include :: header"></head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="wrapper wrapper-content ">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-content">
|
||||||
|
<form class="form-horizontal m-t" id="signupForm">
|
||||||
|
<input id="id" name="id" th:value="${category.id}"
|
||||||
|
type="hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">分类名:</label>
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<input id="name" name="name"
|
||||||
|
th:value="${category.name}"
|
||||||
|
class="form-control"
|
||||||
|
type="text" maxlength="10">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">排序:</label>
|
||||||
|
<div class="col-sm-2">
|
||||||
|
<input id="sort" name="sort"
|
||||||
|
th:value="${category.sort}"
|
||||||
|
class="form-control"
|
||||||
|
type="number" maxlength="2">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-sm-8 col-sm-offset-3">
|
||||||
|
<button type="submit" class="btn btn-primary">提交</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div th:include="include::footer"></div>
|
||||||
|
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
|
||||||
|
<script type="text/javascript" src="/js/appjs/novel/category/edit.js">
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
105
novel-admin/src/main/resources/templates/novel/news/add.html
Normal file
105
novel-admin/src/main/resources/templates/novel/news/add.html
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<head th:include="include :: header"></head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="wrapper wrapper-content ">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-content">
|
||||||
|
<form class="form-horizontal m-t" id="signupForm">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">类别:</label>
|
||||||
|
<div class="col-sm-3">
|
||||||
|
|
||||||
|
<select data-placeholder="--选择--" id="catId"
|
||||||
|
name="catId"
|
||||||
|
class="form-control chosen-select" tabindex="2"
|
||||||
|
>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input type="hidden" id="catName" name="catName"/>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">来源:</label>
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<input id="sourceName" name="sourceName"
|
||||||
|
class="form-control"
|
||||||
|
type="text" maxlength="10">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">标题:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="title" name="title"
|
||||||
|
class="form-control"
|
||||||
|
type="text" maxlength="30">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">内容:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input type="hidden" id="content" name="content"/>
|
||||||
|
<div id="contentEditorcontent">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-sm-8 col-sm-offset-3">
|
||||||
|
<button type="submit" class="btn btn-primary">提交</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div th:include="include::footer"></div>
|
||||||
|
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
|
||||||
|
<script type="text/javascript" src="/js/appjs/novel/news/add.js">
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: "/novel/category/list",
|
||||||
|
data: {limit:100,offset:0},
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
var list = r.data.rows;
|
||||||
|
var catHtml = "<option>请选择</option>";
|
||||||
|
for(var i = 0 ; i < list.length ; i++){
|
||||||
|
var cat = list[i];
|
||||||
|
catHtml += ("<option value='"+cat.id+"'>"+cat.name+"</option>");
|
||||||
|
|
||||||
|
}
|
||||||
|
$("#catId").html(catHtml);
|
||||||
|
$("#catId").change(function(){
|
||||||
|
var catName = $(this).find("option:selected").text();
|
||||||
|
if(catName != '请选择'){
|
||||||
|
|
||||||
|
$("#catName").val(catName);
|
||||||
|
}else{
|
||||||
|
$("#catName").val('');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -9,95 +9,93 @@
|
|||||||
<div class="ibox float-e-margins">
|
<div class="ibox float-e-margins">
|
||||||
<div class="ibox-content">
|
<div class="ibox-content">
|
||||||
<form class="form-horizontal m-t" id="signupForm">
|
<form class="form-horizontal m-t" id="signupForm">
|
||||||
<input id="id" name="id" th:value="${user.id}"
|
<input id="id" name="id" th:value="${news.id}"
|
||||||
type="hidden">
|
type="hidden">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">登录名:</label>
|
<label class="col-sm-3 control-label">类别ID:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8 dict-type" dict-type="${column.dictType}"
|
||||||
|
th:attr="dict-value=${news.catId}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">分类名:</label>
|
||||||
|
|
||||||
<div style="padding-top:8px" class="col-sm-8"
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
th:text="${user.username}">
|
th:text="${news.catName}">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">登录密码:</label>
|
<label class="col-sm-3 control-label">来源:</label>
|
||||||
|
|
||||||
<div style="padding-top:8px" class="col-sm-8"
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
th:text="${user.password}">
|
th:text="${news.sourceName}">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">昵称:</label>
|
<label class="col-sm-3 control-label">标题:</label>
|
||||||
|
|
||||||
<div style="padding-top:8px" class="col-sm-8"
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
th:text="${user.nickName}">
|
th:text="${news.title}">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">用户头像:</label>
|
<label class="col-sm-3 control-label">内容:</label>
|
||||||
|
|
||||||
<div style="padding-top:8px" class="col-sm-8"
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
th:text="${user.userPhoto}">
|
th:utext="${news.content}"></div>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">用户性别,0:男,1:女:</label>
|
<label class="col-sm-3 control-label">发布时间:</label>
|
||||||
|
|
||||||
<div style="padding-top:8px" class="col-sm-8"
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
th:text="${user.userSex}">
|
th:text="${news.createTime}==null?null:${#dates.format(news.createTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">账户余额:</label>
|
<label class="col-sm-3 control-label">发布人ID:</label>
|
||||||
|
|
||||||
<div style="padding-top:8px" class="col-sm-8"
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
th:text="${user.accountBalance}">
|
th:text="${news.createUserId}">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">用户状态,0:正常:</label>
|
|
||||||
|
|
||||||
<div style="padding-top:8px" class="col-sm-8"
|
|
||||||
th:text="${user.status}">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">创建时间:</label>
|
|
||||||
|
|
||||||
<div style="padding-top:8px" class="col-sm-8"
|
|
||||||
th:text="${user.createTime}==null?null:${#dates.format(user.createTime,'yyyy-MM-dd HH:mm:ss')}">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">更新时间:</label>
|
<label class="col-sm-3 control-label">更新时间:</label>
|
||||||
|
|
||||||
<div style="padding-top:8px" class="col-sm-8"
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
th:text="${user.updateTime}==null?null:${#dates.format(user.updateTime,'yyyy-MM-dd HH:mm:ss')}">
|
th:text="${news.updateTime}==null?null:${#dates.format(news.updateTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">更新人ID:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${news.updateUserId}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
109
novel-admin/src/main/resources/templates/novel/news/edit.html
Normal file
109
novel-admin/src/main/resources/templates/novel/news/edit.html
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<head th:include="include :: header"></head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="wrapper wrapper-content ">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-content">
|
||||||
|
<form class="form-horizontal m-t" id="signupForm">
|
||||||
|
<input id="id" name="id" th:value="${news.id}"
|
||||||
|
type="hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">类别:</label>
|
||||||
|
<div class="col-sm-3">
|
||||||
|
|
||||||
|
<select data-placeholder="--选择--" id="catId"
|
||||||
|
name="catId"
|
||||||
|
class="form-control chosen-select" tabindex="2"
|
||||||
|
|
||||||
|
th:value="${news.catId}">
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input type="hidden" id="catName" name="catName" th:value="${news.catName}"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">来源:</label>
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<input id="sourceName" name="sourceName"
|
||||||
|
th:value="${news.sourceName}"
|
||||||
|
class="form-control"
|
||||||
|
type="text" maxlength="10">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">标题:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="title" name="title"
|
||||||
|
th:value="${news.title}"
|
||||||
|
class="form-control"
|
||||||
|
type="text" maxlength="30">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">内容:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input type="hidden" id="content" name="content" th:value="${news.content}"/>
|
||||||
|
<div id="contentEditorcontent">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-sm-8 col-sm-offset-3">
|
||||||
|
<button type="submit" class="btn btn-primary">提交</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div th:include="include::footer"></div>
|
||||||
|
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
|
||||||
|
<script type="text/javascript" src="/js/appjs/novel/news/edit.js">
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: "/novel/category/list",
|
||||||
|
data: {limit:100,offset:0},
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
var list = r.data.rows;
|
||||||
|
var catHtml = "<option>请选择</option>";
|
||||||
|
for(var i = 0 ; i < list.length ; i++){
|
||||||
|
var cat = list[i];
|
||||||
|
if(cat.id == $("#catId").attr("value")){
|
||||||
|
catHtml += ("<option selected value='"+cat.id+"'>"+cat.name+"</option>");
|
||||||
|
}else{
|
||||||
|
catHtml += ("<option value='"+cat.id+"'>"+cat.name+"</option>");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
$("#catId").html(catHtml);
|
||||||
|
$("#catId").change(function(){
|
||||||
|
var catName = $(this).find("option:selected").text();
|
||||||
|
if(catName != '请选择'){
|
||||||
|
|
||||||
|
$("#catName").val(catName);
|
||||||
|
}else{
|
||||||
|
$("#catName").val('');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -9,11 +9,11 @@
|
|||||||
<div class="ibox-body">
|
<div class="ibox-body">
|
||||||
<div class="fixed-table-toolbar">
|
<div class="fixed-table-toolbar">
|
||||||
<div class="columns pull-left">
|
<div class="columns pull-left">
|
||||||
<button shiro:hasPermission="system:user:add" type="button"
|
<button shiro:hasPermission="novel:news:add" type="button"
|
||||||
class="btn btn-primary" onclick="add()">
|
class="btn btn-primary" onclick="add()">
|
||||||
<i class="fa fa-plus" aria-hidden="true"></i>添加
|
<i class="fa fa-plus" aria-hidden="true"></i>添加
|
||||||
</button>
|
</button>
|
||||||
<button shiro:hasPermission="system:user:batchRemove" type="button"
|
<button shiro:hasPermission="novel:news:batchRemove" type="button"
|
||||||
class="btn btn-danger"
|
class="btn btn-danger"
|
||||||
onclick="batchRemove()">
|
onclick="batchRemove()">
|
||||||
<i class="fa fa-trash" aria-hidden="true"></i>删除
|
<i class="fa fa-trash" aria-hidden="true"></i>删除
|
||||||
@ -25,8 +25,8 @@
|
|||||||
|
|
||||||
<form id="searchForm">
|
<form id="searchForm">
|
||||||
<div class="columns pull-right col-md-2">
|
<div class="columns pull-right col-md-2">
|
||||||
<input id="id" name="id" type="text" class="form-control"
|
<input id="title" name="title" type="text" class="form-control"
|
||||||
placeholder="主键">
|
placeholder="标题">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@ -50,17 +50,17 @@
|
|||||||
s_detail_h = '';
|
s_detail_h = '';
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
<div shiro:hasPermission="system:user:edit">
|
<div shiro:hasPermission="novel:news:edit">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
s_edit_h = '';
|
s_edit_h = '';
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
<div shiro:hasPermission="system:user:remove">
|
<div shiro:hasPermission="novel:news:remove">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var s_remove_h = '';
|
var s_remove_h = '';
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
<div th:include="include :: footer"></div>
|
<div th:include="include :: footer"></div>
|
||||||
<script type="text/javascript" src="/js/appjs/system/user/user.js"></script>
|
<script type="text/javascript" src="/js/appjs/novel/news/news.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>novel</artifactId>
|
<artifactId>novel</artifactId>
|
||||||
<groupId>com.java2nb</groupId>
|
<groupId>com.java2nb</groupId>
|
||||||
<version>2.10.0</version>
|
<version>3.1.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
package com.java2nb.novel.core.utils;
|
package com.java2nb.novel.core.utils;
|
||||||
|
|
||||||
import org.apache.http.client.HttpClient;
|
import org.springframework.http.*;
|
||||||
import org.apache.http.impl.client.DefaultHttpClient;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -28,4 +25,23 @@ public class HttpUtil {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getByHttpClientWithChrome(String url) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.add("user-agent","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36");
|
||||||
|
HttpEntity<String> requestEntity = new HttpEntity<>(null, headers);
|
||||||
|
ResponseEntity<String> forEntity = restTemplate.exchange(url.toString(), HttpMethod.GET, requestEntity, String.class);
|
||||||
|
|
||||||
|
if (forEntity.getStatusCode() == HttpStatus.OK) {
|
||||||
|
return forEntity.getBody();
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,11 +23,12 @@ spring:
|
|||||||
#连接超时时间(毫秒)
|
#连接超时时间(毫秒)
|
||||||
timeout: 30000
|
timeout: 30000
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:mysql://127.0.0.1:3306/novel_plus?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://127.0.0.1:3306/novel_biz?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: test123456
|
password: test123456
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
|
||||||
|
|
||||||
####使用shardingJdbc时,
|
####使用shardingJdbc时,
|
||||||
####所有的jdbcType都不能是LONGVARCHAR,否则会导致java.io.NotSerializableException: java.io.StringReader错误
|
####所有的jdbcType都不能是LONGVARCHAR,否则会导致java.io.NotSerializableException: java.io.StringReader错误
|
||||||
##### 应该替换所有的 LONGVARCHAR 类型为VARCHAR
|
##### 应该替换所有的 LONGVARCHAR 类型为VARCHAR
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>novel</artifactId>
|
<artifactId>novel</artifactId>
|
||||||
<groupId>com.java2nb</groupId>
|
<groupId>com.java2nb</groupId>
|
||||||
<version>2.10.0</version>
|
<version>3.1.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -9,10 +9,7 @@ import com.java2nb.novel.service.CrawlService;
|
|||||||
import com.java2nb.novel.vo.CrawlSingleTaskVO;
|
import com.java2nb.novel.vo.CrawlSingleTaskVO;
|
||||||
import com.java2nb.novel.vo.CrawlSourceVO;
|
import com.java2nb.novel.vo.CrawlSourceVO;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Administrator
|
* @author Administrator
|
||||||
@ -39,7 +36,7 @@ public class CrawlController {
|
|||||||
/**
|
/**
|
||||||
* 爬虫源分页列表查询
|
* 爬虫源分页列表查询
|
||||||
* */
|
* */
|
||||||
@PostMapping("listCrawlByPage")
|
@GetMapping("listCrawlByPage")
|
||||||
public ResultBean listCrawlByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int pageSize){
|
public ResultBean listCrawlByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int pageSize){
|
||||||
|
|
||||||
return ResultBean.ok(new PageInfo<>(BeanUtil.copyList(crawlService.listCrawlByPage(page,pageSize), CrawlSourceVO.class)
|
return ResultBean.ok(new PageInfo<>(BeanUtil.copyList(crawlService.listCrawlByPage(page,pageSize), CrawlSourceVO.class)
|
||||||
@ -71,7 +68,7 @@ public class CrawlController {
|
|||||||
/**
|
/**
|
||||||
* 单本采集任务分页列表查询
|
* 单本采集任务分页列表查询
|
||||||
* */
|
* */
|
||||||
@PostMapping("listCrawlSingleTaskByPage")
|
@GetMapping("listCrawlSingleTaskByPage")
|
||||||
public ResultBean listCrawlSingleTaskByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int pageSize){
|
public ResultBean listCrawlSingleTaskByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int pageSize){
|
||||||
|
|
||||||
return ResultBean.ok(new PageInfo<>(BeanUtil.copyList(crawlService.listCrawlSingleTaskByPage(page,pageSize), CrawlSingleTaskVO.class)
|
return ResultBean.ok(new PageInfo<>(BeanUtil.copyList(crawlService.listCrawlSingleTaskByPage(page,pageSize), CrawlSingleTaskVO.class)
|
||||||
@ -81,8 +78,8 @@ public class CrawlController {
|
|||||||
/**
|
/**
|
||||||
* 删除采集任务
|
* 删除采集任务
|
||||||
* */
|
* */
|
||||||
@PostMapping("delCrawlSingleTask")
|
@DeleteMapping("delCrawlSingleTask/{id}")
|
||||||
public ResultBean delCrawlSingleTask(Long id){
|
public ResultBean delCrawlSingleTask(@PathVariable("id") Long id){
|
||||||
|
|
||||||
crawlService.delCrawlSingleTask(id);
|
crawlService.delCrawlSingleTask(id);
|
||||||
|
|
||||||
|
@ -11,8 +11,7 @@ import com.java2nb.novel.utils.Constants;
|
|||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.*;
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@ -44,7 +43,7 @@ public class CrawlParser {
|
|||||||
public static Book parseBook(RuleBean ruleBean, String bookId) {
|
public static Book parseBook(RuleBean ruleBean, String bookId) {
|
||||||
Book book = new Book();
|
Book book = new Book();
|
||||||
String bookDetailUrl = ruleBean.getBookDetailUrl().replace("{bookId}", bookId);
|
String bookDetailUrl = ruleBean.getBookDetailUrl().replace("{bookId}", bookId);
|
||||||
String bookDetailHtml = getByHttpClient(bookDetailUrl);
|
String bookDetailHtml = getByHttpClientWithChrome(bookDetailUrl);
|
||||||
if (bookDetailHtml != null) {
|
if (bookDetailHtml != null) {
|
||||||
Pattern bookNamePatten = compile(ruleBean.getBookNamePatten());
|
Pattern bookNamePatten = compile(ruleBean.getBookNamePatten());
|
||||||
Matcher bookNameMatch = bookNamePatten.matcher(bookDetailHtml);
|
Matcher bookNameMatch = bookNamePatten.matcher(bookDetailHtml);
|
||||||
@ -157,7 +156,7 @@ public class CrawlParser {
|
|||||||
List<BookContent> contentList = new ArrayList<>();
|
List<BookContent> contentList = new ArrayList<>();
|
||||||
//读取目录
|
//读取目录
|
||||||
String indexListUrl = ruleBean.getBookIndexUrl().replace("{bookId}", sourceBookId);
|
String indexListUrl = ruleBean.getBookIndexUrl().replace("{bookId}", sourceBookId);
|
||||||
String indexListHtml = getByHttpClient(indexListUrl);
|
String indexListHtml = getByHttpClientWithChrome(indexListUrl);
|
||||||
|
|
||||||
if (indexListHtml != null) {
|
if (indexListHtml != null) {
|
||||||
if(StringUtils.isNotBlank(ruleBean.getBookIndexStart())){
|
if(StringUtils.isNotBlank(ruleBean.getBookIndexStart())){
|
||||||
@ -186,10 +185,41 @@ public class CrawlParser {
|
|||||||
String indexName = indexNameMatch.group(1);
|
String indexName = indexNameMatch.group(1);
|
||||||
|
|
||||||
if (hasIndex == null || !StringUtils.deleteWhitespace(hasIndex.getIndexName()).equals(StringUtils.deleteWhitespace(indexName))) {
|
if (hasIndex == null || !StringUtils.deleteWhitespace(hasIndex.getIndexName()).equals(StringUtils.deleteWhitespace(indexName))) {
|
||||||
String contentUrl = ruleBean.getBookContentUrl().replace("{bookId}", sourceBookId).replace("{indexId}", indexIdMatch.group(1));
|
|
||||||
|
String sourceIndexId = indexIdMatch.group(1);
|
||||||
|
String bookContentUrl = ruleBean.getBookContentUrl();
|
||||||
|
int calStart = bookContentUrl.indexOf("{cal_");
|
||||||
|
if(calStart != -1){
|
||||||
|
//内容页URL需要进行计算才能得到
|
||||||
|
String calStr = bookContentUrl.substring(calStart,calStart+bookContentUrl.substring(calStart).indexOf("}"));
|
||||||
|
String[] calArr = calStr.split("_");
|
||||||
|
int calType = Integer.parseInt(calArr[1]);
|
||||||
|
if(calType == 1) {
|
||||||
|
///{cal_1_1_3}_{bookId}/{indexId}.html
|
||||||
|
//第一种计算规则,去除第x个参数的最后y个字母
|
||||||
|
int x = Integer.parseInt(calArr[2]);
|
||||||
|
int y = Integer.parseInt(calArr[3]);
|
||||||
|
String calResult;
|
||||||
|
if (x == 1) {
|
||||||
|
calResult = sourceBookId.substring(0, sourceBookId.length() - y);
|
||||||
|
} else {
|
||||||
|
calResult = sourceIndexId.substring(0, sourceBookId.length() - y);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(calResult.length() == 0){
|
||||||
|
calResult = "0";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bookContentUrl = bookContentUrl.replace(calStr+"}", calResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
String contentUrl = bookContentUrl.replace("{bookId}", sourceBookId).replace("{indexId}", sourceIndexId);
|
||||||
|
|
||||||
//查询章节内容
|
//查询章节内容
|
||||||
String contentHtml = getByHttpClient(contentUrl);
|
String contentHtml = getByHttpClientWithChrome(contentUrl);
|
||||||
if (contentHtml != null && !contentHtml.contains("正在手打中")) {
|
if (contentHtml != null && !contentHtml.contains("正在手打中")) {
|
||||||
String content = contentHtml.substring(contentHtml.indexOf(ruleBean.getContentStart()) + ruleBean.getContentStart().length());
|
String content = contentHtml.substring(contentHtml.indexOf(ruleBean.getContentStart()) + ruleBean.getContentStart().length());
|
||||||
content = content.substring(0, content.indexOf(ruleBean.getContentEnd()));
|
content = content.substring(0, content.indexOf(ruleBean.getContentEnd()));
|
||||||
@ -280,6 +310,22 @@ public class CrawlParser {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String getByHttpClientWithChrome(String url) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
String body = HttpUtil.getByHttpClientWithChrome(url);
|
||||||
|
if(body != null && body.length() < Constants.INVALID_HTML_LENGTH){
|
||||||
|
return processErrorHttpResult(url);
|
||||||
|
}
|
||||||
|
//成功获得html内容
|
||||||
|
return body;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return processErrorHttpResult(url);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
private static String processErrorHttpResult(String url){
|
private static String processErrorHttpResult(String url){
|
||||||
Integer count = retryCount.get();
|
Integer count = retryCount.get();
|
||||||
|
@ -30,6 +30,7 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import static com.java2nb.novel.core.utils.HttpUtil.getByHttpClient;
|
import static com.java2nb.novel.core.utils.HttpUtil.getByHttpClient;
|
||||||
|
import static com.java2nb.novel.core.utils.HttpUtil.getByHttpClientWithChrome;
|
||||||
import static com.java2nb.novel.mapper.BookDynamicSqlSupport.crawlBookId;
|
import static com.java2nb.novel.mapper.BookDynamicSqlSupport.crawlBookId;
|
||||||
import static com.java2nb.novel.mapper.BookDynamicSqlSupport.crawlSourceId;
|
import static com.java2nb.novel.mapper.BookDynamicSqlSupport.crawlSourceId;
|
||||||
import static com.java2nb.novel.mapper.CrawlSourceDynamicSqlSupport.*;
|
import static com.java2nb.novel.mapper.CrawlSourceDynamicSqlSupport.*;
|
||||||
@ -217,7 +218,7 @@ public class CrawlServiceImpl implements CrawlService {
|
|||||||
.replace("{catId}", ruleBean.getCatIdRule().get("catId" + catId))
|
.replace("{catId}", ruleBean.getCatIdRule().get("catId" + catId))
|
||||||
.replace("{page}", page + "");
|
.replace("{page}", page + "");
|
||||||
|
|
||||||
String bookListHtml = getByHttpClient(catBookListUrl);
|
String bookListHtml = getByHttpClientWithChrome(catBookListUrl);
|
||||||
if (bookListHtml != null) {
|
if (bookListHtml != null) {
|
||||||
Pattern bookIdPatten = Pattern.compile(ruleBean.getBookIdPatten());
|
Pattern bookIdPatten = Pattern.compile(ruleBean.getBookIdPatten());
|
||||||
Matcher bookIdMatcher = bookIdPatten.matcher(bookListHtml);
|
Matcher bookIdMatcher = bookIdPatten.matcher(bookListHtml);
|
||||||
|
@ -96,7 +96,7 @@
|
|||||||
<script language="javascript" type="text/javascript">
|
<script language="javascript" type="text/javascript">
|
||||||
$(function () {
|
$(function () {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/crawl/listCrawlByPage",
|
url: "/crawl/listCrawlByPage",
|
||||||
data: {'curr':1,'limit':100},
|
data: {'curr':1,'limit':100},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -125,7 +125,7 @@
|
|||||||
function search(curr, limit) {
|
function search(curr, limit) {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/crawl/listCrawlSingleTaskByPage",
|
url: "/crawl/listCrawlSingleTaskByPage",
|
||||||
data: {'curr': curr, 'limit': limit},
|
data: {'curr': curr, 'limit': limit},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -205,9 +205,9 @@
|
|||||||
function del(id) {
|
function del(id) {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "delete",
|
||||||
url: "/crawl/delCrawlSingleTask",
|
url: "/crawl/delCrawlSingleTask/"+id,
|
||||||
data: {'id': id},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data.code == 200) {
|
if (data.code == 200) {
|
||||||
|
@ -117,7 +117,7 @@
|
|||||||
示例:<b></b>
|
示例:<b></b>
|
||||||
<li><input type="text" id="visitCountPatten" class="s_input icon_key"
|
<li><input type="text" id="visitCountPatten" class="s_input icon_key"
|
||||||
placeholder="小说点击量的正则表达式:"></li>
|
placeholder="小说点击量的正则表达式:"></li>
|
||||||
示例:<b><p class=\"review\"></b>
|
示例:<b><p class="review"></b>
|
||||||
<li><input type="text" id="descStart" class="s_input icon_key"
|
<li><input type="text" id="descStart" class="s_input icon_key"
|
||||||
placeholder="小说简介开始截取字符串:"></li>
|
placeholder="小说简介开始截取字符串:"></li>
|
||||||
示例:<b></p></b>
|
示例:<b></p></b>
|
||||||
|
@ -122,7 +122,7 @@
|
|||||||
function search(curr, limit) {
|
function search(curr, limit) {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/crawl/listCrawlByPage",
|
url: "/crawl/listCrawlByPage",
|
||||||
data: {'curr':curr,'limit':limit},
|
data: {'curr':curr,'limit':limit},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>novel</artifactId>
|
<artifactId>novel</artifactId>
|
||||||
<groupId>com.java2nb</groupId>
|
<groupId>com.java2nb</groupId>
|
||||||
<version>2.10.0</version>
|
<version>3.1.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -13,10 +13,7 @@ import com.java2nb.novel.service.BookService;
|
|||||||
import com.java2nb.novel.service.FriendLinkService;
|
import com.java2nb.novel.service.FriendLinkService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@ -38,7 +35,7 @@ public class AuthorController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
* 校验笔名是否存在
|
* 校验笔名是否存在
|
||||||
* */
|
* */
|
||||||
@PostMapping("checkPenName")
|
@GetMapping("checkPenName")
|
||||||
public ResultBean checkPenName(String penName){
|
public ResultBean checkPenName(String penName){
|
||||||
|
|
||||||
return ResultBean.ok(authorService.checkPenName(penName));
|
return ResultBean.ok(authorService.checkPenName(penName));
|
||||||
@ -47,7 +44,7 @@ public class AuthorController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
* 作家发布小说分页列表查询
|
* 作家发布小说分页列表查询
|
||||||
* */
|
* */
|
||||||
@PostMapping("listBookByPage")
|
@GetMapping("listBookByPage")
|
||||||
public ResultBean listBookByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int pageSize ,HttpServletRequest request){
|
public ResultBean listBookByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int pageSize ,HttpServletRequest request){
|
||||||
|
|
||||||
return ResultBean.ok(new PageInfo<>(bookService.listBookPageByUserId(getUserDetails(request).getId(),page,pageSize)
|
return ResultBean.ok(new PageInfo<>(bookService.listBookPageByUserId(getUserDetails(request).getId(),page,pageSize)
|
||||||
@ -90,8 +87,8 @@ public class AuthorController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
* 删除章节
|
* 删除章节
|
||||||
*/
|
*/
|
||||||
@PostMapping("deleteIndex")
|
@DeleteMapping("deleteIndex/{indexId}")
|
||||||
public ResultBean deleteIndex(Long indexId, HttpServletRequest request) {
|
public ResultBean deleteIndex(@PathVariable("indexId") Long indexId, HttpServletRequest request) {
|
||||||
|
|
||||||
Author author = checkAuthor(request);
|
Author author = checkAuthor(request);
|
||||||
|
|
||||||
@ -136,8 +133,8 @@ public class AuthorController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
* 查询章节内容
|
* 查询章节内容
|
||||||
*/
|
*/
|
||||||
@PostMapping("queryIndexContent")
|
@GetMapping("queryIndexContent/{indexId}")
|
||||||
public ResultBean queryIndexContent(Long indexId, HttpServletRequest request) {
|
public ResultBean queryIndexContent(@PathVariable("indexId") Long indexId, HttpServletRequest request) {
|
||||||
|
|
||||||
Author author = checkAuthor(request);
|
Author author = checkAuthor(request);
|
||||||
|
|
||||||
@ -167,7 +164,7 @@ public class AuthorController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
* 作家日收入统计数据分页列表查询
|
* 作家日收入统计数据分页列表查询
|
||||||
* */
|
* */
|
||||||
@PostMapping("listIncomeDailyByPage")
|
@GetMapping("listIncomeDailyByPage")
|
||||||
public ResultBean listIncomeDailyByPage(@RequestParam(value = "curr", defaultValue = "1") int page,
|
public ResultBean listIncomeDailyByPage(@RequestParam(value = "curr", defaultValue = "1") int page,
|
||||||
@RequestParam(value = "limit", defaultValue = "10") int pageSize ,
|
@RequestParam(value = "limit", defaultValue = "10") int pageSize ,
|
||||||
@RequestParam(value = "bookId", defaultValue = "0") Long bookId,
|
@RequestParam(value = "bookId", defaultValue = "0") Long bookId,
|
||||||
@ -183,7 +180,7 @@ public class AuthorController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
* 作家月收入统计数据分页列表查询
|
* 作家月收入统计数据分页列表查询
|
||||||
* */
|
* */
|
||||||
@PostMapping("listIncomeMonthByPage")
|
@GetMapping("listIncomeMonthByPage")
|
||||||
public ResultBean listIncomeMonthByPage(@RequestParam(value = "curr", defaultValue = "1") int page,
|
public ResultBean listIncomeMonthByPage(@RequestParam(value = "curr", defaultValue = "1") int page,
|
||||||
@RequestParam(value = "limit", defaultValue = "10") int pageSize ,
|
@RequestParam(value = "limit", defaultValue = "10") int pageSize ,
|
||||||
@RequestParam(value = "bookId", defaultValue = "0") Long bookId,
|
@RequestParam(value = "bookId", defaultValue = "0") Long bookId,
|
||||||
|
@ -12,10 +12,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -41,7 +38,7 @@ public class BookController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
* 查询首页小说设置列表数据
|
* 查询首页小说设置列表数据
|
||||||
* */
|
* */
|
||||||
@PostMapping("listBookSetting")
|
@GetMapping("listBookSetting")
|
||||||
public ResultBean listBookSetting(){
|
public ResultBean listBookSetting(){
|
||||||
return ResultBean.ok(bookService.listBookSettingVO());
|
return ResultBean.ok(bookService.listBookSettingVO());
|
||||||
}
|
}
|
||||||
@ -49,7 +46,7 @@ public class BookController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
* 查询首页点击榜单数据
|
* 查询首页点击榜单数据
|
||||||
* */
|
* */
|
||||||
@PostMapping("listClickRank")
|
@GetMapping("listClickRank")
|
||||||
public ResultBean listClickRank(){
|
public ResultBean listClickRank(){
|
||||||
return ResultBean.ok(bookService.listClickRank());
|
return ResultBean.ok(bookService.listClickRank());
|
||||||
}
|
}
|
||||||
@ -57,7 +54,7 @@ public class BookController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
* 查询首页新书榜单数据
|
* 查询首页新书榜单数据
|
||||||
* */
|
* */
|
||||||
@PostMapping("listNewRank")
|
@GetMapping("listNewRank")
|
||||||
public ResultBean listNewRank(){
|
public ResultBean listNewRank(){
|
||||||
return ResultBean.ok(bookService.listNewRank());
|
return ResultBean.ok(bookService.listNewRank());
|
||||||
}
|
}
|
||||||
@ -65,7 +62,7 @@ public class BookController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
* 查询首页更新榜单数据
|
* 查询首页更新榜单数据
|
||||||
* */
|
* */
|
||||||
@PostMapping("listUpdateRank")
|
@GetMapping("listUpdateRank")
|
||||||
public ResultBean listUpdateRank(){
|
public ResultBean listUpdateRank(){
|
||||||
return ResultBean.ok(bookService.listUpdateRank());
|
return ResultBean.ok(bookService.listUpdateRank());
|
||||||
}
|
}
|
||||||
@ -73,7 +70,7 @@ public class BookController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
* 查询小说分类列表
|
* 查询小说分类列表
|
||||||
* */
|
* */
|
||||||
@PostMapping("listBookCategory")
|
@GetMapping("listBookCategory")
|
||||||
public ResultBean listBookCategory(){
|
public ResultBean listBookCategory(){
|
||||||
return ResultBean.ok(bookService.listBookCategory());
|
return ResultBean.ok(bookService.listBookCategory());
|
||||||
}
|
}
|
||||||
@ -81,7 +78,7 @@ public class BookController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
* 分页搜索
|
* 分页搜索
|
||||||
* */
|
* */
|
||||||
@PostMapping("searchByPage")
|
@GetMapping("searchByPage")
|
||||||
public ResultBean searchByPage(BookSP bookSP, @RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "20") int pageSize){
|
public ResultBean searchByPage(BookSP bookSP, @RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "20") int pageSize){
|
||||||
PageInfo<BookVO> pageInfo = bookService.searchByPage(bookSP,page,pageSize);
|
PageInfo<BookVO> pageInfo = bookService.searchByPage(bookSP,page,pageSize);
|
||||||
return ResultBean.ok(pageInfo);
|
return ResultBean.ok(pageInfo);
|
||||||
@ -90,8 +87,8 @@ public class BookController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
* 查询小说详情信息
|
* 查询小说详情信息
|
||||||
* */
|
* */
|
||||||
@PostMapping("queryBookDetail")
|
@GetMapping("queryBookDetail/{id}")
|
||||||
public ResultBean queryBookDetail(Long id){
|
public ResultBean queryBookDetail(@PathVariable("id") Long id){
|
||||||
return ResultBean.ok(bookService.queryBookDetail(id));
|
return ResultBean.ok(bookService.queryBookDetail(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +96,7 @@ public class BookController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
* 查询小说排行信息
|
* 查询小说排行信息
|
||||||
* */
|
* */
|
||||||
@PostMapping("listRank")
|
@GetMapping("listRank")
|
||||||
public ResultBean listRank(@RequestParam(value = "type",defaultValue = "0") Byte type,@RequestParam(value = "limit",defaultValue = "30") Integer limit){
|
public ResultBean listRank(@RequestParam(value = "type",defaultValue = "0") Byte type,@RequestParam(value = "limit",defaultValue = "30") Integer limit){
|
||||||
return ResultBean.ok(bookService.listRank(type,limit));
|
return ResultBean.ok(bookService.listRank(type,limit));
|
||||||
}
|
}
|
||||||
@ -120,7 +117,7 @@ public class BookController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
* 查询章节相关信息
|
* 查询章节相关信息
|
||||||
* */
|
* */
|
||||||
@PostMapping("queryBookIndexAbout")
|
@GetMapping("queryBookIndexAbout")
|
||||||
public ResultBean queryBookIndexAbout(Long bookId,Long lastBookIndexId) {
|
public ResultBean queryBookIndexAbout(Long bookId,Long lastBookIndexId) {
|
||||||
Map<String,Object> data = new HashMap<>(2);
|
Map<String,Object> data = new HashMap<>(2);
|
||||||
data.put("bookIndexCount",bookService.queryIndexCount(bookId));
|
data.put("bookIndexCount",bookService.queryIndexCount(bookId));
|
||||||
@ -135,7 +132,7 @@ public class BookController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
* 根据分类id查询同类推荐书籍
|
* 根据分类id查询同类推荐书籍
|
||||||
* */
|
* */
|
||||||
@PostMapping("listRecBookByCatId")
|
@GetMapping("listRecBookByCatId")
|
||||||
public ResultBean listRecBookByCatId(Integer catId) {
|
public ResultBean listRecBookByCatId(Integer catId) {
|
||||||
return ResultBean.ok(bookService.listRecBookByCatId(catId));
|
return ResultBean.ok(bookService.listRecBookByCatId(catId));
|
||||||
}
|
}
|
||||||
@ -144,7 +141,7 @@ public class BookController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
*分页查询书籍评论列表
|
*分页查询书籍评论列表
|
||||||
* */
|
* */
|
||||||
@PostMapping("listCommentByPage")
|
@GetMapping("listCommentByPage")
|
||||||
public ResultBean listCommentByPage(@RequestParam("bookId") Long bookId,@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "5") int pageSize) {
|
public ResultBean listCommentByPage(@RequestParam("bookId") Long bookId,@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "5") int pageSize) {
|
||||||
return ResultBean.ok(new PageInfo<>(bookService.listCommentByPage(null,bookId,page,pageSize)));
|
return ResultBean.ok(new PageInfo<>(bookService.listCommentByPage(null,bookId,page,pageSize)));
|
||||||
}
|
}
|
||||||
@ -165,7 +162,7 @@ public class BookController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
* 根据小说ID查询小说前十条最新更新目录集合
|
* 根据小说ID查询小说前十条最新更新目录集合
|
||||||
* */
|
* */
|
||||||
@PostMapping("queryNewIndexList")
|
@GetMapping("queryNewIndexList")
|
||||||
public ResultBean queryNewIndexList(Long bookId){
|
public ResultBean queryNewIndexList(Long bookId){
|
||||||
return ResultBean.ok(bookService.queryIndexList(bookId,"index_num desc",1,10));
|
return ResultBean.ok(bookService.queryIndexList(bookId,"index_num desc",1,10));
|
||||||
}
|
}
|
||||||
@ -173,8 +170,8 @@ public class BookController extends BaseController{
|
|||||||
/**
|
/**
|
||||||
* 目录页
|
* 目录页
|
||||||
* */
|
* */
|
||||||
@PostMapping("/queryIndexList")
|
@GetMapping("/queryIndexList")
|
||||||
public ResultBean indexList(Long bookId,@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "5") int pageSize,@RequestParam(value = "orderBy") String orderBy) {
|
public ResultBean indexList(Long bookId,@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "5") int pageSize,@RequestParam(value = "orderBy",defaultValue = "index_num desc") String orderBy) {
|
||||||
return ResultBean.ok(new PageInfo<>(bookService.queryIndexList(bookId,orderBy,page,pageSize)));
|
return ResultBean.ok(new PageInfo<>(bookService.queryIndexList(bookId,orderBy,page,pageSize)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import com.java2nb.novel.core.bean.ResultBean;
|
|||||||
import com.java2nb.novel.service.FriendLinkService;
|
import com.java2nb.novel.service.FriendLinkService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@ -22,7 +23,7 @@ public class FriendLinkController {
|
|||||||
/**
|
/**
|
||||||
* 查询首页友情链接
|
* 查询首页友情链接
|
||||||
* */
|
* */
|
||||||
@PostMapping("listIndexLink")
|
@GetMapping("listIndexLink")
|
||||||
public ResultBean listIndexLink(){
|
public ResultBean listIndexLink(){
|
||||||
return ResultBean.ok(friendLinkService.listIndexLink());
|
return ResultBean.ok(friendLinkService.listIndexLink());
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,7 @@ import com.java2nb.novel.core.bean.ResultBean;
|
|||||||
import com.java2nb.novel.service.NewsService;
|
import com.java2nb.novel.service.NewsService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 11797
|
* @author 11797
|
||||||
@ -24,7 +21,7 @@ public class NewsController {
|
|||||||
/**
|
/**
|
||||||
* 查询首页新闻
|
* 查询首页新闻
|
||||||
* */
|
* */
|
||||||
@PostMapping("listIndexNews")
|
@GetMapping("listIndexNews")
|
||||||
public ResultBean listIndexNews(){
|
public ResultBean listIndexNews(){
|
||||||
return ResultBean.ok(newsService.listIndexNews());
|
return ResultBean.ok(newsService.listIndexNews());
|
||||||
}
|
}
|
||||||
@ -32,7 +29,7 @@ public class NewsController {
|
|||||||
/**
|
/**
|
||||||
* 分页查询新闻列表
|
* 分页查询新闻列表
|
||||||
* */
|
* */
|
||||||
@PostMapping("listByPage")
|
@GetMapping("listByPage")
|
||||||
public ResultBean listByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "5") int pageSize){
|
public ResultBean listByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "5") int pageSize){
|
||||||
return ResultBean.ok(new PageInfo<>(newsService.listByPage(page,pageSize)));
|
return ResultBean.ok(new PageInfo<>(newsService.listByPage(page,pageSize)));
|
||||||
}
|
}
|
||||||
|
@ -15,10 +15,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.validation.BindingResult;
|
import org.springframework.validation.BindingResult;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
@ -115,7 +112,7 @@ public class UserController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 查询小说是否已加入书架
|
* 查询小说是否已加入书架
|
||||||
*/
|
*/
|
||||||
@PostMapping("queryIsInShelf")
|
@GetMapping("queryIsInShelf")
|
||||||
public ResultBean queryIsInShelf(Long bookId, HttpServletRequest request) {
|
public ResultBean queryIsInShelf(Long bookId, HttpServletRequest request) {
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
if (userDetails == null) {
|
if (userDetails == null) {
|
||||||
@ -140,8 +137,8 @@ public class UserController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 移出书架
|
* 移出书架
|
||||||
* */
|
* */
|
||||||
@PostMapping("removeFromBookShelf")
|
@DeleteMapping("removeFromBookShelf/{bookId}")
|
||||||
public ResultBean removeFromBookShelf(Long bookId, HttpServletRequest request) {
|
public ResultBean removeFromBookShelf(@PathVariable("bookId") Long bookId, HttpServletRequest request) {
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
if (userDetails == null) {
|
if (userDetails == null) {
|
||||||
return ResultBean.fail(ResponseStatus.NO_LOGIN);
|
return ResultBean.fail(ResponseStatus.NO_LOGIN);
|
||||||
@ -153,7 +150,7 @@ public class UserController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 分页查询书架
|
* 分页查询书架
|
||||||
* */
|
* */
|
||||||
@PostMapping("listBookShelfByPage")
|
@GetMapping("listBookShelfByPage")
|
||||||
public ResultBean listBookShelfByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int pageSize,HttpServletRequest request) {
|
public ResultBean listBookShelfByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int pageSize,HttpServletRequest request) {
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
if (userDetails == null) {
|
if (userDetails == null) {
|
||||||
@ -165,7 +162,7 @@ public class UserController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 分页查询阅读记录
|
* 分页查询阅读记录
|
||||||
* */
|
* */
|
||||||
@PostMapping("listReadHistoryByPage")
|
@GetMapping("listReadHistoryByPage")
|
||||||
public ResultBean listReadHistoryByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int pageSize,HttpServletRequest request) {
|
public ResultBean listReadHistoryByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int pageSize,HttpServletRequest request) {
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
if (userDetails == null) {
|
if (userDetails == null) {
|
||||||
@ -203,7 +200,7 @@ public class UserController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 分页查询我的反馈列表
|
* 分页查询我的反馈列表
|
||||||
* */
|
* */
|
||||||
@PostMapping("listUserFeedBackByPage")
|
@GetMapping("listUserFeedBackByPage")
|
||||||
public ResultBean listUserFeedBackByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "5") int pageSize, HttpServletRequest request){
|
public ResultBean listUserFeedBackByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "5") int pageSize, HttpServletRequest request){
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
if (userDetails == null) {
|
if (userDetails == null) {
|
||||||
@ -215,7 +212,7 @@ public class UserController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 查询个人信息
|
* 查询个人信息
|
||||||
* */
|
* */
|
||||||
@PostMapping("userInfo")
|
@GetMapping("userInfo")
|
||||||
public ResultBean userInfo(HttpServletRequest request) {
|
public ResultBean userInfo(HttpServletRequest request) {
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
if (userDetails == null) {
|
if (userDetails == null) {
|
||||||
@ -263,7 +260,7 @@ public class UserController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 分页查询用户书评
|
* 分页查询用户书评
|
||||||
* */
|
* */
|
||||||
@PostMapping("listCommentByPage")
|
@GetMapping("listCommentByPage")
|
||||||
public ResultBean listCommentByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "5") int pageSize,HttpServletRequest request) {
|
public ResultBean listCommentByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "5") int pageSize,HttpServletRequest request) {
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
if (userDetails == null) {
|
if (userDetails == null) {
|
||||||
|
@ -2,39 +2,13 @@ var SCYC = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$.extend($.fn.validatebox.defaults.rules, {
|
$.extend($.fn.validatebox.defaults.rules, {
|
||||||
checkBookName: {
|
checkPenName: {
|
||||||
validator: function (value, param) {
|
|
||||||
var url = "/aspx/book/booklist.aspx";
|
|
||||||
var data = { bid: param, bname: value, act: "getbooknamerepeat" };
|
|
||||||
var bool = false;
|
|
||||||
$.ajax({
|
|
||||||
type: "post",
|
|
||||||
dataType: 'html',
|
|
||||||
async: false,
|
|
||||||
url: url,
|
|
||||||
data: data,
|
|
||||||
cache: false,
|
|
||||||
success: function (result) {
|
|
||||||
if (result == "1") {
|
|
||||||
$.fn.validatebox.defaults.rules.checkBookName.message = '该书名已存在,请重新输入';
|
|
||||||
bool = false;
|
|
||||||
} else {
|
|
||||||
$.fn.validatebox.defaults.rules.checkBookName.message = '';
|
|
||||||
bool = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return bool;
|
|
||||||
message: '';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
checkNiceName: {
|
|
||||||
validator: function (value, param) {
|
validator: function (value, param) {
|
||||||
var url = "/author/checkPenName";
|
var url = "/author/checkPenName";
|
||||||
var data = { penName: value};
|
var data = { penName: value};
|
||||||
var bool = false;
|
var bool = false;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "post",
|
type: "get",
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
async: false,
|
async: false,
|
||||||
url: url,
|
url: url,
|
||||||
@ -42,10 +16,10 @@ $.extend($.fn.validatebox.defaults.rules, {
|
|||||||
cache: false,
|
cache: false,
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
if (result.data) {
|
if (result.data) {
|
||||||
$.fn.validatebox.defaults.rules.checkNiceName.message = '笔名已存在,请重新输入';
|
$.fn.validatebox.defaults.rules.checkPenName.message = '笔名已存在,请重新输入';
|
||||||
bool = false;
|
bool = false;
|
||||||
} else {
|
} else {
|
||||||
$.fn.validatebox.defaults.rules.checkNiceName.message = '';
|
$.fn.validatebox.defaults.rules.checkPenName.message = '';
|
||||||
bool = true;
|
bool = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
BIN
novel-front/src/main/resources/static/mobile/fiction_house.apk
Normal file
BIN
novel-front/src/main/resources/static/mobile/fiction_house.apk
Normal file
Binary file not shown.
@ -1508,9 +1508,9 @@ a cite {
|
|||||||
|
|
||||||
.layui-elem-quote {
|
.layui-elem-quote {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
padding: 15px;
|
padding: 8px;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
border-left: 5px solid #009688;
|
border-left: 5px solid #f80;
|
||||||
border-radius: 0 2px 2px 0;
|
border-radius: 0 2px 2px 0;
|
||||||
background-color: #f2f2f2
|
background-color: #f2f2f2
|
||||||
}
|
}
|
||||||
@ -1596,7 +1596,6 @@ a cite {
|
|||||||
|
|
||||||
.layui-colla-content, .layui-colla-item {
|
.layui-colla-content, .layui-colla-item {
|
||||||
border-top-width: 1px;
|
border-top-width: 1px;
|
||||||
border-top-style: solid
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.layui-colla-item:first-child {
|
.layui-colla-item:first-child {
|
||||||
@ -1714,7 +1713,7 @@ a cite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.layui-bg-cyan {
|
.layui-bg-cyan {
|
||||||
background-color: #2F4056 !important
|
background-color: #f80 !important
|
||||||
}
|
}
|
||||||
|
|
||||||
.layui-bg-blue {
|
.layui-bg-blue {
|
||||||
@ -1788,7 +1787,7 @@ a cite {
|
|||||||
height: 38px;
|
height: 38px;
|
||||||
line-height: 38px;
|
line-height: 38px;
|
||||||
padding: 0 18px;
|
padding: 0 18px;
|
||||||
background-color: #009688;
|
background-color: #f80;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -2700,7 +2699,7 @@ a cite {
|
|||||||
padding: 1px;
|
padding: 1px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: #009688
|
background-color: #f80
|
||||||
}
|
}
|
||||||
|
|
||||||
.layui-laypage-em {
|
.layui-laypage-em {
|
||||||
@ -3490,7 +3489,7 @@ body .layui-table-tips .layui-layer-content {
|
|||||||
.layui-nav {
|
.layui-nav {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
background-color: #393D49;
|
background-color: #f80;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
font-size: 0;
|
font-size: 0;
|
||||||
@ -3514,7 +3513,6 @@ body .layui-table-tips .layui-layer-content {
|
|||||||
display: block;
|
display: block;
|
||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
color: rgba(255, 255, 255, .7);
|
|
||||||
transition: all .3s;
|
transition: all .3s;
|
||||||
-webkit-transition: all .3s
|
-webkit-transition: all .3s
|
||||||
}
|
}
|
||||||
@ -3525,7 +3523,7 @@ body .layui-table-tips .layui-layer-content {
|
|||||||
top: 0;
|
top: 0;
|
||||||
width: 0;
|
width: 0;
|
||||||
height: 5px;
|
height: 5px;
|
||||||
background-color: #5FB878;
|
background-color: rgba(255, 255, 255, 0.8);;
|
||||||
transition: all .2s;
|
transition: all .2s;
|
||||||
-webkit-transition: all .2s
|
-webkit-transition: all .2s
|
||||||
}
|
}
|
||||||
@ -3606,8 +3604,7 @@ body .layui-table-tips .layui-layer-content {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.layui-nav .layui-nav-child dd.layui-this a, .layui-nav-child dd.layui-this {
|
.layui-nav .layui-nav-child dd.layui-this a, .layui-nav-child dd.layui-this {
|
||||||
background-color: #5FB878;
|
background-color: #f80;
|
||||||
color: #fff
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.layui-nav-child dd.layui-this:after {
|
.layui-nav-child dd.layui-this:after {
|
||||||
|
File diff suppressed because one or more lines are too long
@ -56,7 +56,7 @@
|
|||||||
function search(curr, limit) {
|
function search(curr, limit) {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/news/listByPage",
|
url: "/news/listByPage",
|
||||||
data: {'curr':curr,'limit':limit},
|
data: {'curr':curr,'limit':limit},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -118,7 +118,7 @@
|
|||||||
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/author/listIncomeMonthByPage",
|
url: "/author/listIncomeMonthByPage",
|
||||||
data: {'curr':curr,'limit':limit},
|
data: {'curr':curr,'limit':limit},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -124,7 +124,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/author/listIncomeDailyByPage",
|
url: "/author/listIncomeDailyByPage",
|
||||||
data: data,
|
data: data,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -134,9 +134,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/author/queryIndexContent",
|
url: "/author/queryIndexContent/"+indexId,
|
||||||
data: {'indexId':indexId},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data.code == 200) {
|
if (data.code == 200) {
|
||||||
|
@ -144,7 +144,7 @@
|
|||||||
function search(curr, limit) {
|
function search(curr, limit) {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/author/listBookByPage",
|
url: "/author/listBookByPage",
|
||||||
data: {'curr':curr,'limit':limit},
|
data: {'curr':curr,'limit':limit},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -144,7 +144,7 @@
|
|||||||
function search(curr, limit) {
|
function search(curr, limit) {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/book/queryIndexList",
|
url: "/book/queryIndexList",
|
||||||
data: {'bookId': bookId, 'curr': curr, 'limit': limit, 'orderBy': 'index_num desc'},
|
data: {'bookId': bookId, 'curr': curr, 'limit': limit, 'orderBy': 'index_num desc'},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -299,9 +299,9 @@
|
|||||||
|
|
||||||
layer.close(index);
|
layer.close(index);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "delete",
|
||||||
url: "/author/deleteIndex",
|
url: "/author/deleteIndex/"+indexId,
|
||||||
data: {'indexId': indexId},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data.code == 200) {
|
if (data.code == 200) {
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
作者笔名:
|
作者笔名:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input name="penName" th:value="${author.penName}" type="text" maxlength="8" id="TxtNiceName" class="easyui-validatebox inpMain" data-options="required:true" validType="checkNiceName" />
|
<input name="penName" th:value="${author.penName}" type="text" maxlength="8" id="TxtNiceName" class="easyui-validatebox inpMain" data-options="required:true" validType="checkPenName" />
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -119,7 +119,7 @@
|
|||||||
function searchComments(curr, limit) {
|
function searchComments(curr, limit) {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/book/listCommentByPage",
|
url: "/book/listCommentByPage",
|
||||||
data: {'bookId': $("#bookId").val(),'curr':curr,'limit':limit},
|
data: {'bookId': $("#bookId").val(),'curr':curr,'limit':limit},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -234,7 +234,7 @@
|
|||||||
}
|
}
|
||||||
//查询是否在书架
|
//查询是否在书架
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/user/queryIsInShelf",
|
url: "/user/queryIsInShelf",
|
||||||
data: {'bookId':$("#bookId").val()},
|
data: {'bookId':$("#bookId").val()},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -199,7 +199,7 @@
|
|||||||
var lastBookIndexId = $("#lastBookIndexId").val();
|
var lastBookIndexId = $("#lastBookIndexId").val();
|
||||||
if(lastBookIndexId){
|
if(lastBookIndexId){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/book/queryBookIndexAbout",
|
url: "/book/queryBookIndexAbout",
|
||||||
data: {'bookId': bookId, 'lastBookIndexId': lastBookIndexId},
|
data: {'bookId': bookId, 'lastBookIndexId': lastBookIndexId},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -226,7 +226,7 @@
|
|||||||
<script language="javascript" type="text/javascript">
|
<script language="javascript" type="text/javascript">
|
||||||
//查询是否在书架
|
//查询是否在书架
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/user/queryIsInShelf",
|
url: "/user/queryIsInShelf",
|
||||||
data: {'bookId': $("#bookId").val()},
|
data: {'bookId': $("#bookId").val()},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -255,7 +255,7 @@
|
|||||||
|
|
||||||
function loadCommentList(){
|
function loadCommentList(){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/book/listCommentByPage",
|
url: "/book/listCommentByPage",
|
||||||
data: {'bookId': $("#bookId").val()},
|
data: {'bookId': $("#bookId").val()},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -335,7 +335,7 @@
|
|||||||
var bookCatId = $("#bookCatId").val();
|
var bookCatId = $("#bookCatId").val();
|
||||||
//查询同类推荐
|
//查询同类推荐
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/book/listRecBookByCatId",
|
url: "/book/listRecBookByCatId",
|
||||||
data: {'catId': bookCatId},
|
data: {'catId': bookCatId},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -88,7 +88,7 @@
|
|||||||
|
|
||||||
function listRank(rankType){
|
function listRank(rankType){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/book/listRank",
|
url: "/book/listRank",
|
||||||
data: {'type':rankType,'limit':30},
|
data: {'type':rankType,'limit':30},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -163,7 +163,7 @@
|
|||||||
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/book/searchByPage",
|
url: "/book/searchByPage",
|
||||||
data: searchData,
|
data: searchData,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -227,7 +227,7 @@
|
|||||||
|
|
||||||
function listBookCategory(c) {
|
function listBookCategory(c) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/book/listBookCategory",
|
url: "/book/listBookCategory",
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="box_center cf">
|
<div class="box_center cf">
|
||||||
<div class="copyright">
|
<div class="copyright">
|
||||||
<ul >
|
<ul >
|
||||||
<li class="menu"><a href="/?to=mobile">手机站</a><i class="line">|</i><a href="/">网站首页</a><i class="line">|</i><a href="/about/default.html" >关于我们</a><i class="line">|</i><a href="/about/contact.html" >联系我们</a><i class="line">|</i><a href="/user/feedback.html" >反馈留言</a><i class="line">|</i><a href="/author/index.html" >作家专区</a></li>
|
<li class="menu"><a href="/?to=mobile">手机站</a><i class="line">|</i><a href="/">网站首页</a><i class="line">|</i><a href="/about/default.html" >关于我们</a><i class="line">|</i><a href="/about/contact.html" >联系我们</a><i class="line">|</i><a href="/user/feedback.html" >反馈留言</a><i class="line">|</i><a href="/author/index.html" >作家专区</a><i class="line">|</i><a href="/mobile/fiction_house.apk" >客户端</a></li>
|
||||||
<li th:text="'Copyright (C) '+#{website.domain}+' All rights reserved '+#{website.name}+'版权所有'"></li>
|
<li th:text="'Copyright (C) '+#{website.domain}+' All rights reserved '+#{website.name}+'版权所有'"></li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -157,7 +157,7 @@
|
|||||||
$(function () {
|
$(function () {
|
||||||
//加载首页书籍设置数据
|
//加载首页书籍设置数据
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/book/listBookSetting",
|
url: "/book/listBookSetting",
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -331,7 +331,7 @@
|
|||||||
})
|
})
|
||||||
//首页新闻查询
|
//首页新闻查询
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/news/listIndexNews",
|
url: "/news/listIndexNews",
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -359,7 +359,7 @@
|
|||||||
|
|
||||||
//点击榜单数据查询
|
//点击榜单数据查询
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/book/listClickRank",
|
url: "/book/listClickRank",
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -402,7 +402,7 @@
|
|||||||
})
|
})
|
||||||
//新书榜单查询
|
//新书榜单查询
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/book/listNewRank",
|
url: "/book/listNewRank",
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -446,7 +446,7 @@
|
|||||||
})
|
})
|
||||||
//更新榜单查询
|
//更新榜单查询
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/book/listUpdateRank",
|
url: "/book/listUpdateRank",
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -504,7 +504,7 @@
|
|||||||
})
|
})
|
||||||
//友情链接查询
|
//友情链接查询
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/friendLink/listIndexLink",
|
url: "/friendLink/listIndexLink",
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -185,18 +185,18 @@
|
|||||||
|
|
||||||
<div style="width:10%;float: left;margin-left: 10px">
|
<div style="width:10%;float: left;margin-left: 10px">
|
||||||
<a href="javascript:history.go(-1)">
|
<a href="javascript:history.go(-1)">
|
||||||
<i style="font-size: 20px;color: #92B8B1;" class="layui-icon"></i></a>
|
<i style="font-size: 20px;color: #fff;" class="layui-icon"></i></a>
|
||||||
</div>
|
</div>
|
||||||
<a style="color: #ffffff;" th:href="'/book/'+ ${book.id} + '.html'"><b style="padding-left: 5%;float: left;width: 69%" class="line-limit-length" th:utext="${bookIndex.indexName}+' '+${book.bookName}"></b></a>
|
<a style="color: #ffffff;" th:href="'/book/'+ ${book.id} + '.html'"><b style="padding-left: 5%;float: left;width: 69%" class="line-limit-length" th:utext="${bookIndex.indexName}+' '+${book.bookName}"></b></a>
|
||||||
<div style="width:10%;float: right;margin-right: 10px"><a href="/">
|
<div style="width:10%;float: right;margin-right: 10px"><a href="/">
|
||||||
<i style="font-size: 20px;color: #92B8B1;" class="layui-icon"></i>
|
<i style="font-size: 20px;color: #fff;" class="layui-icon"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<p class="Readpage" style="background:#FFFFFF;padding:2px;">
|
<p class="Readpage" style="background:#FFFFFF;padding:2px;">
|
||||||
<a id="lightdiv" class="button lighton" onclick="nr_setbg('light')">开灯</a>
|
<a id="lightdiv" class="button lightoff" onclick="nr_setbg('light')">关灯</a>
|
||||||
<a id="huyandiv" class="button huyanon" onclick="nr_setbg('huyan')">护眼</a>
|
<a id="huyandiv" class="button huyanon" onclick="nr_setbg('huyan')">护眼</a>
|
||||||
字体:<a id="fontbig" class="sizebg" onclick="nr_setbg('big')">大</a> <a id="fontmiddle" class="button sizebgon"
|
字体:<a id="fontbig" class="sizebg" onclick="nr_setbg('big')">大</a> <a id="fontmiddle" class="button sizebgon"
|
||||||
onclick="nr_setbg('middle')">中</a> <a
|
onclick="nr_setbg('middle')">中</a> <a
|
||||||
@ -204,9 +204,9 @@
|
|||||||
</p>
|
</p>
|
||||||
<div class="indexDiv" style="height: 42px;line-height: 42px;text-align:center;background: #f2f2f2">
|
<div class="indexDiv" style="height: 42px;line-height: 42px;text-align:center;background: #f2f2f2">
|
||||||
|
|
||||||
<a th:href="${preBookIndexId!=0?'/book/'+book.id+'/'+preBookIndexId+'.html':'#'}">上一章</a>
|
<a style="color: #333" th:href="${preBookIndexId!=0?'/book/'+book.id+'/'+preBookIndexId+'.html':'#'}">上一章</a>
|
||||||
<a th:href="'/book/indexList-'+${book.id}+'.html'">目录</a>
|
<a style="color: #333" th:href="'/book/indexList-'+${book.id}+'.html'">目录</a>
|
||||||
<a th:href="${nextBookIndexId!=0?'/book/'+book.id+'/'+nextBookIndexId+'.html':'#'}">下一章</a>
|
<a style="color: #333" th:href="${nextBookIndexId!=0?'/book/'+book.id+'/'+nextBookIndexId+'.html':'#'}">下一章</a>
|
||||||
</div>
|
</div>
|
||||||
<!--<div id="screenInput" class="screen_toolbar" style="display: none">
|
<!--<div id="screenInput" class="screen_toolbar" style="display: none">
|
||||||
<div style="height: 5px" class="layui-col-xs2 layui-col-sm3 layui-col-md3 layui-col-lg3"></div>
|
<div style="height: 5px" class="layui-col-xs2 layui-col-sm3 layui-col-md3 layui-col-lg3"></div>
|
||||||
@ -230,13 +230,13 @@
|
|||||||
<div th:replace="mobile/common/js :: js">
|
<div th:replace="mobile/common/js :: js">
|
||||||
</div>
|
</div>
|
||||||
<div id="chaptercontent" class="Readarea ReadAjax_content screen_container"
|
<div id="chaptercontent" class="Readarea ReadAjax_content screen_container"
|
||||||
style="color: rgb(0, 0, 0); font-size: 25px;" th:if="${!needBuy}">
|
style="color: rgb(0, 0, 0); font-size: 20px;" th:if="${!needBuy}">
|
||||||
<p style="width:100%;text-alight:center; overflow: auto;-webkit-overflow-scrolling:touch;" >
|
<p style="width:100%;text-alight:center; overflow: auto;-webkit-overflow-scrolling:touch;" >
|
||||||
<span
|
<span
|
||||||
th:utext="${bookContent.content}"></span></p>
|
th:utext="${bookContent.content}"></span></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="Readarea ReadAjax_content screen_container"
|
<div class="Readarea ReadAjax_content screen_container"
|
||||||
style="color: rgb(0, 0, 0); font-size: 10px;background-color: #fff" th:if="${needBuy}">
|
style="color: rgb(0, 0, 0); font-size: 20px;background-color: #fff" th:if="${needBuy}">
|
||||||
<h5>此章为VIP章节,需要订阅后才能继续阅读</h5>
|
<h5>此章为VIP章节,需要订阅后才能继续阅读</h5>
|
||||||
价格:<span style="color: red" th:text="${bookIndex.bookPrice}+'屋币(1元=100屋币)'"></span><br/>
|
价格:<span style="color: red" th:text="${bookIndex.bookPrice}+'屋币(1元=100屋币)'"></span><br/>
|
||||||
<a href="javascript:buyBookIndex()" type="button" class="layui-btn layui-btn-sm layui-btn-radius">购买</a>
|
<a href="javascript:buyBookIndex()" type="button" class="layui-btn layui-btn-sm layui-btn-radius">购买</a>
|
||||||
@ -244,9 +244,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="indexDiv" style="height: 42px;line-height: 42px;text-align:center;background: #f2f2f2">
|
<div class="indexDiv" style="height: 42px;line-height: 42px;text-align:center;background: #f2f2f2">
|
||||||
|
|
||||||
<a th:href="${preBookIndexId!=0?'/book/'+book.id+'/'+preBookIndexId+'.html':'#'}">上一章</a>
|
<a style="color: #333" th:href="${preBookIndexId!=0?'/book/'+book.id+'/'+preBookIndexId+'.html':'#'}">上一章</a>
|
||||||
<a th:href="'/book/indexList-'+${book.id}+'.html'">目录</a>
|
<a style="color: #333" th:href="'/book/indexList-'+${book.id}+'.html'">目录</a>
|
||||||
<a th:href="${nextBookIndexId!=0?'/book/'+book.id+'/'+nextBookIndexId+'.html':'#'}">下一章</a>
|
<a style="color: #333" th:href="${nextBookIndexId!=0?'/book/'+book.id+'/'+nextBookIndexId+'.html':'#'}">下一章</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -119,26 +119,26 @@
|
|||||||
|
|
||||||
<div style="float: left;margin-left: 10px">
|
<div style="float: left;margin-left: 10px">
|
||||||
<a href="javascript:history.go(-1)">
|
<a href="javascript:history.go(-1)">
|
||||||
<i style="font-size: 20px;color: #92B8B1;" class="layui-icon"></i></a>
|
<i style="font-size: 20px;color: #fff;" class="layui-icon"></i></a>
|
||||||
</div>
|
</div>
|
||||||
<b class="layui-icon" th:utext="${book.bookName}"></b>
|
<b class="layui-icon" th:utext="${book.bookName}"></b>
|
||||||
<div style="float: right;margin-right: 10px">
|
<div style="float: right;margin-right: 10px">
|
||||||
<a href="/"><i style="font-size: 20px;color: #92B8B1;" class="layui-icon"></i></a>
|
<a href="/"><i style="font-size: 20px;color: #fff;" class="layui-icon"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-row" style="background: #f2f2f2">
|
<div class="layui-row" style="background: #f2f2f2">
|
||||||
<div style="padding: 10px" class="layui-col-xs4 layui-col-sm2 layui-col-md2 layui-col-lg2">
|
<div style="padding: 3px" class="layui-col-xs4 layui-col-sm2 layui-col-md2 layui-col-lg2">
|
||||||
<img style=" width:auto; height:auto; max-width:100%; max-height:100%;" th:src="${book.picUrl}"/>
|
<img style=" width:130px; height:auto; max-width:100%; max-height:100%;" th:src="${book.picUrl}"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div style="position:relative;padding: 10px 20px" class="layui-col-xs8 layui-col-sm8 layui-col-md8 layui-col-lg8">
|
<div style="position:relative;padding: 3px 10px 0px" class="layui-col-xs8 layui-col-sm8 layui-col-md8 layui-col-lg8">
|
||||||
<a th:href="'javascript:searchBooks(\''+ ${book.authorName}+'\')'"><div style=";color: #4c6978;" th:utext="'作者:'+ ${book.authorName}"></div></a>
|
<a th:href="'javascript:searchBooks(\''+ ${book.authorName}+'\')'"><div style=";color: #444;" th:utext="'作者:'+ ${book.authorName}"></div></a>
|
||||||
<a th:href="'/book/book_ranking.html?catId='+${book.catId}"><div style="margin-top: 5px;color: #4c6978;" th:text="'类别:'+ ${book.catName}"></div></a>
|
<a th:href="'/book/book_ranking.html?catId='+${book.catId}"><div style="margin-top: 5px;color: #444;" th:text="'类别:'+ ${book.catName}"></div></a>
|
||||||
<div style="margin-top: 5px;color: #4c6978;" th:text="'状态:'+ ${book.bookStatus==0?'连载':'完结'}"></div>
|
<div style="margin-top: 5px;color: #444;" th:text="'状态:'+ ${book.bookStatus==0?'连载':'完结'}"></div>
|
||||||
<div style="margin-top: 5px;color: #4c6978;">更新:<i th:text="${#dates.format(book.lastIndexUpdateTime, 'yy-MM-dd')}"></i></div>
|
<div style="margin-top: 5px;color: #444;">更新:<i th:text="${#dates.format(book.lastIndexUpdateTime, 'yy-MM-dd')}"></i></div>
|
||||||
<div style="margin-top: 5px;color: #4c6978;">评分:<i style="font-weight:bold;color: red" th:text="${book.score} + '分'"></i></div>
|
<div style="margin-top: 5px;color: #444;">评分:<i style="font-weight:bold;color: red" th:text="${book.score} + '分'"></i></div>
|
||||||
<div style="margin-top: 5px;color: #4c6978;">点击:<i style="font-weight:bold;color: red" th:text="${book.visitCount}"></i></div>
|
<div style="margin-top: 5px;color: #444;">点击:<i style="font-weight:bold;color: red" th:text="${book.visitCount}"></i></div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -155,7 +155,7 @@
|
|||||||
<button type="button" onclick="downloadFile()" class="layui-btn layui-btn-sm layui-btn-radius layui-bg-normal">下载TXT</button>
|
<button type="button" onclick="downloadFile()" class="layui-btn layui-btn-sm layui-btn-radius layui-bg-normal">下载TXT</button>
|
||||||
-->
|
-->
|
||||||
</div>
|
</div>
|
||||||
<p style="line-height: 23px;padding: 10px;font-size: 14px;color: #4c6978;" th:utext="${book.bookDesc}">
|
<p style="line-height: 23px;padding: 10px;font-size: 14px;color: #333;" th:utext="${book.bookDesc}">
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@ -195,7 +195,7 @@
|
|||||||
<script>
|
<script>
|
||||||
//查询是否在书架
|
//查询是否在书架
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/user/queryIsInShelf",
|
url: "/user/queryIsInShelf",
|
||||||
data: {'bookId': $("#bookIdHidden").val()},
|
data: {'bookId': $("#bookIdHidden").val()},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -221,7 +221,7 @@
|
|||||||
|
|
||||||
//查询最新目录集合
|
//查询最新目录集合
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/book/queryNewIndexList",
|
url: "/book/queryNewIndexList",
|
||||||
data: {'bookId': $("#bookIdHidden").val()},
|
data: {'bookId': $("#bookIdHidden").val()},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -230,7 +230,7 @@
|
|||||||
var indexListHtml = "";
|
var indexListHtml = "";
|
||||||
for(var i = 0 ; i < data.data.length ; i++){
|
for(var i = 0 ; i < data.data.length ; i++){
|
||||||
var bookIndex = data.data[i];
|
var bookIndex = data.data[i];
|
||||||
indexListHtml+=("<p class=\"line-limit-length layui-col-xs12 layui-col-sm4 layui-col-md3 layui-col-lg2\" style=\"padding-left:10px;height: 50px;line-height: 50px;\"><a href=\"/book/"+$("#bookIdHidden").val()+"/"+bookIndex.id+".html\">"+bookIndex.indexName+"</a></p>");
|
indexListHtml+=("<p class=\"line-limit-length layui-col-xs12 layui-col-sm4 layui-col-md3 layui-col-lg2\" style=\"padding-left:10px;height: 50px;line-height: 50px;\"><a href=\"/book/"+$("#bookIdHidden").val()+"/"+bookIndex.id+".html\" style='color: #333'>"+bookIndex.indexName+"</a></p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#indexList").html(indexListHtml);
|
$("#indexList").html(indexListHtml);
|
||||||
|
@ -46,11 +46,11 @@
|
|||||||
|
|
||||||
<div style="float: left;margin-left: 10px">
|
<div style="float: left;margin-left: 10px">
|
||||||
<a href="javascript:history.go(-1)">
|
<a href="javascript:history.go(-1)">
|
||||||
<i style="font-size: 20px;color: #92B8B1;" class="layui-icon"></i></a>
|
<i style="font-size: 20px;color: #fff;" class="layui-icon"></i></a>
|
||||||
</div>
|
</div>
|
||||||
<a style="color: #ffffff;" th:href="'/book/'+ ${book.id} + '.html'"><b class="layui-icon" th:utext="${book.bookName}"></b></a>
|
<a style="color: #ffffff;" th:href="'/book/'+ ${book.id} + '.html'"><b class="layui-icon" th:utext="${book.bookName}"></b></a>
|
||||||
<div style="float: right;margin-right: 10px">
|
<div style="float: right;margin-right: 10px">
|
||||||
<a href="/"><i style="font-size: 20px;color: #92B8B1;" class="layui-icon"></i></a>
|
<a href="/"><i style="font-size: 20px;color: #fff;" class="layui-icon"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
<div class="layui-colla-content layui-show indexP layui-row">
|
<div class="layui-colla-content layui-show indexP layui-row">
|
||||||
<p class="line-limit-length layui-col-xs12 layui-col-sm4 layui-col-md3 layui-col-lg2" style="padding-left:10px;height: 50px;line-height: 50px;" th:each="index : ${bookIndexList}">
|
<p class="line-limit-length layui-col-xs12 layui-col-sm4 layui-col-md3 layui-col-lg2" style="padding-left:10px;height: 50px;line-height: 50px;" th:each="index : ${bookIndexList}">
|
||||||
<a th:href="'/book/'+${index.bookId}+'/'+${index.id}+'.html'" th:utext="${index.indexName}">
|
<a style="color:#333;" th:href="'/book/'+${index.bookId}+'/'+${index.id}+'.html'" th:utext="${index.indexName}">
|
||||||
|
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
@ -81,11 +81,11 @@
|
|||||||
|
|
||||||
<div style="float: left;margin-left: 10px">
|
<div style="float: left;margin-left: 10px">
|
||||||
<a href="javascript:history.go(-1)">
|
<a href="javascript:history.go(-1)">
|
||||||
<i style="font-size: 20px;color: #92B8B1;" class="layui-icon"></i></a>
|
<i style="font-size: 20px;color: #fff;" class="layui-icon"></i></a>
|
||||||
</div>
|
</div>
|
||||||
<b class="layui-icon">小说列表</b>
|
<b class="layui-icon">小说列表</b>
|
||||||
<div style="float: right;margin-right: 10px">
|
<div style="float: right;margin-right: 10px">
|
||||||
<a href="/"><i style="font-size: 20px;color: #92B8B1;" class="layui-icon"></i></a>
|
<a href="/"><i style="font-size: 20px;color: #fff;" class="layui-icon"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -168,7 +168,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/book/searchByPage",
|
url: "/book/searchByPage",
|
||||||
data: searchData,
|
data: searchData,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -191,24 +191,24 @@
|
|||||||
bookListHtml += ("<div class=\"layui-row\" style=\"margin-bottom:10px;padding:10px;background: #f2f2f2\">\n" +
|
bookListHtml += ("<div class=\"layui-row\" style=\"margin-bottom:10px;padding:10px;background: #f2f2f2\">\n" +
|
||||||
" <a href=\"/book/"+book.id+".html\">\n" +
|
" <a href=\"/book/"+book.id+".html\">\n" +
|
||||||
" <div class=\"layui-col-xs6 layui-col-sm3 layui-col-md2 layui-col-lg2\" style=\"text-align: center\">\n" +
|
" <div class=\"layui-col-xs6 layui-col-sm3 layui-col-md2 layui-col-lg2\" style=\"text-align: center\">\n" +
|
||||||
" <img width='150' height='180' align=\"center\"\n" +
|
" <img style='width: 130px;height: 180px' align=\"center\"\n" +
|
||||||
" src=\""+book.picUrl+"\"/>\n" +
|
" src=\""+book.picUrl+"\"/>\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
" </div>\n" +
|
" </div>\n" +
|
||||||
" </a>\n" +
|
" </a>\n" +
|
||||||
" <div style=\"padding: 10px\" class=\"layui-col-xs6 layui-col-sm8 layui-col-md8 layui-col-lg8\">\n" +
|
" <div style=\"padding: 10px\" class=\"layui-col-xs6 layui-col-sm8 layui-col-md8 layui-col-lg8\">\n" +
|
||||||
" <a href=\"/book/"+book.id+".html\">\n" +
|
" <a href=\"/book/"+book.id+".html\">\n" +
|
||||||
" <div class=\"line-limit-length\" style=\";color: #4c6978;font-weight: bold;font-size: 15px\">"+book.bookName+"</div>\n" +
|
" <div class=\"line-limit-length\" style=\";color: #000;font-size: 15px\">"+book.bookName+"</div>\n" +
|
||||||
" </a>\n" +
|
" </a>\n" +
|
||||||
" <div style=\";color: #4c6978;float: right;\"><i style=\"color: red\"></i></div>\n" +
|
" <div style=\";color: #4c6978;float: right;\"><i style=\"color: red\"></i></div>\n" +
|
||||||
" <a href=\"/book/book_ranking.html?keyword="+encodeURI(book.authorName)+"\">\n" +
|
" <a href=\"/book/book_ranking.html?keyword="+encodeURI(book.authorName)+"\">\n" +
|
||||||
" <div style=\";color: #4c6978;\" class=\"line-limit-length\">作者:"+book.authorName+"</div>\n" +
|
" <div style=\";color: #a6a6a6;\" class=\"line-limit-length\">作者:"+book.authorName+"</div>\n" +
|
||||||
" </a>\n" +
|
" </a>\n" +
|
||||||
" <div style=\"margin-top: 5px;color: #4c6978;\">类别:"+book.catName+"</div>\n" +
|
" <div style=\"margin-top: 5px;color: #a6a6a6;\">类别:"+book.catName+"</div>\n" +
|
||||||
" <div style=\"margin-top: 5px;color: #4c6978;\">状态:"+(book.bookStatus==0?'连载':'完结')+"</div>\n" +
|
" <div style=\"margin-top: 5px;color: #a6a6a6;\">状态:"+(book.bookStatus==0?'连载':'完结')+"</div>\n" +
|
||||||
" <div style=\"margin-top: 5px;color: #4c6978;\">更新:<i>"+book.lastIndexUpdateTime.substr(0,11)+"</i>\n" +
|
" <div style=\"margin-top: 5px;color: #a6a6a6;\">更新:<i style='color: red'>"+book.lastIndexUpdateTime.substr(0,11)+"</i>\n" +
|
||||||
" </div>\n" +
|
" </div>\n" +
|
||||||
" <div style=\"margin-top: 5px;color: #4c6978;\">简介:"+(book.bookDesc?(book.bookDesc.length>20?(book.bookDesc.substr(0,20)+"..."):book.bookDesc):book.bookDesc)+"</div>\n" +
|
" <div style=\"margin-top: 5px;color: #a6a6a6;\">简介:"+(book.bookDesc?(book.bookDesc.length>15?(book.bookDesc.substr(0,15)+"..."):book.bookDesc):book.bookDesc)+"</div>\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
" </div>\n" +
|
" </div>\n" +
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 360px) {
|
@media (max-width: 500px) {
|
||||||
.app {
|
.app {
|
||||||
display: block !important;
|
display: block !important;
|
||||||
}
|
}
|
||||||
@ -15,7 +15,7 @@
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 360px) {
|
@media (max-width: 500px) {
|
||||||
.pc {
|
.pc {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
<div th:fragment="footer" style="height: 60px;line-height: 60px;text-align: center" class="layui-footer footer footer-demo layui-bg-cyan">
|
<div th:fragment="footer" style="height: 60px;line-height: 60px;text-align: center" class="layui-footer footer footer-demo layui-bg-cyan">
|
||||||
<!--<a href="/mobile/book/searchSoftBook.html" style="font-size: 14px;color: #92B8B1;">轻小说</a>
|
<!--<a href="/mobile/book/searchSoftBook.html" style="font-size: 14px;color: #fff;">轻小说</a>
|
||||||
<a href="/mobile/book/searchSoftBook.html?catId=9" style="font-size: 14px;color: #92B8B1;margin-left: 8px">漫画</a>-->
|
<a href="/mobile/book/searchSoftBook.html?catId=9" style="font-size: 14px;color: #fff;margin-left: 8px">漫画</a>-->
|
||||||
<a href="/?to=pc" style="font-size: 14px;color: #92B8B1;margin-left: 8px">电脑站</a>
|
<a href="/?to=pc" style="font-size: 14px;color: #fff;margin-left: 8px">电脑站</a>
|
||||||
<a href="/user/read_history.html" style="font-size: 14px;color: #92B8B1;margin-left: 8px">阅读记录</a>
|
<a href="/user/read_history.html" style="font-size: 14px;color: #fff;margin-left: 8px">阅读记录</a>
|
||||||
<a href="/user/favorites.html" style="font-size: 14px;color: #92B8B1;margin-left: 8px">书架</a>
|
<a href="/user/favorites.html" style="font-size: 14px;color: #fff;margin-left: 8px">书架</a>
|
||||||
<a href="/mobile/HotBook.apk" style="font-size: 14px;color: #92B8B1;margin-left: 8px">客户端</a>
|
<a href="/mobile/fiction_house.apk" style="font-size: 14px;color: #fff;margin-left: 8px">客户端</a>
|
||||||
<!--<a href="https://www.zinglizingli.xyz/me/index.html" style="font-size: 14px;color: #92B8B1;margin-left: 8px">开发者</a>-->
|
<!--<a href="https://www.zinglizingli.xyz/me/index.html" style="font-size: 14px;color: #fff;margin-left: 8px">开发者</a>-->
|
||||||
|
|
||||||
|
|
||||||
<div style="float: right"><a href="#top"><i class="layui-icon"
|
<div style="float: right"><a href="#top"><i class="layui-icon"
|
||||||
style="margin-right:15px;font-size: 30px;color:#92B8B1 "></i></a>
|
style="margin-right:15px;font-size: 30px;color:#fff "></i></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -91,7 +91,7 @@
|
|||||||
<dd><a href="/book/book_ranking.html?sortBy=visit_count&catId=7">女频小说</a></dd>
|
<dd><a href="/book/book_ranking.html?sortBy=visit_count&catId=7">女频小说</a></dd>
|
||||||
</dl>
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
<li class="layui-nav-item"><a href="javascript:toMyCollect()">书架</a></li>
|
<li class="layui-nav-item"><a href="/user/favorites.html">书架</a></li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="layui-nav pc" lay-filter="" style="padding:0 36px;text-align: center">
|
<ul class="layui-nav pc" lay-filter="" style="padding:0 36px;text-align: center">
|
||||||
@ -146,8 +146,9 @@
|
|||||||
<div style="height: 1px" class="layui-col-lg1"></div>
|
<div style="height: 1px" class="layui-col-lg1"></div>
|
||||||
<div class="layui-collapse layui-col-lg10">
|
<div class="layui-collapse layui-col-lg10">
|
||||||
<div class="layui-colla-item">
|
<div class="layui-colla-item">
|
||||||
<h2 class="layui-colla-title">本站推荐</h2>
|
<blockquote class="layui-elem-quote" style="text-align: left;font-size: 16px">
|
||||||
<div class="layui-colla-content layui-show">
|
精品推荐
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
|
||||||
<div class="layui-container" style="padding: 0px">
|
<div class="layui-container" style="padding: 0px">
|
||||||
@ -155,11 +156,11 @@
|
|||||||
<div class="layui-row" style="text-align: center" id="currentWeek">
|
<div class="layui-row" style="text-align: center" id="currentWeek">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-colla-item">
|
<div class="layui-colla-item">
|
||||||
<h2 class="layui-colla-title">热门小说推荐</h2>
|
<blockquote class="layui-elem-quote" style="text-align: left;font-size: 16px">
|
||||||
<div class="layui-colla-content layui-show">
|
热门推荐
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
<div class="layui-container">
|
<div class="layui-container">
|
||||||
<div class="layui-row" id="hotRecBooks">
|
<div class="layui-row" id="hotRecBooks">
|
||||||
@ -190,7 +191,6 @@
|
|||||||
|
|
||||||
</a>
|
</a>
|
||||||
</div>-->
|
</div>-->
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -203,11 +203,11 @@
|
|||||||
<div class="layui-colla-item layui-col-lg10"
|
<div class="layui-colla-item layui-col-lg10"
|
||||||
style="border-width: 1px;border-style: solid;border-radius: 2px;border-top-width: 0px"><a
|
style="border-width: 1px;border-style: solid;border-radius: 2px;border-top-width: 0px"><a
|
||||||
href="javascript:moreNewBooks()">
|
href="javascript:moreNewBooks()">
|
||||||
<h2 class="layui-colla-title">最近更新小说
|
<blockquote class="layui-elem-quote" style="text-align: left;color: #000;font-size: 16px">最新更新
|
||||||
<div style="float: right; margin-right: 20px"><i style="font-size: 14px;"
|
<div style="float: right; margin-right: 20px"><i style="font-size: 14px;color:#666"
|
||||||
class="layui-icon">更多</i>
|
class="layui-icon">更多</i>
|
||||||
</div>
|
</div>
|
||||||
</h2>
|
</blockquote>
|
||||||
</a>
|
</a>
|
||||||
<div class="layui-colla-content layui-show">
|
<div class="layui-colla-content layui-show">
|
||||||
|
|
||||||
@ -235,15 +235,15 @@
|
|||||||
<script>
|
<script>
|
||||||
//加载首页书籍设置数据
|
//加载首页书籍设置数据
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/book/listBookSetting",
|
url: "/book/listBookSetting",
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data.code == 200) {
|
if (data.code == 200) {
|
||||||
|
|
||||||
//本周强推
|
//精品推荐
|
||||||
var rightListBooks = data.data[2];
|
var rightListBooks = data.data[4];
|
||||||
var rightListBooksHtml = "";
|
var rightListBooksHtml = "";
|
||||||
for (var i = 0; i < 3; i++) {
|
for (var i = 0; i < 3; i++) {
|
||||||
var rightListBook = rightListBooks[i];
|
var rightListBook = rightListBooks[i];
|
||||||
@ -258,11 +258,11 @@
|
|||||||
rightListBooksHtml += (" <span>\n" +
|
rightListBooksHtml += (" <span>\n" +
|
||||||
" <a href=\"/book/"+rightListBook.bookId+".html\">\n" +
|
" <a href=\"/book/"+rightListBook.bookId+".html\">\n" +
|
||||||
" <div style=\"padding: 1%\" class=\"layui-col-xs4 layui-col-sm4 layui-col-md4 layui-col-lg4\">\n" +
|
" <div style=\"padding: 1%\" class=\"layui-col-xs4 layui-col-sm4 layui-col-md4 layui-col-lg4\">\n" +
|
||||||
" <img style=\" width:80%; height:auto; max-width:100%; max-height:100%;\"\n" +
|
" <img style=\" width:100px; height:125px; max-width:100%; max-height:100%;\"\n" +
|
||||||
" src=\""+rightListBook.picUrl+"\"/>\n" +
|
" src=\""+rightListBook.picUrl+"\"/>\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
" <br/>\n" +
|
" <br/>\n" +
|
||||||
" <span>"+rightListBook.bookName+"</span>\n" +
|
" <span >"+(rightListBook.bookName.length>5?(rightListBook.bookName.substr(0,5)+'...'):rightListBook.bookName)+"</span>\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
" </div>\n" +
|
" </div>\n" +
|
||||||
" </a>\n" +
|
" </a>\n" +
|
||||||
@ -280,6 +280,8 @@
|
|||||||
hotRecBook.bookDesc = hotRecBook.bookDesc.replace(/<[^>]+>/g,"").replace(/\s+/g,"");
|
hotRecBook.bookDesc = hotRecBook.bookDesc.replace(/<[^>]+>/g,"").replace(/\s+/g,"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//手机浏览器不支持String.replaceAll()方法
|
||||||
|
|
||||||
hotRecBooksHtml += ("<div style=\"margin-bottom: 5px\" class=\"layui-col-xs12 layui-col-sm6 layui-col-md4 layui-col-lg4\">\n" +
|
hotRecBooksHtml += ("<div style=\"margin-bottom: 5px\" class=\"layui-col-xs12 layui-col-sm6 layui-col-md4 layui-col-lg4\">\n" +
|
||||||
" <a href=\"/book/"+hotRecBook.bookId+".html\">\n" +
|
" <a href=\"/book/"+hotRecBook.bookId+".html\">\n" +
|
||||||
" <div class=\"layui-col-xs5 layui-col-sm4 layui-col-md4 layui-col-lg4\" >\n" +
|
" <div class=\"layui-col-xs5 layui-col-sm4 layui-col-md4 layui-col-lg4\" >\n" +
|
||||||
@ -289,9 +291,9 @@
|
|||||||
" </div>\n" +
|
" </div>\n" +
|
||||||
" <div class=\"layui-col-xs5 layui-col-sm6 layui-col-md6 layui-col-lg6\">\n" +
|
" <div class=\"layui-col-xs5 layui-col-sm6 layui-col-md6 layui-col-lg6\">\n" +
|
||||||
" <ul>\n" +
|
" <ul>\n" +
|
||||||
" <li class=\"line-limit-length\" style=\"font-weight: bold\">"+hotRecBook.bookName+"</li>\n" +
|
" <li style='padding-bottom: 2px' class=\"line-limit-length\" >"+hotRecBook.bookName+"</li>\n" +
|
||||||
" <li>作者:"+hotRecBook.authorName+"</li>\n" +
|
" <li style='padding-bottom: 2px;color: #a6a6a6'>作者:"+hotRecBook.authorName+"</li>\n" +
|
||||||
" <li style=\"width: 180px;height:40px;overflow: hidden\">简介: "+hotRecBook.bookDesc+"" +
|
" <li style=\"color: #a6a6a6;width: 180px;height:60px;overflow: hidden\">"+hotRecBook.bookDesc +
|
||||||
" </ul>\n" +
|
" </ul>\n" +
|
||||||
" </div>\n" +
|
" </div>\n" +
|
||||||
" <div style=\"font-style: italic;color: red\"\n" +
|
" <div style=\"font-style: italic;color: red\"\n" +
|
||||||
@ -316,7 +318,7 @@
|
|||||||
|
|
||||||
//更新榜单查询
|
//更新榜单查询
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/book/listUpdateRank",
|
url: "/book/listUpdateRank",
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -335,13 +337,13 @@
|
|||||||
" class=\"layui-col-xs12 layui-col-sm6 layui-col-md6 layui-col-lg6\">\n" +
|
" class=\"layui-col-xs12 layui-col-sm6 layui-col-md6 layui-col-lg6\">\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
" <a href=\"/book/"+updateRankBook.id+".html\">\n" +
|
" <a href=\"/book/"+updateRankBook.id+".html\">\n" +
|
||||||
" <div class=\"line-limit-length layui-col-xs8 layui-col-sm6 layui-col-md6 layui-col-lg6\"><b>"+(i+1)+"."+updateRankBook.bookName+"</b> - <span class=\"layui-elip\">"+updateRankBook.authorName+"</span>\n" +
|
" <div class=\"line-limit-length layui-col-xs8 layui-col-sm6 layui-col-md6 layui-col-lg6\"><span '>"+(i+1)+"."+updateRankBook.bookName+"</span> - <span class=\"layui-elip\" style='color: #a6a6a6;'>"+updateRankBook.authorName+"</span>\n" +
|
||||||
" </div>\n" +
|
" </div>\n" +
|
||||||
" <div class=\"layui-col-sm3 layui-col-md3 layui-col-lg3\"\n" +
|
" <div class=\"layui-col-sm3 layui-col-md3 layui-col-lg3\"\n" +
|
||||||
" style=\"color: #FF5722;float: right;margin-right:5px\"><i>"+updateRankBook.lastIndexUpdateTime+"</i></div>\n" +
|
" style=\"color: #FF5722;float: right;margin-right:5px\"><i>"+updateRankBook.lastIndexUpdateTime+"</i></div>\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
" <div style=\"clear: both\"></div>\n" +
|
" <div style=\"clear: both\"></div>\n" +
|
||||||
" <div style=\"padding-left: 5px;padding-top: 5px\"\n" +
|
" <div style=\"color: #a6a6a6;padding-left: 5px;padding-top: 5px\"\n" +
|
||||||
" class=\"layui-elip layui-col-md11 layui-col-sm11 layui-col-lg11\">简介: "+updateRankBook.bookDesc+"" +
|
" class=\"layui-elip layui-col-md11 layui-col-sm11 layui-col-lg11\">简介: "+updateRankBook.bookDesc+"" +
|
||||||
" </div></a>\n" +
|
" </div></a>\n" +
|
||||||
" </div>");
|
" </div>");
|
||||||
|
@ -86,7 +86,7 @@
|
|||||||
|
|
||||||
//查询用户信息
|
//查询用户信息
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/user/userInfo",
|
url: "/user/userInfo",
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
function search(curr, limit) {
|
function search(curr, limit) {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/user/listCommentByPage",
|
url: "/user/listCommentByPage",
|
||||||
data: {'curr':curr,'limit':limit},
|
data: {'curr':curr,'limit':limit},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
function search(curr, limit) {
|
function search(curr, limit) {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/user/listBookShelfByPage",
|
url: "/user/listBookShelfByPage",
|
||||||
data: {'curr':curr,'limit':limit},
|
data: {'curr':curr,'limit':limit},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
function search(curr, limit) {
|
function search(curr, limit) {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/user/listUserFeedBackByPage",
|
url: "/user/listUserFeedBackByPage",
|
||||||
data: {'curr':curr,'limit':limit},
|
data: {'curr':curr,'limit':limit},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
function search(curr, limit) {
|
function search(curr, limit) {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/user/listReadHistoryByPage",
|
url: "/user/listReadHistoryByPage",
|
||||||
data: {'curr':curr,'limit':limit},
|
data: {'curr':curr,'limit':limit},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//查询用户信息
|
//查询用户信息
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/user/userInfo",
|
url: "/user/userInfo",
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//查询用户信息
|
//查询用户信息
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/user/userInfo",
|
url: "/user/userInfo",
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//查询用户信息
|
//查询用户信息
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/user/userInfo",
|
url: "/user/userInfo",
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//查询用户信息
|
//查询用户信息
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/user/userInfo",
|
url: "/user/userInfo",
|
||||||
data: {},
|
data: {},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -113,7 +113,7 @@
|
|||||||
})
|
})
|
||||||
//查询书架列表
|
//查询书架列表
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "get",
|
||||||
url: "/user/listBookShelfByPage",
|
url: "/user/listBookShelfByPage",
|
||||||
data: {'limit':2},
|
data: {'limit':2},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
3
pom.xml
3
pom.xml
@ -5,11 +5,12 @@
|
|||||||
|
|
||||||
<groupId>com.java2nb</groupId>
|
<groupId>com.java2nb</groupId>
|
||||||
<artifactId>novel</artifactId>
|
<artifactId>novel</artifactId>
|
||||||
<version>2.10.0</version>
|
<version>3.1.0</version>
|
||||||
<modules>
|
<modules>
|
||||||
<module>novel-common</module>
|
<module>novel-common</module>
|
||||||
<module>novel-front</module>
|
<module>novel-front</module>
|
||||||
<module>novel-crawl</module>
|
<module>novel-crawl</module>
|
||||||
|
<module>novel-admin</module>
|
||||||
</modules>
|
</modules>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
32
sql/20201201.sql
Normal file
32
sql/20201201.sql
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (246, 241, '批量删除', NULL, 'novel:news:batchRemove', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (245, 241, '删除', NULL, 'novel:news:remove', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (244, 241, '修改', NULL, 'novel:news:edit', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (243, 241, '新增', NULL, 'novel:news:add', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (242, 241, '查看', NULL, 'novel:news:detail', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (241, 234, '新闻列表', 'novel/news', 'novel:news:news', 1, 'fa', 8, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (240, 235, '批量删除', NULL, 'novel:category:batchRemove', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (239, 235, '删除', NULL, 'novel:category:remove', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (238, 235, '修改', NULL, 'novel:category:edit', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (237, 235, '新增', NULL, 'novel:category:add', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (236, 235, '查看', NULL, 'novel:category:detail', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (235, 234, '类别管理', 'novel/category', 'novel:category:category', 1, 'fa', 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (234, 0, '新闻管理', '', '', 0, 'fa fa-newspaper-o', 8, NULL, NULL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4889, 1, 246);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4890, 1, 245);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4891, 1, 244);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4892, 1, 243);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4893, 1, 242);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4899, 1, 241);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4894, 1, 240);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4895, 1, 239);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4896, 1, 238);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4897, 1, 237);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4898, 1, 236);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4900, 1, 235);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4888, 1, 234);
|
||||||
|
|
||||||
|
|
||||||
|
delete from sys_menu where menu_id = 202;
|
@ -1869,4 +1869,39 @@ CREATE TABLE `author_income` (
|
|||||||
|
|
||||||
alter table book add column `yesterday_buy` int(11) DEFAULT '0' COMMENT '昨日订阅数' after comment_count;
|
alter table book add column `yesterday_buy` int(11) DEFAULT '0' COMMENT '昨日订阅数' after comment_count;
|
||||||
|
|
||||||
alter table book_index add column `book_price` int(3) DEFAULT 0 COMMENT '章节费用(屋币)' after `is_vip`;
|
alter table book_index add column `book_price` int(3) DEFAULT 0 COMMENT '章节费用(屋币)' after `is_vip`;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (246, 241, '批量删除', NULL, 'novel:news:batchRemove', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (245, 241, '删除', NULL, 'novel:news:remove', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (244, 241, '修改', NULL, 'novel:news:edit', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (243, 241, '新增', NULL, 'novel:news:add', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (242, 241, '查看', NULL, 'novel:news:detail', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (241, 234, '新闻列表', 'novel/news', 'novel:news:news', 1, 'fa', 8, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (240, 235, '批量删除', NULL, 'novel:category:batchRemove', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (239, 235, '删除', NULL, 'novel:category:remove', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (238, 235, '修改', NULL, 'novel:category:edit', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (237, 235, '新增', NULL, 'novel:category:add', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (236, 235, '查看', NULL, 'novel:category:detail', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (235, 234, '类别管理', 'novel/category', 'novel:category:category', 1, 'fa', 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (234, 0, '新闻管理', '', '', 0, 'fa fa-newspaper-o', 8, NULL, NULL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4889, 1, 246);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4890, 1, 245);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4891, 1, 244);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4892, 1, 243);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4893, 1, 242);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4899, 1, 241);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4894, 1, 240);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4895, 1, 239);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4896, 1, 238);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4897, 1, 237);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4898, 1, 236);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4900, 1, 235);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4888, 1, 234);
|
||||||
|
|
||||||
|
|
||||||
|
delete from sys_menu where menu_id = 202;
|
Reference in New Issue
Block a user