mirror of
https://github.com/201206030/novel-plus.git
synced 2025-07-04 08:26:37 +00:00
feat: 后台网站信息管理
This commit is contained in:
@ -0,0 +1,50 @@
|
||||
package com.java2nb.novel.controller;
|
||||
|
||||
import com.java2nb.common.utils.R;
|
||||
import com.java2nb.novel.domain.WebsiteInfoDO;
|
||||
import com.java2nb.novel.service.WebsiteInfoService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
* 网站信息表
|
||||
*
|
||||
* @author xiongxy
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2023-04-14 11:05:43
|
||||
*/
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/novel/websiteInfo")
|
||||
public class WebsiteInfoController {
|
||||
|
||||
@Autowired
|
||||
private WebsiteInfoService websiteInfoService;
|
||||
|
||||
@GetMapping()
|
||||
@RequiresPermissions("novel:websiteInfo:detail")
|
||||
String detail(Model model) {
|
||||
WebsiteInfoDO websiteInfo = websiteInfoService.get(1L);
|
||||
model.addAttribute("websiteInfo", websiteInfo);
|
||||
return "novel/websiteInfo/detail";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@ApiOperation(value = "修改网站信息表", notes = "修改网站信息表")
|
||||
@ResponseBody
|
||||
@RequestMapping("/update")
|
||||
@RequiresPermissions("novel:websiteInfo:edit")
|
||||
public R update(WebsiteInfoDO websiteInfo) {
|
||||
websiteInfoService.update(websiteInfo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.java2nb.novel.dao;
|
||||
|
||||
import com.java2nb.novel.domain.WebsiteInfoDO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 网站信息表
|
||||
* @author xiongxy
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2023-04-14 11:05:43
|
||||
*/
|
||||
@Mapper
|
||||
public interface WebsiteInfoDao {
|
||||
|
||||
WebsiteInfoDO get(Long id);
|
||||
|
||||
List<WebsiteInfoDO> list(Map<String,Object> map);
|
||||
|
||||
int count(Map<String,Object> map);
|
||||
|
||||
int save(WebsiteInfoDO websiteInfo);
|
||||
|
||||
int update(WebsiteInfoDO websiteInfo);
|
||||
|
||||
int remove(Long id);
|
||||
|
||||
int batchRemove(Long[] ids);
|
||||
}
|
@ -0,0 +1,208 @@
|
||||
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 11:05:43
|
||||
*/
|
||||
public class WebsiteInfoDO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
//主键
|
||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||
//所以通过序列化成字符串来解决
|
||||
@JsonSerialize(using = LongToStringSerializer.class)
|
||||
private Long id;
|
||||
//网站名
|
||||
private String name;
|
||||
//网站域名
|
||||
private String domain;
|
||||
//SEO关键词
|
||||
private String keyword;
|
||||
//网站描述
|
||||
private String description;
|
||||
//站长QQ
|
||||
private String qq;
|
||||
//网站logo图片(默认)
|
||||
private String logo;
|
||||
//网站logo图片(深色)
|
||||
private String logoDark;
|
||||
//创建时间
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
//创建人ID
|
||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||
//所以通过序列化成字符串来解决
|
||||
@JsonSerialize(using = LongToStringSerializer.class)
|
||||
private Long createUserId;
|
||||
//更新时间
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
//更新人ID
|
||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||
//所以通过序列化成字符串来解决
|
||||
@JsonSerialize(using = LongToStringSerializer.class)
|
||||
private Long updateUserId;
|
||||
|
||||
/**
|
||||
* 设置:主键
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
/**
|
||||
* 获取:主键
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
/**
|
||||
* 设置:网站名
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
/**
|
||||
* 获取:网站名
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
/**
|
||||
* 设置:网站域名
|
||||
*/
|
||||
public void setDomain(String domain) {
|
||||
this.domain = domain;
|
||||
}
|
||||
/**
|
||||
* 获取:网站域名
|
||||
*/
|
||||
public String getDomain() {
|
||||
return domain;
|
||||
}
|
||||
/**
|
||||
* 设置:SEO关键词
|
||||
*/
|
||||
public void setKeyword(String keyword) {
|
||||
this.keyword = keyword;
|
||||
}
|
||||
/**
|
||||
* 获取:SEO关键词
|
||||
*/
|
||||
public String getKeyword() {
|
||||
return keyword;
|
||||
}
|
||||
/**
|
||||
* 设置:网站描述
|
||||
*/
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
/**
|
||||
* 获取:网站描述
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
/**
|
||||
* 设置:站长QQ
|
||||
*/
|
||||
public void setQq(String qq) {
|
||||
this.qq = qq;
|
||||
}
|
||||
/**
|
||||
* 获取:站长QQ
|
||||
*/
|
||||
public String getQq() {
|
||||
return qq;
|
||||
}
|
||||
/**
|
||||
* 设置:网站logo图片(默认)
|
||||
*/
|
||||
public void setLogo(String logo) {
|
||||
this.logo = logo;
|
||||
}
|
||||
/**
|
||||
* 获取:网站logo图片(默认)
|
||||
*/
|
||||
public String getLogo() {
|
||||
return logo;
|
||||
}
|
||||
/**
|
||||
* 设置:网站logo图片(深色)
|
||||
*/
|
||||
public void setLogoDark(String logoDark) {
|
||||
this.logoDark = logoDark;
|
||||
}
|
||||
/**
|
||||
* 获取:网站logo图片(深色)
|
||||
*/
|
||||
public String getLogoDark() {
|
||||
return logoDark;
|
||||
}
|
||||
/**
|
||||
* 设置:创建时间
|
||||
*/
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
/**
|
||||
* 获取:创建时间
|
||||
*/
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
/**
|
||||
* 设置:创建人ID
|
||||
*/
|
||||
public void setCreateUserId(Long createUserId) {
|
||||
this.createUserId = createUserId;
|
||||
}
|
||||
/**
|
||||
* 获取:创建人ID
|
||||
*/
|
||||
public Long getCreateUserId() {
|
||||
return createUserId;
|
||||
}
|
||||
/**
|
||||
* 设置:更新时间
|
||||
*/
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
/**
|
||||
* 获取:更新时间
|
||||
*/
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
/**
|
||||
* 设置:更新人ID
|
||||
*/
|
||||
public void setUpdateUserId(Long updateUserId) {
|
||||
this.updateUserId = updateUserId;
|
||||
}
|
||||
/**
|
||||
* 获取:更新人ID
|
||||
*/
|
||||
public Long getUpdateUserId() {
|
||||
return updateUserId;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.java2nb.novel.service;
|
||||
|
||||
import com.java2nb.novel.domain.WebsiteInfoDO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 网站信息表
|
||||
*
|
||||
* @author xiongxy
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2023-04-14 11:05:43
|
||||
*/
|
||||
public interface WebsiteInfoService {
|
||||
|
||||
WebsiteInfoDO get(Long id);
|
||||
|
||||
List<WebsiteInfoDO> list(Map<String, Object> map);
|
||||
|
||||
int count(Map<String, Object> map);
|
||||
|
||||
int save(WebsiteInfoDO websiteInfo);
|
||||
|
||||
int update(WebsiteInfoDO websiteInfo);
|
||||
|
||||
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.WebsiteInfoDao;
|
||||
import com.java2nb.novel.domain.WebsiteInfoDO;
|
||||
import com.java2nb.novel.service.WebsiteInfoService;
|
||||
|
||||
|
||||
|
||||
@Service
|
||||
public class WebsiteInfoServiceImpl implements WebsiteInfoService {
|
||||
@Autowired
|
||||
private WebsiteInfoDao websiteInfoDao;
|
||||
|
||||
@Override
|
||||
public WebsiteInfoDO get(Long id){
|
||||
return websiteInfoDao.get(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WebsiteInfoDO> list(Map<String, Object> map){
|
||||
return websiteInfoDao.list(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int count(Map<String, Object> map){
|
||||
return websiteInfoDao.count(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int save(WebsiteInfoDO websiteInfo){
|
||||
return websiteInfoDao.save(websiteInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(WebsiteInfoDO websiteInfo){
|
||||
return websiteInfoDao.update(websiteInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int remove(Long id){
|
||||
return websiteInfoDao.remove(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchRemove(Long[] ids){
|
||||
return websiteInfoDao.batchRemove(ids);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user