mirror of
https://github.com/201206030/novel-plus.git
synced 2025-04-26 17:20:52 +00:00
feat: 后台小说删除
This commit is contained in:
parent
9f23f817b1
commit
687eb61846
@ -136,7 +136,7 @@ novel-plus -- 父工程
|
||||
|
||||

|
||||
|
||||

|
||||

|
||||
|
||||

|
||||
|
||||
|
@ -102,4 +102,9 @@ VALUES (601, 600, '小说列表', 'novel/book', 'novel:book:book', '1', 'fa', '6
|
||||
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||
VALUES (1, 600);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||
VALUES (1, 601);
|
||||
VALUES (1, 601);
|
||||
|
||||
INSERT INTO `sys_menu` (menu_id, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
VALUES (602, 601, '删除', null, 'novel:book:remove', '2', null, '6');
|
||||
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||
VALUES (1, 602);
|
@ -2931,4 +2931,9 @@ VALUES (601, 600, '小说列表', 'novel/book', 'novel:book:book', '1', 'fa', '6
|
||||
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||
VALUES (1, 600);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||
VALUES (1, 601);
|
||||
VALUES (1, 601);
|
||||
|
||||
INSERT INTO `sys_menu` (menu_id, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
VALUES (602, 601, '删除', null, 'novel:book:remove', '2', null, '6');
|
||||
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||
VALUES (1, 602);
|
@ -14,7 +14,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.1.RELEASE</version>
|
||||
<version>2.1.8.RELEASE</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
<java.version>1.8</java.version>
|
||||
<velocity.version>1.7</velocity.version>
|
||||
<activiti.version>5.22.0</activiti.version>
|
||||
<sharding.jdbc.version>3.0.0</sharding.jdbc.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@ -195,10 +196,16 @@
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
|
||||
<!-- ehchache -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-cache</artifactId>
|
||||
<groupId>io.shardingsphere</groupId>
|
||||
<artifactId>sharding-jdbc-spring-boot-starter</artifactId>
|
||||
<version>${sharding.jdbc.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.shardingsphere</groupId>
|
||||
<artifactId>sharding-jdbc-spring-namespace</artifactId>
|
||||
<version>${sharding.jdbc.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--war包部署需要-->
|
||||
@ -289,16 +296,28 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<!--<distributionManagement>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>nexus_release</id>
|
||||
<name>release</name>
|
||||
<url>http://47.106.243.172:8081/nexus/content/repositories/releases/</url>
|
||||
<id>ali</id>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>nexus_snapshots</id>
|
||||
<name>snapshots</name>
|
||||
<url>http://47.106.243.172:8081/nexus/content/repositories/snapshots/</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>-->
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>ali-plugin</id>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</project>
|
||||
|
@ -3,219 +3,270 @@ package com.java2nb.common.domain;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* 字典表
|
||||
*
|
||||
*
|
||||
* @author xiongxy
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2019-09-29 18:28:07
|
||||
*/
|
||||
public class DictDO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//编号
|
||||
private Long id;
|
||||
//标签名
|
||||
private String name;
|
||||
//数据值
|
||||
private String value;
|
||||
//类型
|
||||
private String type;
|
||||
//描述
|
||||
private String description;
|
||||
//排序(升序)
|
||||
private BigDecimal sort;
|
||||
//父级编号
|
||||
private Long parentId;
|
||||
//创建者
|
||||
private Integer createBy;
|
||||
//创建时间
|
||||
private Date createDate;
|
||||
//更新者
|
||||
private Long updateBy;
|
||||
//更新时间
|
||||
private Date updateDate;
|
||||
//备注信息
|
||||
private String remarks;
|
||||
//删除标记
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 设置:编号
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
/**
|
||||
* 获取:编号
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
/**
|
||||
* 设置:标签名
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
/**
|
||||
* 获取:标签名
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
/**
|
||||
* 设置:数据值
|
||||
*/
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
/**
|
||||
* 获取:数据值
|
||||
*/
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
/**
|
||||
* 设置:类型
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
/**
|
||||
* 获取:类型
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
/**
|
||||
* 设置:描述
|
||||
*/
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
/**
|
||||
* 获取:描述
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
/**
|
||||
* 设置:排序(升序)
|
||||
*/
|
||||
public void setSort(BigDecimal sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
/**
|
||||
* 获取:排序(升序)
|
||||
*/
|
||||
public BigDecimal getSort() {
|
||||
return sort;
|
||||
}
|
||||
/**
|
||||
* 设置:父级编号
|
||||
*/
|
||||
public void setParentId(Long parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
/**
|
||||
* 获取:父级编号
|
||||
*/
|
||||
public Long getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
/**
|
||||
* 设置:创建者
|
||||
*/
|
||||
public void setCreateBy(Integer createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
/**
|
||||
* 获取:创建者
|
||||
*/
|
||||
public Integer getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
/**
|
||||
* 设置:创建时间
|
||||
*/
|
||||
public void setCreateDate(Date createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
/**
|
||||
* 获取:创建时间
|
||||
*/
|
||||
public Date getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
/**
|
||||
* 设置:更新者
|
||||
*/
|
||||
public void setUpdateBy(Long updateBy) {
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
/**
|
||||
* 获取:更新者
|
||||
*/
|
||||
public Long getUpdateBy() {
|
||||
return updateBy;
|
||||
}
|
||||
/**
|
||||
* 设置:更新时间
|
||||
*/
|
||||
public void setUpdateDate(Date updateDate) {
|
||||
this.updateDate = updateDate;
|
||||
}
|
||||
/**
|
||||
* 获取:更新时间
|
||||
*/
|
||||
public Date getUpdateDate() {
|
||||
return updateDate;
|
||||
}
|
||||
/**
|
||||
* 设置:备注信息
|
||||
*/
|
||||
public void setRemarks(String remarks) {
|
||||
this.remarks = remarks;
|
||||
}
|
||||
/**
|
||||
* 获取:备注信息
|
||||
*/
|
||||
public String getRemarks() {
|
||||
return remarks;
|
||||
}
|
||||
/**
|
||||
* 设置:删除标记
|
||||
*/
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
/**
|
||||
* 获取:删除标记
|
||||
*/
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DictDO{" +
|
||||
"id=" + id +
|
||||
", name='" + name + '\'' +
|
||||
", value='" + value + '\'' +
|
||||
", type='" + type + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
", sort=" + sort +
|
||||
", parentId=" + parentId +
|
||||
", createBy=" + createBy +
|
||||
", createDate=" + createDate +
|
||||
", updateBy=" + updateBy +
|
||||
", updateDate=" + updateDate +
|
||||
", remarks='" + remarks + '\'' +
|
||||
", delFlag='" + delFlag + '\'' +
|
||||
'}';
|
||||
}
|
||||
//编号
|
||||
private Long id;
|
||||
//标签名
|
||||
private String name;
|
||||
//数据值
|
||||
private String value;
|
||||
//类型
|
||||
private String type;
|
||||
//描述
|
||||
private String description;
|
||||
//排序(升序)
|
||||
private BigDecimal sort;
|
||||
//父级编号
|
||||
private Long parentId;
|
||||
//创建者
|
||||
private Integer createBy;
|
||||
//创建时间
|
||||
private Date createDate;
|
||||
//更新者
|
||||
private Long updateBy;
|
||||
//更新时间
|
||||
private Date updateDate;
|
||||
//备注信息
|
||||
private String remarks;
|
||||
//删除标记
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 设置:编号
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取:编号
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置:标签名
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取:标签名
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置:数据值
|
||||
*/
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取:数据值
|
||||
*/
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置:类型
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取:类型
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置:描述
|
||||
*/
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取:描述
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置:排序(升序)
|
||||
*/
|
||||
public void setSort(BigDecimal sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取:排序(升序)
|
||||
*/
|
||||
public BigDecimal getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置:父级编号
|
||||
*/
|
||||
public void setParentId(Long parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取:父级编号
|
||||
*/
|
||||
public Long getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置:创建者
|
||||
*/
|
||||
public void setCreateBy(Integer createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取:创建者
|
||||
*/
|
||||
public Integer getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置:创建时间
|
||||
*/
|
||||
public void setCreateDate(Date createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取:创建时间
|
||||
*/
|
||||
public Date getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置:更新者
|
||||
*/
|
||||
public void setUpdateBy(Long updateBy) {
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取:更新者
|
||||
*/
|
||||
public Long getUpdateBy() {
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置:更新时间
|
||||
*/
|
||||
public void setUpdateDate(Date updateDate) {
|
||||
this.updateDate = updateDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取:更新时间
|
||||
*/
|
||||
public Date getUpdateDate() {
|
||||
return updateDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置:备注信息
|
||||
*/
|
||||
public void setRemarks(String remarks) {
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取:备注信息
|
||||
*/
|
||||
public String getRemarks() {
|
||||
return remarks;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置:删除标记
|
||||
*/
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取:删除标记
|
||||
*/
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DictDO{" +
|
||||
"id=" + id +
|
||||
", name='" + name + '\'' +
|
||||
", value='" + value + '\'' +
|
||||
", type='" + type + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
", sort=" + sort +
|
||||
", parentId=" + parentId +
|
||||
", createBy=" + createBy +
|
||||
", createDate=" + createDate +
|
||||
", updateBy=" + updateBy +
|
||||
", updateDate=" + updateDate +
|
||||
", remarks='" + remarks + '\'' +
|
||||
", delFlag='" + delFlag + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
DictDO dictDO = (DictDO) o;
|
||||
return Objects.equals(id, dictDO.id) && Objects.equals(name, dictDO.name)
|
||||
&& Objects.equals(value, dictDO.value) && Objects.equals(type, dictDO.type)
|
||||
&& Objects.equals(description, dictDO.description) && Objects.equals(sort, dictDO.sort)
|
||||
&& Objects.equals(parentId, dictDO.parentId) && Objects.equals(createBy, dictDO.createBy)
|
||||
&& Objects.equals(createDate, dictDO.createDate) && Objects.equals(updateBy,
|
||||
dictDO.updateBy) && Objects.equals(updateDate, dictDO.updateDate) && Objects.equals(remarks,
|
||||
dictDO.remarks) && Objects.equals(delFlag, dictDO.delFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, name, value, type, description, sort, parentId, createBy, createDate, updateBy,
|
||||
updateDate,
|
||||
remarks, delFlag);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
package com.java2nb.common.service.impl;
|
||||
|
||||
import com.java2nb.common.dao.DictDao;
|
||||
import com.java2nb.common.domain.DictDO;
|
||||
import com.java2nb.common.service.DictService;
|
||||
import com.java2nb.common.utils.StringUtils;
|
||||
import com.java2nb.system.domain.UserDO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -9,14 +12,12 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.java2nb.common.dao.DictDao;
|
||||
import com.java2nb.common.domain.DictDO;
|
||||
import com.java2nb.common.service.DictService;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Service
|
||||
public class DictServiceImpl implements DictService {
|
||||
|
||||
@Autowired
|
||||
private DictDao dictDao;
|
||||
|
||||
@ -58,7 +59,7 @@ public class DictServiceImpl implements DictService {
|
||||
@Override
|
||||
|
||||
public List<DictDO> listType() {
|
||||
return dictDao.listType();
|
||||
return dictDao.listType().stream().distinct().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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.BookContentDO;
|
||||
import com.java2nb.novel.service.BookContentService;
|
||||
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 2023-04-14 19:52:06
|
||||
*/
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/novel/bookContent")
|
||||
public class BookContentController {
|
||||
@Autowired
|
||||
private BookContentService bookContentService;
|
||||
|
||||
@GetMapping()
|
||||
@RequiresPermissions("novel:bookContent:bookContent")
|
||||
String BookContent() {
|
||||
return "novel/bookContent/bookContent";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取小说内容表列表", notes = "获取小说内容表列表")
|
||||
@ResponseBody
|
||||
@GetMapping("/list")
|
||||
@RequiresPermissions("novel:bookContent:bookContent")
|
||||
public R list(@RequestParam Map<String, Object> params) {
|
||||
//查询列表数据
|
||||
Query query = new Query(params);
|
||||
List<BookContentDO> bookContentList = bookContentService.list(query);
|
||||
int total = bookContentService.count(query);
|
||||
PageBean pageBean = new PageBean(bookContentList, total);
|
||||
return R.ok().put("data", pageBean);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增小说内容表页面", notes = "新增小说内容表页面")
|
||||
@GetMapping("/add")
|
||||
@RequiresPermissions("novel:bookContent:add")
|
||||
String add() {
|
||||
return "novel/bookContent/add";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改小说内容表页面", notes = "修改小说内容表页面")
|
||||
@GetMapping("/edit/{id}")
|
||||
@RequiresPermissions("novel:bookContent:edit")
|
||||
String edit(@PathVariable("id") Long id, Model model) {
|
||||
BookContentDO bookContent = bookContentService.get(id);
|
||||
model.addAttribute("bookContent", bookContent);
|
||||
return "novel/bookContent/edit";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查看小说内容表页面", notes = "查看小说内容表页面")
|
||||
@GetMapping("/detail/{id}")
|
||||
@RequiresPermissions("novel:bookContent:detail")
|
||||
String detail(@PathVariable("id") Long id, Model model) {
|
||||
BookContentDO bookContent = bookContentService.get(id);
|
||||
model.addAttribute("bookContent", bookContent);
|
||||
return "novel/bookContent/detail";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@ApiOperation(value = "新增小说内容表", notes = "新增小说内容表")
|
||||
@ResponseBody
|
||||
@PostMapping("/save")
|
||||
@RequiresPermissions("novel:bookContent:add")
|
||||
public R save( BookContentDO bookContent) {
|
||||
if (bookContentService.save(bookContent) > 0) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@ApiOperation(value = "修改小说内容表", notes = "修改小说内容表")
|
||||
@ResponseBody
|
||||
@RequestMapping("/update")
|
||||
@RequiresPermissions("novel:bookContent:edit")
|
||||
public R update( BookContentDO bookContent) {
|
||||
bookContentService.update(bookContent);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@ApiOperation(value = "删除小说内容表", notes = "删除小说内容表")
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
@RequiresPermissions("novel:bookContent:remove")
|
||||
public R remove( Long id) {
|
||||
if (bookContentService.remove(id) > 0) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@ApiOperation(value = "批量删除小说内容表", notes = "批量删除小说内容表")
|
||||
@PostMapping("/batchRemove")
|
||||
@ResponseBody
|
||||
@RequiresPermissions("novel:bookContent:batchRemove")
|
||||
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||
bookContentService.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.BookIndexDO;
|
||||
import com.java2nb.novel.service.BookIndexService;
|
||||
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 2023-04-14 19:51:54
|
||||
*/
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/novel/bookIndex")
|
||||
public class BookIndexController {
|
||||
@Autowired
|
||||
private BookIndexService bookIndexService;
|
||||
|
||||
@GetMapping()
|
||||
@RequiresPermissions("novel:bookIndex:bookIndex")
|
||||
String BookIndex() {
|
||||
return "novel/bookIndex/bookIndex";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取小说目录表列表", notes = "获取小说目录表列表")
|
||||
@ResponseBody
|
||||
@GetMapping("/list")
|
||||
@RequiresPermissions("novel:bookIndex:bookIndex")
|
||||
public R list(@RequestParam Map<String, Object> params) {
|
||||
//查询列表数据
|
||||
Query query = new Query(params);
|
||||
List<BookIndexDO> bookIndexList = bookIndexService.list(query);
|
||||
int total = bookIndexService.count(query);
|
||||
PageBean pageBean = new PageBean(bookIndexList, total);
|
||||
return R.ok().put("data", pageBean);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增小说目录表页面", notes = "新增小说目录表页面")
|
||||
@GetMapping("/add")
|
||||
@RequiresPermissions("novel:bookIndex:add")
|
||||
String add() {
|
||||
return "novel/bookIndex/add";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改小说目录表页面", notes = "修改小说目录表页面")
|
||||
@GetMapping("/edit/{id}")
|
||||
@RequiresPermissions("novel:bookIndex:edit")
|
||||
String edit(@PathVariable("id") Long id, Model model) {
|
||||
BookIndexDO bookIndex = bookIndexService.get(id);
|
||||
model.addAttribute("bookIndex", bookIndex);
|
||||
return "novel/bookIndex/edit";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查看小说目录表页面", notes = "查看小说目录表页面")
|
||||
@GetMapping("/detail/{id}")
|
||||
@RequiresPermissions("novel:bookIndex:detail")
|
||||
String detail(@PathVariable("id") Long id, Model model) {
|
||||
BookIndexDO bookIndex = bookIndexService.get(id);
|
||||
model.addAttribute("bookIndex", bookIndex);
|
||||
return "novel/bookIndex/detail";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@ApiOperation(value = "新增小说目录表", notes = "新增小说目录表")
|
||||
@ResponseBody
|
||||
@PostMapping("/save")
|
||||
@RequiresPermissions("novel:bookIndex:add")
|
||||
public R save( BookIndexDO bookIndex) {
|
||||
if (bookIndexService.save(bookIndex) > 0) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@ApiOperation(value = "修改小说目录表", notes = "修改小说目录表")
|
||||
@ResponseBody
|
||||
@RequestMapping("/update")
|
||||
@RequiresPermissions("novel:bookIndex:edit")
|
||||
public R update( BookIndexDO bookIndex) {
|
||||
bookIndexService.update(bookIndex);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@ApiOperation(value = "删除小说目录表", notes = "删除小说目录表")
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
@RequiresPermissions("novel:bookIndex:remove")
|
||||
public R remove( Long id) {
|
||||
if (bookIndexService.remove(id) > 0) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@ApiOperation(value = "批量删除小说目录表", notes = "批量删除小说目录表")
|
||||
@PostMapping("/batchRemove")
|
||||
@ResponseBody
|
||||
@RequiresPermissions("novel:bookIndex:batchRemove")
|
||||
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||
bookIndexService.batchRemove(ids);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.java2nb.novel.dao;
|
||||
|
||||
import com.java2nb.novel.domain.BookContentDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 小说内容表
|
||||
*
|
||||
* @author xiongxy
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2023-04-14 19:52:06
|
||||
*/
|
||||
@Mapper
|
||||
public interface BookContentDao {
|
||||
|
||||
BookContentDO get(Long id);
|
||||
|
||||
List<BookContentDO> list(Map<String, Object> map);
|
||||
|
||||
int count(Map<String, Object> map);
|
||||
|
||||
int save(BookContentDO bookContent);
|
||||
|
||||
int update(BookContentDO bookContent);
|
||||
|
||||
int remove(Long id);
|
||||
|
||||
int batchRemove(Long[] ids);
|
||||
|
||||
int removeByIndexIds(Long[] indexIds);
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.java2nb.novel.dao;
|
||||
|
||||
import com.java2nb.novel.domain.BookIndexDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 小说目录表
|
||||
*
|
||||
* @author xiongxy
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2023-04-14 19:51:54
|
||||
*/
|
||||
@Mapper
|
||||
public interface BookIndexDao {
|
||||
|
||||
BookIndexDO get(Long id);
|
||||
|
||||
List<BookIndexDO> list(Map<String, Object> map);
|
||||
|
||||
int count(Map<String, Object> map);
|
||||
|
||||
int save(BookIndexDO bookIndex);
|
||||
|
||||
int update(BookIndexDO bookIndex);
|
||||
|
||||
int remove(Long id);
|
||||
|
||||
int batchRemove(Long[] ids);
|
||||
|
||||
List<Long> getIdsByBookId(Long bookId);
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
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 2023-04-14 19:52:06
|
||||
*/
|
||||
public class BookContentDO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
//主键
|
||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||
//所以通过序列化成字符串来解决
|
||||
@JsonSerialize(using = LongToStringSerializer.class)
|
||||
private Long id;
|
||||
//目录ID
|
||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||
//所以通过序列化成字符串来解决
|
||||
@JsonSerialize(using = LongToStringSerializer.class)
|
||||
private Long indexId;
|
||||
//小说章节内容
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 设置:主键
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
/**
|
||||
* 获取:主键
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
/**
|
||||
* 设置:目录ID
|
||||
*/
|
||||
public void setIndexId(Long indexId) {
|
||||
this.indexId = indexId;
|
||||
}
|
||||
/**
|
||||
* 获取:目录ID
|
||||
*/
|
||||
public Long getIndexId() {
|
||||
return indexId;
|
||||
}
|
||||
/**
|
||||
* 设置:小说章节内容
|
||||
*/
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
/**
|
||||
* 获取:小说章节内容
|
||||
*/
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
}
|
@ -0,0 +1,177 @@
|
||||
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 2023-04-14 19:51:54
|
||||
*/
|
||||
public class BookIndexDO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
//主键
|
||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||
//所以通过序列化成字符串来解决
|
||||
@JsonSerialize(using = LongToStringSerializer.class)
|
||||
private Long id;
|
||||
//小说ID
|
||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||
//所以通过序列化成字符串来解决
|
||||
@JsonSerialize(using = LongToStringSerializer.class)
|
||||
private Long bookId;
|
||||
//目录号
|
||||
private Integer indexNum;
|
||||
//目录名
|
||||
private String indexName;
|
||||
//字数
|
||||
private Integer wordCount;
|
||||
//是否收费,1:收费,0:免费
|
||||
private Integer isVip;
|
||||
//章节费用(屋币)
|
||||
private Integer bookPrice;
|
||||
//存储方式
|
||||
private String storageType;
|
||||
//
|
||||
@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;
|
||||
}
|
||||
/**
|
||||
* 设置:小说ID
|
||||
*/
|
||||
public void setBookId(Long bookId) {
|
||||
this.bookId = bookId;
|
||||
}
|
||||
/**
|
||||
* 获取:小说ID
|
||||
*/
|
||||
public Long getBookId() {
|
||||
return bookId;
|
||||
}
|
||||
/**
|
||||
* 设置:目录号
|
||||
*/
|
||||
public void setIndexNum(Integer indexNum) {
|
||||
this.indexNum = indexNum;
|
||||
}
|
||||
/**
|
||||
* 获取:目录号
|
||||
*/
|
||||
public Integer getIndexNum() {
|
||||
return indexNum;
|
||||
}
|
||||
/**
|
||||
* 设置:目录名
|
||||
*/
|
||||
public void setIndexName(String indexName) {
|
||||
this.indexName = indexName;
|
||||
}
|
||||
/**
|
||||
* 获取:目录名
|
||||
*/
|
||||
public String getIndexName() {
|
||||
return indexName;
|
||||
}
|
||||
/**
|
||||
* 设置:字数
|
||||
*/
|
||||
public void setWordCount(Integer wordCount) {
|
||||
this.wordCount = wordCount;
|
||||
}
|
||||
/**
|
||||
* 获取:字数
|
||||
*/
|
||||
public Integer getWordCount() {
|
||||
return wordCount;
|
||||
}
|
||||
/**
|
||||
* 设置:是否收费,1:收费,0:免费
|
||||
*/
|
||||
public void setIsVip(Integer isVip) {
|
||||
this.isVip = isVip;
|
||||
}
|
||||
/**
|
||||
* 获取:是否收费,1:收费,0:免费
|
||||
*/
|
||||
public Integer getIsVip() {
|
||||
return isVip;
|
||||
}
|
||||
/**
|
||||
* 设置:章节费用(屋币)
|
||||
*/
|
||||
public void setBookPrice(Integer bookPrice) {
|
||||
this.bookPrice = bookPrice;
|
||||
}
|
||||
/**
|
||||
* 获取:章节费用(屋币)
|
||||
*/
|
||||
public Integer getBookPrice() {
|
||||
return bookPrice;
|
||||
}
|
||||
/**
|
||||
* 设置:存储方式
|
||||
*/
|
||||
public void setStorageType(String storageType) {
|
||||
this.storageType = storageType;
|
||||
}
|
||||
/**
|
||||
* 获取:存储方式
|
||||
*/
|
||||
public String getStorageType() {
|
||||
return storageType;
|
||||
}
|
||||
/**
|
||||
* 设置:
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.java2nb.novel.service;
|
||||
|
||||
import com.java2nb.novel.domain.BookContentDO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 小说内容表
|
||||
*
|
||||
* @author xiongxy
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2023-04-14 19:52:06
|
||||
*/
|
||||
public interface BookContentService {
|
||||
|
||||
BookContentDO get(Long id);
|
||||
|
||||
List<BookContentDO> list(Map<String, Object> map);
|
||||
|
||||
int count(Map<String, Object> map);
|
||||
|
||||
int save(BookContentDO bookContent);
|
||||
|
||||
int update(BookContentDO bookContent);
|
||||
|
||||
int remove(Long id);
|
||||
|
||||
int batchRemove(Long[] ids);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.java2nb.novel.service;
|
||||
|
||||
import com.java2nb.novel.domain.BookIndexDO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 小说目录表
|
||||
*
|
||||
* @author xiongxy
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2023-04-14 19:51:54
|
||||
*/
|
||||
public interface BookIndexService {
|
||||
|
||||
BookIndexDO get(Long id);
|
||||
|
||||
List<BookIndexDO> list(Map<String, Object> map);
|
||||
|
||||
int count(Map<String, Object> map);
|
||||
|
||||
int save(BookIndexDO bookIndex);
|
||||
|
||||
int update(BookIndexDO bookIndex);
|
||||
|
||||
int remove(Long id);
|
||||
|
||||
int batchRemove(Long[] ids);
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.java2nb.novel.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.novel.dao.BookContentDao;
|
||||
import com.java2nb.novel.domain.BookContentDO;
|
||||
import com.java2nb.novel.service.BookContentService;
|
||||
|
||||
|
||||
|
||||
@Service
|
||||
public class BookContentServiceImpl implements BookContentService {
|
||||
@Autowired
|
||||
private BookContentDao bookContentDao;
|
||||
|
||||
@Override
|
||||
public BookContentDO get(Long id){
|
||||
return bookContentDao.get(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BookContentDO> list(Map<String, Object> map){
|
||||
return bookContentDao.list(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int count(Map<String, Object> map){
|
||||
return bookContentDao.count(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int save(BookContentDO bookContent){
|
||||
return bookContentDao.save(bookContent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(BookContentDO bookContent){
|
||||
return bookContentDao.update(bookContent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int remove(Long id){
|
||||
return bookContentDao.remove(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchRemove(Long[] ids){
|
||||
return bookContentDao.batchRemove(ids);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.java2nb.novel.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.novel.dao.BookIndexDao;
|
||||
import com.java2nb.novel.domain.BookIndexDO;
|
||||
import com.java2nb.novel.service.BookIndexService;
|
||||
|
||||
|
||||
|
||||
@Service
|
||||
public class BookIndexServiceImpl implements BookIndexService {
|
||||
@Autowired
|
||||
private BookIndexDao bookIndexDao;
|
||||
|
||||
@Override
|
||||
public BookIndexDO get(Long id){
|
||||
return bookIndexDao.get(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BookIndexDO> list(Map<String, Object> map){
|
||||
return bookIndexDao.list(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int count(Map<String, Object> map){
|
||||
return bookIndexDao.count(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int save(BookIndexDO bookIndex){
|
||||
return bookIndexDao.save(bookIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(BookIndexDO bookIndex){
|
||||
return bookIndexDao.update(bookIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int remove(Long id){
|
||||
return bookIndexDao.remove(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchRemove(Long[] ids){
|
||||
return bookIndexDao.batchRemove(ids);
|
||||
}
|
||||
|
||||
}
|
@ -1,65 +1,79 @@
|
||||
package com.java2nb.novel.service.impl;
|
||||
|
||||
import com.java2nb.novel.dao.BookContentDao;
|
||||
import com.java2nb.novel.dao.BookDao;
|
||||
import com.java2nb.novel.dao.BookIndexDao;
|
||||
import com.java2nb.novel.domain.BookDO;
|
||||
import com.java2nb.novel.service.BookService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.java2nb.novel.dao.BookDao;
|
||||
import com.java2nb.novel.domain.BookDO;
|
||||
import com.java2nb.novel.service.BookService;
|
||||
|
||||
|
||||
|
||||
@Service
|
||||
public class BookServiceImpl implements BookService {
|
||||
@Autowired
|
||||
private BookDao bookDao;
|
||||
|
||||
@Override
|
||||
public BookDO get(Long id){
|
||||
return bookDao.get(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BookDO> list(Map<String, Object> map){
|
||||
return bookDao.list(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int count(Map<String, Object> map){
|
||||
return bookDao.count(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int save(BookDO book){
|
||||
return bookDao.save(book);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(BookDO book){
|
||||
return bookDao.update(book);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int remove(Long id){
|
||||
return bookDao.remove(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchRemove(Long[] ids){
|
||||
return bookDao.batchRemove(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Object, Object> tableSta(Date minDate) {
|
||||
List<Map<Object, Object>> maps = bookDao.tableSta(minDate);
|
||||
@Autowired
|
||||
private BookDao bookDao;
|
||||
@Autowired
|
||||
private BookIndexDao bookIndexDao;
|
||||
@Autowired
|
||||
private BookContentDao bookContentDao;
|
||||
|
||||
return maps.stream().collect(Collectors.toMap(x -> x.get("staDate"), x -> x.get("bookCount")));
|
||||
@Override
|
||||
public BookDO get(Long id) {
|
||||
return bookDao.get(id);
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public List<BookDO> list(Map<String, Object> map) {
|
||||
return bookDao.list(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int count(Map<String, Object> map) {
|
||||
return bookDao.count(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int save(BookDO book) {
|
||||
return bookDao.save(book);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(BookDO book) {
|
||||
return bookDao.update(book);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int remove(Long id) {
|
||||
List<Long> indexIds = bookIndexDao.getIdsByBookId(id);
|
||||
if (!CollectionUtils.isEmpty(indexIds)) {
|
||||
Long[] indexIdArray = indexIds.toArray(new Long[0]);
|
||||
bookIndexDao.batchRemove(indexIdArray);
|
||||
bookContentDao.removeByIndexIds(indexIdArray);
|
||||
}
|
||||
return bookDao.remove(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchRemove(Long[] ids) {
|
||||
return bookDao.batchRemove(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Object, Object> tableSta(Date minDate) {
|
||||
List<Map<Object, Object>> maps = bookDao.tableSta(minDate);
|
||||
|
||||
return maps.stream().collect(Collectors.toMap(x -> x.get("staDate"), x -> x.get("bookCount")));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -51,4 +51,43 @@ spring:
|
||||
# 连接池最大连接数(使用负值表示没有限制)
|
||||
max-active: 100
|
||||
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1
|
||||
max-wait: -1
|
||||
|
||||
|
||||
|
||||
####使用shardingJdbc时,
|
||||
####所有的jdbcType都不能是LONGVARCHAR,否则会导致java.io.NotSerializableException: java.io.StringReader错误
|
||||
##### 应该替换所有的 LONGVARCHAR 类型为VARCHAR
|
||||
|
||||
sharding:
|
||||
jdbc:
|
||||
datasource:
|
||||
names: ds0 #,ds1
|
||||
ds0:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
jdbc-url: jdbc:mysql://localhost:3306/novel_plus?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: test123456
|
||||
# ds1:
|
||||
# type: com.alibaba.druid.pool.DruidDataSource
|
||||
# driver-class-name: com.mysql.jdbc.Driver
|
||||
# url: jdbc:mysql://localhost:3306/novel_plus2
|
||||
# username: root
|
||||
# password: test123456
|
||||
config:
|
||||
sharding:
|
||||
props:
|
||||
sql.show: true
|
||||
tables:
|
||||
book_content: #book_content表
|
||||
key-generator-column-name: id #主键
|
||||
actual-data-nodes: ds${0}.book_content${0..9} #数据节点
|
||||
# database-strategy: #分库策略
|
||||
# inline:
|
||||
# sharding-column: book_id
|
||||
# algorithm-expression: ds${book_id % 10}
|
||||
table-strategy: #分表策略
|
||||
inline:
|
||||
shardingColumn: index_id
|
||||
algorithm-expression: book_content${index_id % 10}
|
||||
|
@ -51,4 +51,42 @@ spring:
|
||||
# 连接池最大连接数(使用负值表示没有限制)
|
||||
max-active: 100
|
||||
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1
|
||||
max-wait: -1
|
||||
|
||||
|
||||
####使用shardingJdbc时,
|
||||
####所有的jdbcType都不能是LONGVARCHAR,否则会导致java.io.NotSerializableException: java.io.StringReader错误
|
||||
##### 应该替换所有的 LONGVARCHAR 类型为VARCHAR
|
||||
|
||||
sharding:
|
||||
jdbc:
|
||||
datasource:
|
||||
names: ds0 #,ds1
|
||||
ds0:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
jdbc-url: jdbc:mysql://localhost:3306/novel_plus?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: test123456
|
||||
# ds1:
|
||||
# type: com.alibaba.druid.pool.DruidDataSource
|
||||
# driver-class-name: com.mysql.jdbc.Driver
|
||||
# url: jdbc:mysql://localhost:3306/novel_plus2
|
||||
# username: root
|
||||
# password: test123456
|
||||
config:
|
||||
sharding:
|
||||
props:
|
||||
sql.show: true
|
||||
tables:
|
||||
book_content: #book_content表
|
||||
key-generator-column-name: id #主键
|
||||
actual-data-nodes: ds${0}.book_content${0..9} #数据节点
|
||||
# database-strategy: #分库策略
|
||||
# inline:
|
||||
# sharding-column: book_id
|
||||
# algorithm-expression: ds${book_id % 10}
|
||||
table-strategy: #分表策略
|
||||
inline:
|
||||
shardingColumn: index_id
|
||||
algorithm-expression: book_content${index_id % 10}
|
||||
|
@ -17,13 +17,17 @@ spring:
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
profiles:
|
||||
active: dev
|
||||
|
||||
#上传文件的最大值(10M)
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 30Mb
|
||||
max-request-size: 30Mb
|
||||
max-file-size: 10485760
|
||||
|
||||
devtools:
|
||||
restart:
|
||||
enabled: true
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
|
||||
mybatis:
|
||||
configuration:
|
||||
|
@ -3,130 +3,140 @@
|
||||
|
||||
<mapper namespace="com.java2nb.common.dao.DictDao">
|
||||
|
||||
<select id="get" resultType="com.java2nb.common.domain.DictDO">
|
||||
select
|
||||
`id`,`name`,`value`,`type`,`description`,`sort`,`parent_id`,`create_by`,`create_date`,`update_by`,`update_date`,`remarks`,`del_flag`
|
||||
from sys_dict where id = #{value}
|
||||
</select>
|
||||
<select id="get" resultType="com.java2nb.common.domain.DictDO">
|
||||
select `id`,
|
||||
`name`,
|
||||
`value`,
|
||||
`type`,
|
||||
`description`,
|
||||
`sort`,
|
||||
`parent_id`,
|
||||
`create_by`,
|
||||
`create_date`,
|
||||
`update_by`,
|
||||
`update_date`,
|
||||
`remarks`,
|
||||
`del_flag`
|
||||
from sys_dict
|
||||
where id = #{value}
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.java2nb.common.domain.DictDO">
|
||||
select
|
||||
`id`,`name`,`value`,`type`,`description`,`sort`,`parent_id`,`create_by`,`create_date`,`update_by`,`update_date`,`remarks`,`del_flag`
|
||||
from sys_dict
|
||||
<where>
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
||||
<if test="value != null and value != ''"> and value = #{value} </if>
|
||||
<if test="type != null and type != ''"> and type = #{type} </if>
|
||||
<if test="description != null and description != ''"> and description = #{description} </if>
|
||||
<if test="sort != null and sort != ''"> and sort = #{sort} </if>
|
||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
|
||||
<if test="createBy != null and createBy != ''"> and create_by = #{createBy} </if>
|
||||
<if test="createDate != null and createDate != ''"> and create_date = #{createDate} </if>
|
||||
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy} </if>
|
||||
<if test="updateDate != null and updateDate != ''"> and update_date = #{updateDate} </if>
|
||||
<if test="remarks != null and remarks != ''"> and remarks = #{remarks} </if>
|
||||
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag} </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="list" resultType="com.java2nb.common.domain.DictDO">
|
||||
select
|
||||
`id`,`name`,`value`,`type`,`description`,`sort`,`parent_id`,`create_by`,`create_date`,`update_by`,`update_date`,`remarks`,`del_flag`
|
||||
from sys_dict
|
||||
<where>
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="name != null and name != ''">and name = #{name}</if>
|
||||
<if test="value != null and value != ''">and value = #{value}</if>
|
||||
<if test="type != null and type != ''">and type = #{type}</if>
|
||||
<if test="description != null and description != ''">and description = #{description}</if>
|
||||
<if test="sort != null and sort != ''">and sort = #{sort}</if>
|
||||
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
|
||||
<if test="createBy != null and createBy != ''">and create_by = #{createBy}</if>
|
||||
<if test="createDate != null and createDate != ''">and create_date = #{createDate}</if>
|
||||
<if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if>
|
||||
<if test="updateDate != null and updateDate != ''">and update_date = #{updateDate}</if>
|
||||
<if test="remarks != null and remarks != ''">and remarks = #{remarks}</if>
|
||||
<if test="delFlag != null and delFlag != ''">and del_flag = #{delFlag}</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 sys_dict
|
||||
<where>
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
||||
<if test="value != null and value != ''"> and value = #{value} </if>
|
||||
<if test="type != null and type != ''"> and type = #{type} </if>
|
||||
<if test="description != null and description != ''"> and description = #{description} </if>
|
||||
<if test="sort != null and sort != ''"> and sort = #{sort} </if>
|
||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
|
||||
<if test="createBy != null and createBy != ''"> and create_by = #{createBy} </if>
|
||||
<if test="createDate != null and createDate != ''"> and create_date = #{createDate} </if>
|
||||
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy} </if>
|
||||
<if test="updateDate != null and updateDate != ''"> and update_date = #{updateDate} </if>
|
||||
<if test="remarks != null and remarks != ''"> and remarks = #{remarks} </if>
|
||||
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag} </if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="count" resultType="int">
|
||||
select count(*) from sys_dict
|
||||
<where>
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="name != null and name != ''">and name = #{name}</if>
|
||||
<if test="value != null and value != ''">and value = #{value}</if>
|
||||
<if test="type != null and type != ''">and type = #{type}</if>
|
||||
<if test="description != null and description != ''">and description = #{description}</if>
|
||||
<if test="sort != null and sort != ''">and sort = #{sort}</if>
|
||||
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
|
||||
<if test="createBy != null and createBy != ''">and create_by = #{createBy}</if>
|
||||
<if test="createDate != null and createDate != ''">and create_date = #{createDate}</if>
|
||||
<if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if>
|
||||
<if test="updateDate != null and updateDate != ''">and update_date = #{updateDate}</if>
|
||||
<if test="remarks != null and remarks != ''">and remarks = #{remarks}</if>
|
||||
<if test="delFlag != null and delFlag != ''">and del_flag = #{delFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="save" parameterType="com.java2nb.common.domain.DictDO"
|
||||
useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_dict
|
||||
(
|
||||
`name`,
|
||||
`value`,
|
||||
`type`,
|
||||
`description`,
|
||||
`sort`,
|
||||
`parent_id`,
|
||||
`create_by`,
|
||||
`create_date`,
|
||||
`update_by`,
|
||||
`update_date`,
|
||||
`remarks`,
|
||||
`del_flag`
|
||||
)
|
||||
values
|
||||
(
|
||||
#{name},
|
||||
#{value},
|
||||
#{type},
|
||||
#{description},
|
||||
#{sort},
|
||||
#{parentId},
|
||||
#{createBy},
|
||||
#{createDate},
|
||||
#{updateBy},
|
||||
#{updateDate},
|
||||
#{remarks},
|
||||
#{delFlag}
|
||||
)
|
||||
</insert>
|
||||
<insert id="save" parameterType="com.java2nb.common.domain.DictDO"
|
||||
useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_dict
|
||||
(`name`,
|
||||
`value`,
|
||||
`type`,
|
||||
`description`,
|
||||
`sort`,
|
||||
`parent_id`,
|
||||
`create_by`,
|
||||
`create_date`,
|
||||
`update_by`,
|
||||
`update_date`,
|
||||
`remarks`,
|
||||
`del_flag`)
|
||||
values (#{name},
|
||||
#{value},
|
||||
#{type},
|
||||
#{description},
|
||||
#{sort},
|
||||
#{parentId},
|
||||
#{createBy},
|
||||
#{createDate},
|
||||
#{updateBy},
|
||||
#{updateDate},
|
||||
#{remarks},
|
||||
#{delFlag})
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.java2nb.common.domain.DictDO">
|
||||
update sys_dict
|
||||
<set>
|
||||
<if test="name != null">`name` = #{name}, </if>
|
||||
<if test="value != null">`value` = #{value}, </if>
|
||||
<if test="type != null">`type` = #{type}, </if>
|
||||
<if test="description != null">`description` = #{description}, </if>
|
||||
<if test="sort != null">`sort` = #{sort}, </if>
|
||||
<if test="parentId != null">`parent_id` = #{parentId}, </if>
|
||||
<if test="createBy != null">`create_by` = #{createBy}, </if>
|
||||
<if test="createDate != null">`create_date` = #{createDate}, </if>
|
||||
<if test="updateBy != null">`update_by` = #{updateBy}, </if>
|
||||
<if test="updateDate != null">`update_date` = #{updateDate}, </if>
|
||||
<if test="remarks != null">`remarks` = #{remarks}, </if>
|
||||
<if test="delFlag != null">`del_flag` = #{delFlag}</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="update" parameterType="com.java2nb.common.domain.DictDO">
|
||||
update sys_dict
|
||||
<set>
|
||||
<if test="name != null">`name` = #{name},</if>
|
||||
<if test="value != null">`value` = #{value},</if>
|
||||
<if test="type != null">`type` = #{type},</if>
|
||||
<if test="description != null">`description` = #{description},</if>
|
||||
<if test="sort != null">`sort` = #{sort},</if>
|
||||
<if test="parentId != null">`parent_id` = #{parentId},</if>
|
||||
<if test="createBy != null">`create_by` = #{createBy},</if>
|
||||
<if test="createDate != null">`create_date` = #{createDate},</if>
|
||||
<if test="updateBy != null">`update_by` = #{updateBy},</if>
|
||||
<if test="updateDate != null">`update_date` = #{updateDate},</if>
|
||||
<if test="remarks != null">`remarks` = #{remarks},</if>
|
||||
<if test="delFlag != null">`del_flag` = #{delFlag}</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="remove">
|
||||
delete from sys_dict where id = #{value}
|
||||
</delete>
|
||||
<delete id="remove">
|
||||
delete
|
||||
from sys_dict
|
||||
where id = #{value}
|
||||
</delete>
|
||||
|
||||
<delete id="batchRemove">
|
||||
delete from sys_dict where id in
|
||||
<foreach item="id" collection="array" open="(" separator=","
|
||||
close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="batchRemove">
|
||||
delete from sys_dict where id in
|
||||
<foreach item="id" collection="array" open="(" separator=","
|
||||
close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="listType" resultType="com.java2nb.common.domain.DictDO">
|
||||
select distinct `type` , description from sys_dict
|
||||
</select>
|
||||
<select id="listType" resultType="com.java2nb.common.domain.DictDO">
|
||||
select `type`, description
|
||||
from sys_dict
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,94 @@
|
||||
<?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.BookContentDao">
|
||||
|
||||
<select id="get" resultType="com.java2nb.novel.domain.BookContentDO">
|
||||
select `id`, `index_id`, `content`
|
||||
from book_content
|
||||
where id = #{value}
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.java2nb.novel.domain.BookContentDO">
|
||||
select `id`,`index_id`,`content` from book_content
|
||||
<where>
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="indexId != null and indexId != ''">and index_id = #{indexId}</if>
|
||||
<if test="content != null and content != ''">and content = #{content}</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 book_content
|
||||
<where>
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="indexId != null and indexId != ''">and index_id = #{indexId}</if>
|
||||
<if test="content != null and content != ''">and content = #{content}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="save" parameterType="com.java2nb.novel.domain.BookContentDO">
|
||||
insert into book_content
|
||||
(`id`,
|
||||
`index_id`,
|
||||
`content`)
|
||||
values (#{id},
|
||||
#{indexId},
|
||||
#{content})
|
||||
</insert>
|
||||
|
||||
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.BookContentDO">
|
||||
insert into book_content
|
||||
(
|
||||
<if test="id != null">`id`,</if>
|
||||
<if test="indexId != null">`index_id`,</if>
|
||||
<if test="content != null">`content`</if>
|
||||
)
|
||||
values
|
||||
(
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="indexId != null">#{indexId},</if>
|
||||
<if test="content != null">#{content}</if>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.java2nb.novel.domain.BookContentDO">
|
||||
update book_content
|
||||
<set>
|
||||
<if test="indexId != null">`index_id` = #{indexId},</if>
|
||||
<if test="content != null">`content` = #{content}</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="remove">
|
||||
delete
|
||||
from book_content
|
||||
where id = #{value}
|
||||
</delete>
|
||||
|
||||
<delete id="batchRemove">
|
||||
delete from book_content where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="removeByIndexIds">
|
||||
delete from book_content where index_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
153
novel-admin/src/main/resources/mybatis/novel/BookIndexMapper.xml
Normal file
153
novel-admin/src/main/resources/mybatis/novel/BookIndexMapper.xml
Normal file
@ -0,0 +1,153 @@
|
||||
<?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.BookIndexDao">
|
||||
|
||||
<select id="get" resultType="com.java2nb.novel.domain.BookIndexDO">
|
||||
select `id`,
|
||||
`book_id`,
|
||||
`index_num`,
|
||||
`index_name`,
|
||||
`word_count`,
|
||||
`is_vip`,
|
||||
`book_price`,
|
||||
`storage_type`,
|
||||
`create_time`,
|
||||
`update_time`
|
||||
from book_index
|
||||
where id = #{value}
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.java2nb.novel.domain.BookIndexDO">
|
||||
select
|
||||
`id`,`book_id`,`index_num`,`index_name`,`word_count`,`is_vip`,`book_price`,`storage_type`,`create_time`,`update_time`
|
||||
from book_index
|
||||
<where>
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="bookId != null and bookId != ''">and book_id = #{bookId}</if>
|
||||
<if test="indexNum != null and indexNum != ''">and index_num = #{indexNum}</if>
|
||||
<if test="indexName != null and indexName != ''">and index_name = #{indexName}</if>
|
||||
<if test="wordCount != null and wordCount != ''">and word_count = #{wordCount}</if>
|
||||
<if test="isVip != null and isVip != ''">and is_vip = #{isVip}</if>
|
||||
<if test="bookPrice != null and bookPrice != ''">and book_price = #{bookPrice}</if>
|
||||
<if test="storageType != null and storageType != ''">and storage_type = #{storageType}</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 book_index
|
||||
<where>
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="bookId != null and bookId != ''">and book_id = #{bookId}</if>
|
||||
<if test="indexNum != null and indexNum != ''">and index_num = #{indexNum}</if>
|
||||
<if test="indexName != null and indexName != ''">and index_name = #{indexName}</if>
|
||||
<if test="wordCount != null and wordCount != ''">and word_count = #{wordCount}</if>
|
||||
<if test="isVip != null and isVip != ''">and is_vip = #{isVip}</if>
|
||||
<if test="bookPrice != null and bookPrice != ''">and book_price = #{bookPrice}</if>
|
||||
<if test="storageType != null and storageType != ''">and storage_type = #{storageType}</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>
|
||||
<select id="getIdsByBookId" resultType="java.lang.Long">
|
||||
select id
|
||||
from book_index
|
||||
where book_id = #{bookId}
|
||||
</select>
|
||||
|
||||
<insert id="save" parameterType="com.java2nb.novel.domain.BookIndexDO">
|
||||
insert into book_index
|
||||
(`id`,
|
||||
`book_id`,
|
||||
`index_num`,
|
||||
`index_name`,
|
||||
`word_count`,
|
||||
`is_vip`,
|
||||
`book_price`,
|
||||
`storage_type`,
|
||||
`create_time`,
|
||||
`update_time`)
|
||||
values (#{id},
|
||||
#{bookId},
|
||||
#{indexNum},
|
||||
#{indexName},
|
||||
#{wordCount},
|
||||
#{isVip},
|
||||
#{bookPrice},
|
||||
#{storageType},
|
||||
#{createTime},
|
||||
#{updateTime})
|
||||
</insert>
|
||||
|
||||
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.BookIndexDO">
|
||||
insert into book_index
|
||||
(
|
||||
<if test="id != null">`id`,</if>
|
||||
<if test="bookId != null">`book_id`,</if>
|
||||
<if test="indexNum != null">`index_num`,</if>
|
||||
<if test="indexName != null">`index_name`,</if>
|
||||
<if test="wordCount != null">`word_count`,</if>
|
||||
<if test="isVip != null">`is_vip`,</if>
|
||||
<if test="bookPrice != null">`book_price`,</if>
|
||||
<if test="storageType != null">`storage_type`,</if>
|
||||
<if test="createTime != null">`create_time`,</if>
|
||||
<if test="updateTime != null">`update_time`</if>
|
||||
)
|
||||
values
|
||||
(
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="bookId != null">#{bookId},</if>
|
||||
<if test="indexNum != null">#{indexNum},</if>
|
||||
<if test="indexName != null">#{indexName},</if>
|
||||
<if test="wordCount != null">#{wordCount},</if>
|
||||
<if test="isVip != null">#{isVip},</if>
|
||||
<if test="bookPrice != null">#{bookPrice},</if>
|
||||
<if test="storageType != null">#{storageType},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime}</if>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.java2nb.novel.domain.BookIndexDO">
|
||||
update book_index
|
||||
<set>
|
||||
<if test="bookId != null">`book_id` = #{bookId},</if>
|
||||
<if test="indexNum != null">`index_num` = #{indexNum},</if>
|
||||
<if test="indexName != null">`index_name` = #{indexName},</if>
|
||||
<if test="wordCount != null">`word_count` = #{wordCount},</if>
|
||||
<if test="isVip != null">`is_vip` = #{isVip},</if>
|
||||
<if test="bookPrice != null">`book_price` = #{bookPrice},</if>
|
||||
<if test="storageType != null">`storage_type` = #{storageType},</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 book_index
|
||||
where id = #{value}
|
||||
</delete>
|
||||
|
||||
<delete id="batchRemove">
|
||||
delete from book_index where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -3,149 +3,161 @@
|
||||
|
||||
<mapper namespace="com.java2nb.system.dao.DataPermDao">
|
||||
|
||||
<select id="get" resultType="com.java2nb.system.domain.DataPermDO">
|
||||
select `id`,`name`,`table_name`,`module_name`,`crl_attr_name`,`crl_column_name`,`perm_code`,`order_num`,`gmt_create`,`gmt_modified` from sys_data_perm where id = #{value}
|
||||
</select>
|
||||
<select id="get" resultType="com.java2nb.system.domain.DataPermDO">
|
||||
select `id`,
|
||||
`name`,
|
||||
`table_name`,
|
||||
`module_name`,
|
||||
`crl_attr_name`,
|
||||
`crl_column_name`,
|
||||
`perm_code`,
|
||||
`order_num`,
|
||||
`gmt_create`,
|
||||
`gmt_modified`
|
||||
from sys_data_perm
|
||||
where id = #{value}
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.java2nb.system.domain.DataPermDO">
|
||||
select `id`,`name`,`table_name`,`module_name`,`crl_attr_name`,`crl_column_name`,`perm_code`,`order_num`,`gmt_create`,`gmt_modified` from sys_data_perm
|
||||
<where>
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
||||
<if test="tableName != null and tableName != ''"> and table_name = #{tableName} </if>
|
||||
<if test="moduleName != null and moduleName != ''"> and module_name = #{moduleName} </if>
|
||||
<if test="crlAttrName != null and crlAttrName != ''"> and crl_attr_name = #{crlAttrName} </if>
|
||||
<if test="crlColumnName != null and crlColumnName != ''"> and crl_column_name = #{crlColumnName} </if>
|
||||
<if test="permCode != null and permCode != ''"> and perm_code = #{permCode} </if>
|
||||
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum} </if>
|
||||
<if test="gmtCreate != null and gmtCreate != ''"> and gmt_create = #{gmtCreate} </if>
|
||||
<if test="gmtModified != null and gmtModified != ''"> and gmt_modified = #{gmtModified} </if>
|
||||
</where>
|
||||
<select id="list" resultType="com.java2nb.system.domain.DataPermDO">
|
||||
select
|
||||
`id`,`name`,`table_name`,`module_name`,`crl_attr_name`,`crl_column_name`,`perm_code`,`order_num`,`gmt_create`,`gmt_modified`
|
||||
from sys_data_perm
|
||||
<where>
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="name != null and name != ''">and name = #{name}</if>
|
||||
<if test="tableName != null and tableName != ''">and table_name = #{tableName}</if>
|
||||
<if test="moduleName != null and moduleName != ''">and module_name = #{moduleName}</if>
|
||||
<if test="crlAttrName != null and crlAttrName != ''">and crl_attr_name = #{crlAttrName}</if>
|
||||
<if test="crlColumnName != null and crlColumnName != ''">and crl_column_name = #{crlColumnName}</if>
|
||||
<if test="permCode != null and permCode != ''">and perm_code = #{permCode}</if>
|
||||
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
|
||||
<if test="gmtCreate != null and gmtCreate != ''">and gmt_create = #{gmtCreate}</if>
|
||||
<if test="gmtModified != null and gmtModified != ''">and gmt_modified = #{gmtModified}</if>
|
||||
</where>
|
||||
<choose>
|
||||
<when test="sort != null and sort.trim() != ''">
|
||||
order by ${sort} ${order}
|
||||
</when>
|
||||
<otherwise>
|
||||
<otherwise>
|
||||
order by id desc
|
||||
</otherwise>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="offset != null and limit != null">
|
||||
limit #{offset}, #{limit}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(*) from sys_data_perm
|
||||
<where>
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
||||
<if test="tableName != null and tableName != ''"> and table_name = #{tableName} </if>
|
||||
<if test="moduleName != null and moduleName != ''"> and module_name = #{moduleName} </if>
|
||||
<if test="crlAttrName != null and crlAttrName != ''"> and crl_attr_name = #{crlAttrName} </if>
|
||||
<if test="crlColumnName != null and crlColumnName != ''"> and crl_column_name = #{crlColumnName} </if>
|
||||
<if test="permCode != null and permCode != ''"> and perm_code = #{permCode} </if>
|
||||
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum} </if>
|
||||
<if test="gmtCreate != null and gmtCreate != ''"> and gmt_create = #{gmtCreate} </if>
|
||||
<if test="gmtModified != null and gmtModified != ''"> and gmt_modified = #{gmtModified} </if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="save" parameterType="com.java2nb.system.domain.DataPermDO" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_data_perm
|
||||
(
|
||||
`name`,
|
||||
`table_name`,
|
||||
`module_name`,
|
||||
`crl_attr_name`,
|
||||
`crl_column_name`,
|
||||
`perm_code`,
|
||||
`order_num`,
|
||||
`gmt_create`,
|
||||
`gmt_modified`
|
||||
)
|
||||
values
|
||||
(
|
||||
#{name},
|
||||
#{tableName},
|
||||
#{moduleName},
|
||||
#{crlAttrName},
|
||||
#{crlColumnName},
|
||||
#{permCode},
|
||||
#{orderNum},
|
||||
#{gmtCreate},
|
||||
#{gmtModified}
|
||||
)
|
||||
</insert>
|
||||
<if test="offset != null and limit != null">
|
||||
limit #{offset}, #{limit}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="saveSelective" parameterType="com.java2nb.system.domain.DataPermDO" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_data_perm
|
||||
(
|
||||
<if test="id != null"> `id`, </if>
|
||||
<if test="name != null"> `name`, </if>
|
||||
<if test="tableName != null"> `table_name`, </if>
|
||||
<if test="moduleName != null"> `module_name`, </if>
|
||||
<if test="crlAttrName != null"> `crl_attr_name`, </if>
|
||||
<if test="crlColumnName != null"> `crl_column_name`, </if>
|
||||
<if test="permCode != null"> `perm_code`, </if>
|
||||
<if test="orderNum != null"> `order_num`, </if>
|
||||
<if test="gmtCreate != null"> `gmt_create`, </if>
|
||||
<if test="gmtModified != null"> `gmt_modified` </if>
|
||||
)
|
||||
values
|
||||
(
|
||||
<if test="id != null"> #{id}, </if>
|
||||
<if test="name != null"> #{name}, </if>
|
||||
<if test="tableName != null"> #{tableName}, </if>
|
||||
<if test="moduleName != null"> #{moduleName}, </if>
|
||||
<if test="crlAttrName != null"> #{crlAttrName}, </if>
|
||||
<if test="crlColumnName != null"> #{crlColumnName}, </if>
|
||||
<if test="permCode != null"> #{permCode}, </if>
|
||||
<if test="orderNum != null"> #{orderNum}, </if>
|
||||
<if test="gmtCreate != null"> #{gmtCreate}, </if>
|
||||
<if test="gmtModified != null"> #{gmtModified} </if>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.java2nb.system.domain.DataPermDO">
|
||||
update sys_data_perm
|
||||
<set>
|
||||
<if test="name != null">`name` = #{name}, </if>
|
||||
<if test="tableName != null">`table_name` = #{tableName}, </if>
|
||||
<if test="moduleName != null">`module_name` = #{moduleName}, </if>
|
||||
<if test="crlAttrName != null">`crl_attr_name` = #{crlAttrName}, </if>
|
||||
<if test="crlColumnName != null">`crl_column_name` = #{crlColumnName}, </if>
|
||||
<if test="permCode != null">`perm_code` = #{permCode}, </if>
|
||||
<if test="orderNum != null">`order_num` = #{orderNum}, </if>
|
||||
<if test="gmtCreate != null">`gmt_create` = #{gmtCreate}, </if>
|
||||
<if test="gmtModified != null">`gmt_modified` = #{gmtModified}</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="remove">
|
||||
delete from sys_data_perm where id = #{value}
|
||||
</delete>
|
||||
|
||||
<delete id="batchRemove">
|
||||
delete from sys_data_perm where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="count" resultType="int">
|
||||
select count(*) from sys_data_perm
|
||||
<where>
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="name != null and name != ''">and name = #{name}</if>
|
||||
<if test="tableName != null and tableName != ''">and table_name = #{tableName}</if>
|
||||
<if test="moduleName != null and moduleName != ''">and module_name = #{moduleName}</if>
|
||||
<if test="crlAttrName != null and crlAttrName != ''">and crl_attr_name = #{crlAttrName}</if>
|
||||
<if test="crlColumnName != null and crlColumnName != ''">and crl_column_name = #{crlColumnName}</if>
|
||||
<if test="permCode != null and permCode != ''">and perm_code = #{permCode}</if>
|
||||
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
|
||||
<if test="gmtCreate != null and gmtCreate != ''">and gmt_create = #{gmtCreate}</if>
|
||||
<if test="gmtModified != null and gmtModified != ''">and gmt_modified = #{gmtModified}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="save" parameterType="com.java2nb.system.domain.DataPermDO" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_data_perm
|
||||
(`name`,
|
||||
`table_name`,
|
||||
`module_name`,
|
||||
`crl_attr_name`,
|
||||
`crl_column_name`,
|
||||
`perm_code`,
|
||||
`order_num`,
|
||||
`gmt_create`,
|
||||
`gmt_modified`)
|
||||
values (#{name},
|
||||
#{tableName},
|
||||
#{moduleName},
|
||||
#{crlAttrName},
|
||||
#{crlColumnName},
|
||||
#{permCode},
|
||||
#{orderNum},
|
||||
#{gmtCreate},
|
||||
#{gmtModified})
|
||||
</insert>
|
||||
|
||||
<insert id="saveSelective" parameterType="com.java2nb.system.domain.DataPermDO" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into sys_data_perm
|
||||
(
|
||||
<if test="id != null">`id`,</if>
|
||||
<if test="name != null">`name`,</if>
|
||||
<if test="tableName != null">`table_name`,</if>
|
||||
<if test="moduleName != null">`module_name`,</if>
|
||||
<if test="crlAttrName != null">`crl_attr_name`,</if>
|
||||
<if test="crlColumnName != null">`crl_column_name`,</if>
|
||||
<if test="permCode != null">`perm_code`,</if>
|
||||
<if test="orderNum != null">`order_num`,</if>
|
||||
<if test="gmtCreate != null">`gmt_create`,</if>
|
||||
<if test="gmtModified != null">`gmt_modified`</if>
|
||||
)
|
||||
values
|
||||
(
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="tableName != null">#{tableName},</if>
|
||||
<if test="moduleName != null">#{moduleName},</if>
|
||||
<if test="crlAttrName != null">#{crlAttrName},</if>
|
||||
<if test="crlColumnName != null">#{crlColumnName},</if>
|
||||
<if test="permCode != null">#{permCode},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="gmtCreate != null">#{gmtCreate},</if>
|
||||
<if test="gmtModified != null">#{gmtModified}</if>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.java2nb.system.domain.DataPermDO">
|
||||
update sys_data_perm
|
||||
<set>
|
||||
<if test="name != null">`name` = #{name},</if>
|
||||
<if test="tableName != null">`table_name` = #{tableName},</if>
|
||||
<if test="moduleName != null">`module_name` = #{moduleName},</if>
|
||||
<if test="crlAttrName != null">`crl_attr_name` = #{crlAttrName},</if>
|
||||
<if test="crlColumnName != null">`crl_column_name` = #{crlColumnName},</if>
|
||||
<if test="permCode != null">`perm_code` = #{permCode},</if>
|
||||
<if test="orderNum != null">`order_num` = #{orderNum},</if>
|
||||
<if test="gmtCreate != null">`gmt_create` = #{gmtCreate},</if>
|
||||
<if test="gmtModified != null">`gmt_modified` = #{gmtModified}</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="remove">
|
||||
delete
|
||||
from sys_data_perm
|
||||
where id = #{value}
|
||||
</delete>
|
||||
|
||||
<delete id="batchRemove">
|
||||
delete from sys_data_perm where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="listModuleName" resultType="com.java2nb.system.domain.DataPermDO">
|
||||
select distinct `module_name` from sys_data_perm ;
|
||||
<select id="listModuleName" resultType="com.java2nb.system.domain.DataPermDO">
|
||||
select `module_name`
|
||||
from sys_data_perm;
|
||||
|
||||
</select>
|
||||
</select>
|
||||
|
||||
<select id="selectDataPermsByUserId" parameterType="long" resultType="com.java2nb.system.domain.DataPermDO">
|
||||
<select id="selectDataPermsByUserId" parameterType="long" resultType="com.java2nb.system.domain.DataPermDO">
|
||||
|
||||
select distinct t1.`table_name`,t1.`module_name`,t1.`crl_attr_name`,t1.`crl_column_name`,t1.`perm_code`
|
||||
from sys_data_perm t1
|
||||
inner join sys_role_data_perm t2 on t1.id = t2.perm_id
|
||||
inner join sys_user_role t3 on t2.role_id = t3.role_id
|
||||
and t3.user_id = #{userId}
|
||||
</select>
|
||||
select t1.`table_name`, t1.`module_name`, t1.`crl_attr_name`, t1.`crl_column_name`, t1.`perm_code`
|
||||
from sys_data_perm t1
|
||||
inner join sys_role_data_perm t2 on t1.id = t2.perm_id
|
||||
inner join sys_user_role t3 on t2.role_id = t3.role_id
|
||||
and t3.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -3,96 +3,102 @@
|
||||
|
||||
<mapper namespace="com.java2nb.system.dao.DeptDao">
|
||||
|
||||
<select id="get" resultType="com.java2nb.system.domain.DeptDO">
|
||||
select
|
||||
`dept_id`,`parent_id`,`name`,`order_num`,`del_flag` from sys_dept
|
||||
where dept_id = #{value}
|
||||
</select>
|
||||
<select id="get" resultType="com.java2nb.system.domain.DeptDO">
|
||||
select `dept_id`,
|
||||
`parent_id`,
|
||||
`name`,
|
||||
`order_num`,
|
||||
`del_flag`
|
||||
from sys_dept
|
||||
where dept_id = #{value}
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.java2nb.system.domain.DeptDO">
|
||||
select `dept_id`,`parent_id`,`name`,`order_num`,`del_flag` from
|
||||
sys_dept
|
||||
<where>
|
||||
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId} </if>
|
||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
|
||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
||||
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum} </if>
|
||||
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag} </if>
|
||||
</where>
|
||||
<choose>
|
||||
<when test="sort != null and sort.trim() != ''">
|
||||
order by ${sort} ${order}
|
||||
</when>
|
||||
<otherwise>
|
||||
order by dept_id desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="offset != null and limit != null">
|
||||
limit #{offset}, #{limit}
|
||||
</if>
|
||||
</select>
|
||||
<select id="list" resultType="com.java2nb.system.domain.DeptDO">
|
||||
select `dept_id`,`parent_id`,`name`,`order_num`,`del_flag` from
|
||||
sys_dept
|
||||
<where>
|
||||
<if test="deptId != null and deptId != ''">and dept_id = #{deptId}</if>
|
||||
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
|
||||
<if test="name != null and name != ''">and name = #{name}</if>
|
||||
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
|
||||
<if test="delFlag != null and delFlag != ''">and del_flag = #{delFlag}</if>
|
||||
</where>
|
||||
<choose>
|
||||
<when test="sort != null and sort.trim() != ''">
|
||||
order by ${sort} ${order}
|
||||
</when>
|
||||
<otherwise>
|
||||
order by dept_id desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="offset != null and limit != null">
|
||||
limit #{offset}, #{limit}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(*) from sys_dept
|
||||
<where>
|
||||
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId} </if>
|
||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
|
||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
||||
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum} </if>
|
||||
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag} </if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="count" resultType="int">
|
||||
select count(*) from sys_dept
|
||||
<where>
|
||||
<if test="deptId != null and deptId != ''">and dept_id = #{deptId}</if>
|
||||
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
|
||||
<if test="name != null and name != ''">and name = #{name}</if>
|
||||
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
|
||||
<if test="delFlag != null and delFlag != ''">and del_flag = #{delFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="save" parameterType="com.java2nb.system.domain.DeptDO"
|
||||
useGeneratedKeys="true" keyProperty="deptId">
|
||||
insert into sys_dept
|
||||
(
|
||||
`parent_id`,
|
||||
`name`,
|
||||
`order_num`,
|
||||
`del_flag`
|
||||
)
|
||||
values
|
||||
(
|
||||
#{parentId},
|
||||
#{name},
|
||||
#{orderNum},
|
||||
#{delFlag}
|
||||
)
|
||||
</insert>
|
||||
<insert id="save" parameterType="com.java2nb.system.domain.DeptDO"
|
||||
useGeneratedKeys="true" keyProperty="deptId">
|
||||
insert into sys_dept
|
||||
(`parent_id`,
|
||||
`name`,
|
||||
`order_num`,
|
||||
`del_flag`)
|
||||
values (#{parentId},
|
||||
#{name},
|
||||
#{orderNum},
|
||||
#{delFlag})
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.java2nb.system.domain.DeptDO">
|
||||
update sys_dept
|
||||
<set>
|
||||
<if test="parentId != null">`parent_id` = #{parentId}, </if>
|
||||
<if test="name != null">`name` = #{name}, </if>
|
||||
<if test="orderNum != null">`order_num` = #{orderNum}, </if>
|
||||
<if test="delFlag != null">`del_flag` = #{delFlag}</if>
|
||||
</set>
|
||||
where dept_id = #{deptId}
|
||||
</update>
|
||||
<update id="update" parameterType="com.java2nb.system.domain.DeptDO">
|
||||
update sys_dept
|
||||
<set>
|
||||
<if test="parentId != null">`parent_id` = #{parentId},</if>
|
||||
<if test="name != null">`name` = #{name},</if>
|
||||
<if test="orderNum != null">`order_num` = #{orderNum},</if>
|
||||
<if test="delFlag != null">`del_flag` = #{delFlag}</if>
|
||||
</set>
|
||||
where dept_id = #{deptId}
|
||||
</update>
|
||||
|
||||
<delete id="remove">
|
||||
delete from sys_dept where dept_id = #{value}
|
||||
</delete>
|
||||
<delete id="remove">
|
||||
delete
|
||||
from sys_dept
|
||||
where dept_id = #{value}
|
||||
</delete>
|
||||
|
||||
<delete id="batchRemove">
|
||||
delete from sys_dept where dept_id in
|
||||
<foreach item="deptId" collection="array" open="(" separator=","
|
||||
close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="listParentDept" resultType="long">
|
||||
select DISTINCT parent_id from sys_dept
|
||||
</select>
|
||||
<delete id="batchRemove">
|
||||
delete from sys_dept where dept_id in
|
||||
<foreach item="deptId" collection="array" open="(" separator=","
|
||||
close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="listParentDept" resultType="long">
|
||||
select parent_id
|
||||
from sys_dept
|
||||
</select>
|
||||
|
||||
<select id="getDeptUserNumber" resultType="int">
|
||||
select count(*) from sys_user where dept_id = #{value}
|
||||
</select>
|
||||
select count(*)
|
||||
from sys_user
|
||||
where dept_id = #{value}
|
||||
</select>
|
||||
|
||||
<select id="getDeptIdsByParentId" parameterType="long" resultType="String">
|
||||
select group_concat(dept_id) from sys_dept where parent_id = #{deptId}
|
||||
</select>
|
||||
<select id="getDeptIdsByParentId" parameterType="long" resultType="String">
|
||||
select group_concat(dept_id)
|
||||
from sys_dept
|
||||
where parent_id = #{deptId}
|
||||
</select>
|
||||
</mapper>
|
@ -3,134 +3,148 @@
|
||||
|
||||
<mapper namespace="com.java2nb.system.dao.MenuDao">
|
||||
|
||||
<select id="get" resultType="com.java2nb.system.domain.MenuDO">
|
||||
select
|
||||
`menu_id`,`parent_id`,`name`,`url`,`perms`,`type`,`icon`,`order_num`,`gmt_create`,`gmt_modified`
|
||||
from sys_menu where menu_id = #{value}
|
||||
</select>
|
||||
<select id="get" resultType="com.java2nb.system.domain.MenuDO">
|
||||
select `menu_id`,
|
||||
`parent_id`,
|
||||
`name`,
|
||||
`url`,
|
||||
`perms`,
|
||||
`type`,
|
||||
`icon`,
|
||||
`order_num`,
|
||||
`gmt_create`,
|
||||
`gmt_modified`
|
||||
from sys_menu
|
||||
where menu_id = #{value}
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.java2nb.system.domain.MenuDO">
|
||||
select
|
||||
`menu_id`,`parent_id`,`name`,`url`,`perms`,`type`,`icon`,`order_num`,`gmt_create`,`gmt_modified`
|
||||
from sys_menu
|
||||
<where>
|
||||
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
|
||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
|
||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
||||
<if test="url != null and url != ''"> and url = #{url} </if>
|
||||
<if test="perms != null and perms != ''"> and perms = #{perms} </if>
|
||||
<if test="type != null and type != ''"> and type = #{type} </if>
|
||||
<if test="icon != null and icon != ''"> and icon = #{icon} </if>
|
||||
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum} </if>
|
||||
<if test="gmtCreate != null and gmtCreate != ''"> and gmt_create = #{gmtCreate} </if>
|
||||
<if test="gmtModified != null and gmtModified != ''"> and gmt_modified = #{gmtModified} </if>
|
||||
</where>
|
||||
<choose>
|
||||
<when test="sort != null and sort.trim() != ''">
|
||||
order by ${sort} ${order}
|
||||
</when>
|
||||
<otherwise>
|
||||
order by menu_id desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="offset != null and limit != null">
|
||||
limit #{offset}, #{limit}
|
||||
</if>
|
||||
</select>
|
||||
<select id="list" resultType="com.java2nb.system.domain.MenuDO">
|
||||
select
|
||||
`menu_id`,`parent_id`,`name`,`url`,`perms`,`type`,`icon`,`order_num`,`gmt_create`,`gmt_modified`
|
||||
from sys_menu
|
||||
<where>
|
||||
<if test="menuId != null and menuId != ''">and menu_id = #{menuId}</if>
|
||||
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
|
||||
<if test="name != null and name != ''">and name = #{name}</if>
|
||||
<if test="url != null and url != ''">and url = #{url}</if>
|
||||
<if test="perms != null and perms != ''">and perms = #{perms}</if>
|
||||
<if test="type != null and type != ''">and type = #{type}</if>
|
||||
<if test="icon != null and icon != ''">and icon = #{icon}</if>
|
||||
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
|
||||
<if test="gmtCreate != null and gmtCreate != ''">and gmt_create = #{gmtCreate}</if>
|
||||
<if test="gmtModified != null and gmtModified != ''">and gmt_modified = #{gmtModified}</if>
|
||||
</where>
|
||||
<choose>
|
||||
<when test="sort != null and sort.trim() != ''">
|
||||
order by ${sort} ${order}
|
||||
</when>
|
||||
<otherwise>
|
||||
order by menu_id desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="offset != null and limit != null">
|
||||
limit #{offset}, #{limit}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(*) from sys_menu
|
||||
<where>
|
||||
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
|
||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
|
||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
||||
<if test="url != null and url != ''"> and url = #{url} </if>
|
||||
<if test="perms != null and perms != ''"> and perms = #{perms} </if>
|
||||
<if test="type != null and type != ''"> and type = #{type} </if>
|
||||
<if test="icon != null and icon != ''"> and icon = #{icon} </if>
|
||||
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum} </if>
|
||||
<if test="gmtCreate != null and gmtCreate != ''"> and gmt_create = #{gmtCreate} </if>
|
||||
<if test="gmtModified != null and gmtModified != ''"> and gmt_modified = #{gmtModified} </if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="count" resultType="int">
|
||||
select count(*) from sys_menu
|
||||
<where>
|
||||
<if test="menuId != null and menuId != ''">and menu_id = #{menuId}</if>
|
||||
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
|
||||
<if test="name != null and name != ''">and name = #{name}</if>
|
||||
<if test="url != null and url != ''">and url = #{url}</if>
|
||||
<if test="perms != null and perms != ''">and perms = #{perms}</if>
|
||||
<if test="type != null and type != ''">and type = #{type}</if>
|
||||
<if test="icon != null and icon != ''">and icon = #{icon}</if>
|
||||
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
|
||||
<if test="gmtCreate != null and gmtCreate != ''">and gmt_create = #{gmtCreate}</if>
|
||||
<if test="gmtModified != null and gmtModified != ''">and gmt_modified = #{gmtModified}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="save" parameterType="com.java2nb.system.domain.MenuDO"
|
||||
useGeneratedKeys="true" keyProperty="menuId">
|
||||
insert into sys_menu
|
||||
(
|
||||
`parent_id`,
|
||||
`name`,
|
||||
`url`,
|
||||
`perms`,
|
||||
`type`,
|
||||
`icon`,
|
||||
`order_num`,
|
||||
`gmt_create`,
|
||||
`gmt_modified`
|
||||
)
|
||||
values
|
||||
(
|
||||
#{parentId},
|
||||
#{name},
|
||||
#{url},
|
||||
#{perms},
|
||||
#{type},
|
||||
#{icon},
|
||||
#{orderNum},
|
||||
#{gmtCreate},
|
||||
#{gmtModified}
|
||||
)
|
||||
</insert>
|
||||
<insert id="save" parameterType="com.java2nb.system.domain.MenuDO"
|
||||
useGeneratedKeys="true" keyProperty="menuId">
|
||||
insert into sys_menu
|
||||
(`parent_id`,
|
||||
`name`,
|
||||
`url`,
|
||||
`perms`,
|
||||
`type`,
|
||||
`icon`,
|
||||
`order_num`,
|
||||
`gmt_create`,
|
||||
`gmt_modified`)
|
||||
values (#{parentId},
|
||||
#{name},
|
||||
#{url},
|
||||
#{perms},
|
||||
#{type},
|
||||
#{icon},
|
||||
#{orderNum},
|
||||
#{gmtCreate},
|
||||
#{gmtModified})
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.java2nb.system.domain.MenuDO">
|
||||
update sys_menu
|
||||
<set>
|
||||
<if test="parentId != null">`parent_id` = #{parentId}, </if>
|
||||
<if test="name != null">`name` = #{name}, </if>
|
||||
<if test="url != null">`url` = #{url}, </if>
|
||||
<if test="perms != null">`perms` = #{perms}, </if>
|
||||
<if test="type != null">`type` = #{type}, </if>
|
||||
<if test="icon != null">`icon` = #{icon}, </if>
|
||||
<if test="orderNum != null">`order_num` = #{orderNum}, </if>
|
||||
<if test="gmtCreate != null">`gmt_create` = #{gmtCreate}, </if>
|
||||
<if test="gmtModified != null">`gmt_modified` = #{gmtModified}</if>
|
||||
</set>
|
||||
where menu_id = #{menuId}
|
||||
</update>
|
||||
<update id="update" parameterType="com.java2nb.system.domain.MenuDO">
|
||||
update sys_menu
|
||||
<set>
|
||||
<if test="parentId != null">`parent_id` = #{parentId},</if>
|
||||
<if test="name != null">`name` = #{name},</if>
|
||||
<if test="url != null">`url` = #{url},</if>
|
||||
<if test="perms != null">`perms` = #{perms},</if>
|
||||
<if test="type != null">`type` = #{type},</if>
|
||||
<if test="icon != null">`icon` = #{icon},</if>
|
||||
<if test="orderNum != null">`order_num` = #{orderNum},</if>
|
||||
<if test="gmtCreate != null">`gmt_create` = #{gmtCreate},</if>
|
||||
<if test="gmtModified != null">`gmt_modified` = #{gmtModified}</if>
|
||||
</set>
|
||||
where menu_id = #{menuId}
|
||||
</update>
|
||||
|
||||
<delete id="remove">
|
||||
delete from sys_menu where menu_id = #{value}
|
||||
</delete>
|
||||
<delete id="remove">
|
||||
delete
|
||||
from sys_menu
|
||||
where menu_id = #{value}
|
||||
</delete>
|
||||
|
||||
<delete id="batchRemove">
|
||||
delete from sys_menu where menu_id in
|
||||
<foreach item="menuId" collection="array" open="(" separator=","
|
||||
close=")">
|
||||
#{menuId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="batchRemove">
|
||||
delete from sys_menu where menu_id in
|
||||
<foreach item="menuId" collection="array" open="(" separator=","
|
||||
close=")">
|
||||
#{menuId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="listMenuByUserId" resultType="com.java2nb.system.domain.MenuDO">
|
||||
select distinct
|
||||
m.menu_id , parent_id, name, url,
|
||||
perms,`type`,icon,order_num,gmt_create, gmt_modified
|
||||
from sys_menu m
|
||||
left
|
||||
join sys_role_menu rm on m.menu_id = rm.menu_id left join
|
||||
sys_user_role ur
|
||||
on rm.role_id =ur.role_id where ur.user_id = #{id}
|
||||
and
|
||||
m.type in(0,1)
|
||||
order by
|
||||
m.order_num
|
||||
</select>
|
||||
<select id="listMenuByUserId" resultType="com.java2nb.system.domain.MenuDO">
|
||||
select m.menu_id,
|
||||
parent_id,
|
||||
name,
|
||||
url,
|
||||
perms,
|
||||
`type`,
|
||||
icon,
|
||||
order_num,
|
||||
gmt_create,
|
||||
gmt_modified
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join
|
||||
sys_user_role ur
|
||||
on rm.role_id = ur.role_id
|
||||
where ur.user_id = #{id}
|
||||
and m.type in (0, 1)
|
||||
order by m.order_num
|
||||
</select>
|
||||
|
||||
<select id="listUserPerms" resultType="string">
|
||||
select distinct m.perms
|
||||
from sys_menu m left join
|
||||
sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join sys_user_role ur
|
||||
on rm.role_id = ur.role_id where ur.user_id
|
||||
= #{id}
|
||||
</select>
|
||||
<select id="listUserPerms" resultType="string">
|
||||
select m.perms
|
||||
from sys_menu m
|
||||
left join
|
||||
sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join sys_user_role ur
|
||||
on rm.role_id = ur.role_id
|
||||
where ur.user_id
|
||||
= #{id}
|
||||
</select>
|
||||
</mapper>
|
@ -4,8 +4,28 @@
|
||||
<mapper namespace="com.java2nb.system.dao.SysUserDao">
|
||||
|
||||
<select id="get" resultType="com.java2nb.system.domain.UserDO">
|
||||
select `user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district` from sys_user where user_id = #{value}
|
||||
</select>
|
||||
select `user_id`,
|
||||
`username`,
|
||||
`name`,
|
||||
`password`,
|
||||
`dept_id`,
|
||||
`email`,
|
||||
`mobile`,
|
||||
`status`,
|
||||
`user_id_create`,
|
||||
`gmt_create`,
|
||||
`gmt_modified`,
|
||||
`sex`,
|
||||
`birth`,
|
||||
`pic_id`,
|
||||
`live_address`,
|
||||
`hobby`,
|
||||
`province`,
|
||||
`city`,
|
||||
`district`
|
||||
from sys_user
|
||||
where user_id = #{value}
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.java2nb.system.domain.UserDO">
|
||||
select
|
||||
@ -51,7 +71,8 @@
|
||||
</select>
|
||||
|
||||
<select id="listByPerm" resultType="com.java2nb.system.domain.UserDO">
|
||||
select `user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district`
|
||||
select
|
||||
`user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district`
|
||||
from (
|
||||
select
|
||||
`user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district`
|
||||
@ -97,7 +118,8 @@
|
||||
</select>
|
||||
<select id="countByPerm" resultType="int">
|
||||
select count(*) from (
|
||||
select `user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district`
|
||||
select
|
||||
`user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district`
|
||||
from sys_user
|
||||
<where>
|
||||
<if test="userId != null and userId != ''">and user_id = #{userId}</if>
|
||||
@ -149,49 +171,44 @@
|
||||
</select>
|
||||
|
||||
<insert id="save" parameterType="com.java2nb.system.domain.UserDO" useGeneratedKeys="true" keyProperty="userId">
|
||||
insert into sys_user
|
||||
(
|
||||
`username`,
|
||||
`name`,
|
||||
`password`,
|
||||
`dept_id`,
|
||||
`email`,
|
||||
`mobile`,
|
||||
`status`,
|
||||
`user_id_create`,
|
||||
`gmt_create`,
|
||||
`gmt_modified`,
|
||||
`sex`,
|
||||
`birth`,
|
||||
`pic_id`,
|
||||
`live_address`,
|
||||
`hobby`,
|
||||
`province`,
|
||||
`city`,
|
||||
`district`
|
||||
)
|
||||
values
|
||||
(
|
||||
#{username},
|
||||
#{name},
|
||||
#{password},
|
||||
#{deptId},
|
||||
#{email},
|
||||
#{mobile},
|
||||
#{status},
|
||||
#{userIdCreate},
|
||||
#{gmtCreate},
|
||||
#{gmtModified},
|
||||
#{sex},
|
||||
#{birth},
|
||||
#{picId},
|
||||
#{liveAddress},
|
||||
#{hobby},
|
||||
#{province},
|
||||
#{city},
|
||||
#{district}
|
||||
)
|
||||
</insert>
|
||||
insert into sys_user
|
||||
(`username`,
|
||||
`name`,
|
||||
`password`,
|
||||
`dept_id`,
|
||||
`email`,
|
||||
`mobile`,
|
||||
`status`,
|
||||
`user_id_create`,
|
||||
`gmt_create`,
|
||||
`gmt_modified`,
|
||||
`sex`,
|
||||
`birth`,
|
||||
`pic_id`,
|
||||
`live_address`,
|
||||
`hobby`,
|
||||
`province`,
|
||||
`city`,
|
||||
`district`)
|
||||
values (#{username},
|
||||
#{name},
|
||||
#{password},
|
||||
#{deptId},
|
||||
#{email},
|
||||
#{mobile},
|
||||
#{status},
|
||||
#{userIdCreate},
|
||||
#{gmtCreate},
|
||||
#{gmtModified},
|
||||
#{sex},
|
||||
#{birth},
|
||||
#{picId},
|
||||
#{liveAddress},
|
||||
#{hobby},
|
||||
#{province},
|
||||
#{city},
|
||||
#{district})
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.java2nb.system.domain.UserDO">
|
||||
update sys_user
|
||||
@ -219,8 +236,10 @@
|
||||
</update>
|
||||
|
||||
<delete id="remove">
|
||||
delete from sys_user where user_id = #{value}
|
||||
</delete>
|
||||
delete
|
||||
from sys_user
|
||||
where user_id = #{value}
|
||||
</delete>
|
||||
|
||||
<delete id="batchRemove">
|
||||
delete from sys_user where user_id in
|
||||
@ -230,7 +249,8 @@
|
||||
</delete>
|
||||
|
||||
<select id="listAllDept" resultType="long">
|
||||
select DISTINCT dept_id from sys_user
|
||||
</select>
|
||||
select dept_id
|
||||
from sys_user
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -134,6 +134,18 @@ function load() {
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '入库时间'
|
||||
},
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
field: 'id',
|
||||
align: 'center',
|
||||
formatter: function (value, row, index) {
|
||||
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 r;
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
|
@ -0,0 +1,107 @@
|
||||
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/bookContent/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: {
|
||||
},
|
||||
messages: {
|
||||
}
|
||||
})
|
||||
}
|
@ -0,0 +1,189 @@
|
||||
var prefix = "/novel/bookContent"
|
||||
$(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: 'id',
|
||||
title: '主键'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'indexId',
|
||||
title: '目录ID'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'content',
|
||||
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 d + 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,103 @@
|
||||
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/bookContent/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: {
|
||||
},
|
||||
messages: {
|
||||
}
|
||||
})
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
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/bookIndex/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: {
|
||||
},
|
||||
messages: {
|
||||
}
|
||||
})
|
||||
}
|
@ -0,0 +1,231 @@
|
||||
var prefix = "/novel/bookIndex"
|
||||
$(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: 'id',
|
||||
title: '主键'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'bookId',
|
||||
title: '小说ID'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'indexNum',
|
||||
title: '目录号'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'indexName',
|
||||
title: '目录名'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'wordCount',
|
||||
title: '字数'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'isVip',
|
||||
title: '是否收费,1:收费,0:免费'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'bookPrice',
|
||||
title: '章节费用(屋币)'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'storageType',
|
||||
title: '存储方式'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'createTime',
|
||||
title: ''
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'updateTime',
|
||||
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 d + 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,103 @@
|
||||
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/bookIndex/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: {
|
||||
},
|
||||
messages: {
|
||||
}
|
||||
})
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
-- 菜单SQL
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
VALUES ('1', '小说内容表', 'novel/bookContent', 'novel:bookContent:bookContent', '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:bookContent:detail', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '新增', null, 'novel:bookContent:add', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '修改', null, 'novel:bookContent:edit', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '删除', null, 'novel:bookContent:remove', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '批量删除', null, 'novel:bookContent:batchRemove', '2', null, '6';
|
@ -0,0 +1,18 @@
|
||||
-- 菜单SQL
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
VALUES ('1', '小说目录表', 'novel/bookIndex', 'novel:bookIndex:bookIndex', '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:bookIndex:detail', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '新增', null, 'novel:bookIndex:add', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '修改', null, 'novel:bookIndex:edit', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '删除', null, 'novel:bookIndex:remove', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '批量删除', null, 'novel:bookIndex: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">目录ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="indexId" name="indexId"
|
||||
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="content" name="content"
|
||||
class="form-control"
|
||||
type="text">
|
||||
|
||||
</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/bookContent/add.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,66 @@
|
||||
<!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:bookContent:add" type="button"
|
||||
class="btn btn-primary" onclick="add()">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>添加
|
||||
</button>
|
||||
<button shiro:hasPermission="novel:bookContent:batchRemove" type="button"
|
||||
class="btn btn-danger"
|
||||
onclick="batchRemove()">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>删除
|
||||
</button>
|
||||
</div>
|
||||
<div class="columns pull-right">
|
||||
<button class="btn btn-success" onclick="reLoad()">查询</button>
|
||||
</div>
|
||||
|
||||
<form id="searchForm">
|
||||
<div class="columns pull-right col-md-2">
|
||||
<input id="id" name="id" type="text" class="form-control"
|
||||
placeholder="主键">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</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:bookContent:edit">
|
||||
<script type="text/javascript">
|
||||
s_edit_h = '';
|
||||
</script>
|
||||
</div>
|
||||
<div shiro:hasPermission="novel:bookContent: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/bookContent/bookContent.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,42 @@
|
||||
<!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="${bookContent.id}"
|
||||
type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">目录ID:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${bookContent.indexId}">
|
||||
</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="${bookContent.content}">
|
||||
</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="${bookContent.id}"
|
||||
type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">目录ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="indexId" name="indexId"
|
||||
th:value="${bookContent.indexId}"
|
||||
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="content" name="content"
|
||||
th:value="${bookContent.content}"
|
||||
class="form-control"
|
||||
type="text">
|
||||
</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/bookContent/edit.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,113 @@
|
||||
<!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">小说ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="bookId" name="bookId"
|
||||
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="indexNum" name="indexNum"
|
||||
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="indexName" name="indexName"
|
||||
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="wordCount" name="wordCount"
|
||||
class="form-control"
|
||||
type="text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">是否收费,1:收费,0:免费:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="isVip" name="isVip"
|
||||
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="bookPrice" name="bookPrice"
|
||||
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="storageType" name="storageType"
|
||||
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/novel/bookIndex/add.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,66 @@
|
||||
<!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:bookIndex:add" type="button"
|
||||
class="btn btn-primary" onclick="add()">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>添加
|
||||
</button>
|
||||
<button shiro:hasPermission="novel:bookIndex:batchRemove" type="button"
|
||||
class="btn btn-danger"
|
||||
onclick="batchRemove()">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>删除
|
||||
</button>
|
||||
</div>
|
||||
<div class="columns pull-right">
|
||||
<button class="btn btn-success" onclick="reLoad()">查询</button>
|
||||
</div>
|
||||
|
||||
<form id="searchForm">
|
||||
<div class="columns pull-right col-md-2">
|
||||
<input id="id" name="id" type="text" class="form-control"
|
||||
placeholder="主键">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</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:bookIndex:edit">
|
||||
<script type="text/javascript">
|
||||
s_edit_h = '';
|
||||
</script>
|
||||
</div>
|
||||
<div shiro:hasPermission="novel:bookIndex: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/bookIndex/bookIndex.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,110 @@
|
||||
<!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="${bookIndex.id}"
|
||||
type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">小说ID:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${bookIndex.bookId}">
|
||||
</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="${bookIndex.indexNum}">
|
||||
</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="${bookIndex.indexName}">
|
||||
</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="${bookIndex.wordCount}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">是否收费,1:收费,0:免费:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${bookIndex.isVip}">
|
||||
</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="${bookIndex.bookPrice}">
|
||||
</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="${bookIndex.storageType}">
|
||||
</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="${bookIndex.createTime}==null?null:${#dates.format(bookIndex.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="${bookIndex.updateTime}==null?null:${#dates.format(bookIndex.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,115 @@
|
||||
<!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="${bookIndex.id}"
|
||||
type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">小说ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="bookId" name="bookId"
|
||||
th:value="${bookIndex.bookId}"
|
||||
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="indexNum" name="indexNum"
|
||||
th:value="${bookIndex.indexNum}"
|
||||
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="indexName" name="indexName"
|
||||
th:value="${bookIndex.indexName}"
|
||||
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="wordCount" name="wordCount"
|
||||
th:value="${bookIndex.wordCount}"
|
||||
class="form-control"
|
||||
type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">是否收费,1:收费,0:免费:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="isVip" name="isVip"
|
||||
th:value="${bookIndex.isVip}"
|
||||
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="bookPrice" name="bookPrice"
|
||||
th:value="${bookIndex.bookPrice}"
|
||||
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="storageType" name="storageType"
|
||||
th:value="${bookIndex.storageType}"
|
||||
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="${bookIndex.createTime}==null?null:${#dates.format(bookIndex.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="${bookIndex.updateTime}==null?null:${#dates.format(bookIndex.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/novel/bookIndex/edit.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user