update 2021年11月16日18:24:41
parent
beafe4f82f
commit
7a4321c911
|
|
@ -66,6 +66,11 @@
|
|||
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-starter-client</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.oschina.zcx7878</groupId>
|
||||
<artifactId>fastdfs-client-java</artifactId>
|
||||
|
|
@ -80,7 +85,6 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-freemarker</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
package com.zhangmeng.admin.manager.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zhangmeng.admin.manager.service.TagsService;
|
||||
import com.zhangmeng.model.base.baseController.BaseController;
|
||||
import com.zhangmeng.model.base.baseUtil.CommonUtil;
|
||||
import com.zhangmeng.model.dto.query.QueryParams;
|
||||
import com.zhangmeng.model.entity.Tags;
|
||||
import com.zhangmeng.model.vo.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
import tk.mybatis.mapper.entity.Condition;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author zhangmeng
|
||||
* @version 1.0
|
||||
* @date 2021年8月20日08:44:26
|
||||
*/
|
||||
@Api(tags = "标签管理")
|
||||
@RestController
|
||||
@RequestMapping("/tags")
|
||||
public class TagsController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private TagsService tagsService;
|
||||
|
||||
@ApiOperation("标签列表")
|
||||
@GetMapping("/list")
|
||||
public Result list(String tagName, Integer pageNum, Integer pageSize) {
|
||||
CommonUtil.page_params_verify(pageNum, pageSize); //校验
|
||||
Condition condition = new Condition(Tags.class);
|
||||
Example.Criteria criteria = condition.createCriteria();
|
||||
if (tagName != null && !tagName.equals("")) {
|
||||
criteria.andLike("tagName", "%" + tagName + "%");
|
||||
}
|
||||
PageInfo<Tags> pageInfo = this.tagsService.findByCondition(new QueryParams(pageNum, pageSize, "addTime desc"), true);
|
||||
return this.responseJsonData(pageInfo.getTotal(), pageInfo.getList());
|
||||
}
|
||||
|
||||
@ApiOperation("标签保存")
|
||||
@PostMapping("/save")
|
||||
public Result save(@RequestBody @RequestParam Map<String, Object> map) {
|
||||
|
||||
Condition condition = new Condition(Tags.class);
|
||||
Example.Criteria criteria = condition.createCriteria();
|
||||
|
||||
String tagName = CommonUtil.map_get_value(map, "tagName");
|
||||
String tagId = CommonUtil.map_get_value(map, "tagId");
|
||||
Tags tags = null;
|
||||
boolean flag = false;
|
||||
if (tagId == null || tagId.equals("")) {
|
||||
tags = new Tags();
|
||||
flag = true;
|
||||
} else {
|
||||
tags = this.tagsService.findById(Long.parseLong(tagId));
|
||||
}
|
||||
if (tagName != null && !tagName.equals("")) {
|
||||
//判断是否是修改
|
||||
if (flag) {
|
||||
criteria.andEqualTo("tagName", tagName);
|
||||
//查找是否存在
|
||||
List<Tags> tagsList = this.tagsService.findByCondition(condition);
|
||||
if (tagsList.size() > 0) {
|
||||
return this.failure("该标签已经存在,请重新输入!");
|
||||
}
|
||||
}
|
||||
tags.setTagName(tagName);
|
||||
}
|
||||
String description = CommonUtil.map_get_value(map, "description");
|
||||
if (CommonUtil.isNotNull(description)) {
|
||||
tags.setDescription(description);
|
||||
}
|
||||
String tagType = CommonUtil.map_get_value(map, "tagType");
|
||||
if (CommonUtil.isNotNull(tagType)) {
|
||||
Tags.Type type = CommonUtil.getEnum(tagType, Tags.Type.class);
|
||||
tags.setType(type);
|
||||
}
|
||||
String message = null;
|
||||
if (flag) {
|
||||
message = "保存成功";
|
||||
this.tagsService.save(tags);
|
||||
} else {
|
||||
message = "修改成功";
|
||||
this.tagsService.update(tags);
|
||||
}
|
||||
return this.success(message);
|
||||
}
|
||||
|
||||
@ApiOperation("根据id删除标签")
|
||||
@PostMapping("/delete")
|
||||
public Result delete(String tagId) {
|
||||
if (CommonUtil.isNotNull(tagId)) {
|
||||
this.tagsService.deleteById(Long.parseLong(tagId));
|
||||
}
|
||||
return this.success("删除成功!");
|
||||
}
|
||||
|
||||
@ApiOperation("标签批量删除")
|
||||
@PostMapping("/batchRemove")
|
||||
public Result batchRemove(String ids) {
|
||||
if (CommonUtil.isNotNull(ids)) {
|
||||
this.tagsService.deleteByIds(CommonUtil.firstLastComma(ids));
|
||||
}
|
||||
return success("批量删除成功");
|
||||
}
|
||||
}
|
||||
|
|
@ -4,23 +4,24 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zhangmeng.admin.manager.feign.*;
|
||||
import com.zhangmeng.admin.manager.service.PermissionService;
|
||||
import com.zhangmeng.admin.manager.service.RoleService;
|
||||
import com.zhangmeng.admin.manager.service.SysLogService;
|
||||
import com.zhangmeng.admin.manager.service.UserService;
|
||||
import com.zhangmeng.admin.manager.service.*;
|
||||
import com.zhangmeng.admin.manager.utils.UserUtil;
|
||||
import com.zhangmeng.model.base.baseController.BaseController;
|
||||
import com.zhangmeng.model.base.baseUtil.CommonUtil;
|
||||
import com.zhangmeng.model.dto.system.EncryptType;
|
||||
import com.zhangmeng.model.dto.system.Menu;
|
||||
import com.zhangmeng.model.dto.query.QueryParams;
|
||||
import com.zhangmeng.model.dto.system.SysConstant;
|
||||
import com.zhangmeng.model.entity.*;
|
||||
import com.zhangmeng.model.vo.Result;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.web.servlet.view.RedirectView;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
import tk.mybatis.mapper.entity.Condition;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
|
@ -35,6 +36,9 @@ import java.util.*;
|
|||
@Controller
|
||||
public class UrlRequestController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private LoadBalancerClient loadBalancerClient;
|
||||
|
||||
@Autowired
|
||||
private UserUtil userUtil;
|
||||
|
||||
|
|
@ -65,8 +69,11 @@ public class UrlRequestController extends BaseController {
|
|||
@Autowired
|
||||
private FictionFeign fictionFeign;
|
||||
|
||||
@Autowired
|
||||
private TagsService tagsService;
|
||||
|
||||
//跳转首页
|
||||
@GetMapping({"/login","/"})
|
||||
@GetMapping({"/login"})
|
||||
public ModelAndView login (){
|
||||
return this.jumpPage("admin/login");
|
||||
}
|
||||
|
|
@ -347,17 +354,17 @@ public class UrlRequestController extends BaseController {
|
|||
return this.jumpPage("admin/code/form");
|
||||
}
|
||||
|
||||
@GetMapping("/mail/index")
|
||||
@GetMapping(SysConstant.mail_prefix + "/index")
|
||||
public ModelAndView mail_index() {
|
||||
return this.jumpPage("admin/mail/list");
|
||||
}
|
||||
|
||||
@GetMapping("/mail/add")
|
||||
@GetMapping(SysConstant.mail_prefix + "/add")
|
||||
public ModelAndView mail_add() {
|
||||
return this.jumpPage("admin/mail/add");
|
||||
}
|
||||
|
||||
@GetMapping("/mail/edit")
|
||||
@GetMapping(SysConstant.mail_prefix + "/edit")
|
||||
public ModelAndView mail_edit(String mail_id,Model model) {
|
||||
if (mail_id != null ){
|
||||
Mail mail = this.mailFeign.findById(Long.parseLong(mail_id));
|
||||
|
|
@ -368,14 +375,12 @@ public class UrlRequestController extends BaseController {
|
|||
return this.jumpPage("admin/mail/edit");
|
||||
}
|
||||
|
||||
@ApiIgnore
|
||||
@GetMapping("/fiction/add")
|
||||
@GetMapping(SysConstant.fiction_prefix + "/add")
|
||||
public ModelAndView add() {
|
||||
return this.jumpPage("admin/fiction/fiction_add");
|
||||
}
|
||||
|
||||
@ApiIgnore
|
||||
@GetMapping("/fiction/chapter/{id}")
|
||||
@GetMapping(SysConstant.fiction_prefix + "/chapter/{id}")
|
||||
public ModelAndView chapter(Model model, @PathVariable Long id) {
|
||||
|
||||
Fiction fiction = this.fictionFeign.findById(id);
|
||||
|
|
@ -386,8 +391,7 @@ public class UrlRequestController extends BaseController {
|
|||
return this.jumpPage("xiaoshuo/fiction_chapter");
|
||||
}
|
||||
|
||||
@ApiIgnore
|
||||
@GetMapping("/details/{chapter_id}")
|
||||
@GetMapping(SysConstant.fiction_prefix + "/details/{chapter_id}")
|
||||
public ModelAndView details(Model model, @PathVariable String chapter_id){
|
||||
|
||||
String replace = chapter_id.replace(",", "");
|
||||
|
|
@ -405,8 +409,8 @@ public class UrlRequestController extends BaseController {
|
|||
}
|
||||
|
||||
@ApiIgnore
|
||||
@GetMapping("/fiction/index")
|
||||
public ModelAndView index(Model model, Integer pageNum, Integer pageSize) {
|
||||
@GetMapping(SysConstant.fiction_prefix + "/index")
|
||||
public ModelAndView fiction_index(Model model, Integer pageNum, Integer pageSize) {
|
||||
|
||||
if (pageNum == null || pageSize == null) {
|
||||
pageNum = pageNum == null ? 1 : pageNum;
|
||||
|
|
@ -428,16 +432,60 @@ public class UrlRequestController extends BaseController {
|
|||
return this.jumpPage("xiaoshuo/index");
|
||||
}
|
||||
|
||||
@GetMapping("/fictionCollection/index")
|
||||
@GetMapping(SysConstant.fictionCollection_prefix + "/index")
|
||||
public ModelAndView fictionCollection_index() {
|
||||
return this.jumpPage("admin/fiction/fiction_list");
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/fictionCollection/edit")
|
||||
@GetMapping(SysConstant.fictionCollection_prefix + "/edit")
|
||||
public ModelAndView fictionCollection_edit(@RequestParam("fiction_id") Long fiction_id,Model model){
|
||||
FictionCollection fictionCollection = this.fictionFeign.findFictionCollectionById(fiction_id);
|
||||
model.addAttribute("fictionCollection",fictionCollection);
|
||||
return this.jumpPage("admin/fiction/fiction_edit");
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(SysConstant.tags_prefix + "/index")
|
||||
public ModelAndView tags_index() {
|
||||
return this.jumpPage("admin/tags/list");
|
||||
}
|
||||
|
||||
@GetMapping(SysConstant.tags_prefix + "/add")
|
||||
public ModelAndView tags_add(Model model) {
|
||||
model.addAttribute("tagTypeList", Tags.Type.enumListMap());
|
||||
return this.jumpPage("admin/tags/add");
|
||||
}
|
||||
|
||||
@GetMapping(SysConstant.tags_prefix + "/edit")
|
||||
public ModelAndView tags_edit(Model model, String tagId) {
|
||||
if (CommonUtil.isNotNull(tagId)) {
|
||||
Tags tags = this.tagsService.findById(Long.parseLong(tagId));
|
||||
model.addAttribute("tags", tags);
|
||||
}
|
||||
model.addAttribute("tagTypeList", Tags.Type.enumListMap());
|
||||
return this.jumpPage("admin/tags/edit");
|
||||
}
|
||||
|
||||
@RequestMapping("/zipkin")
|
||||
public RedirectView zipkin_loginPage() {
|
||||
String url = "http://localhost:9411/zipkin/";
|
||||
return new RedirectView(url);
|
||||
}
|
||||
|
||||
@RequestMapping("/sentinel")
|
||||
public RedirectView nacos_loginPage() {
|
||||
String url = "http://localhost:8748/#/login";
|
||||
return new RedirectView(url);
|
||||
}
|
||||
|
||||
@RequestMapping("/boot/admin")
|
||||
public RedirectView boot_admin_loginPage() {
|
||||
ServiceInstance serviceInstance = loadBalancerClient.choose(SysConstant.mystyle_cloud_admin_monitor);
|
||||
if (serviceInstance == null) {
|
||||
throw new RuntimeException("找不到对应的服务");
|
||||
}
|
||||
String path = serviceInstance.getUri().toString();
|
||||
return new RedirectView(path);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package com.zhangmeng.admin.manager.dao;
|
||||
import com.zhangmeng.model.base.baseDao.AbstractBaseMapper;
|
||||
import com.zhangmeng.model.entity.Tags;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TagsDao extends AbstractBaseMapper<Tags> {
|
||||
}
|
||||
|
|
@ -27,6 +27,6 @@ public interface FictionFeign {
|
|||
@GetMapping(SysConstant.mystyle_cloud_fiction_prefix + "/findAllToFiction")
|
||||
List<Fiction> findAll();
|
||||
|
||||
@
|
||||
@GetMapping(SysConstant.fictionCollection_prefix + "/findFictionCollectionById")
|
||||
FictionCollection findFictionCollectionById(@RequestParam("fiction_id") Long fiction_id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
package com.zhangmeng.admin.manager.service;
|
||||
|
||||
import com.zhangmeng.model.base.baseService.BaseService;
|
||||
import com.zhangmeng.model.entity.Tags;
|
||||
|
||||
public interface TagsService extends BaseService<Tags> {
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.zhangmeng.admin.manager.service.impl;
|
||||
|
||||
import com.zhangmeng.admin.manager.service.TagsService;
|
||||
import com.zhangmeng.model.base.baseService.impl.AbstractBaseServiceImpl;
|
||||
import com.zhangmeng.model.entity.Tags;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class TagsServiceImpl extends AbstractBaseServiceImpl<Tags> implements TagsService {
|
||||
|
||||
}
|
||||
|
|
@ -57,7 +57,6 @@ mapper:
|
|||
mystyle:
|
||||
security:
|
||||
open-api:
|
||||
- /
|
||||
- /login
|
||||
- /favicon.ico # 开放FAVICON
|
||||
- /system/**
|
||||
|
|
@ -71,7 +70,18 @@ mystyle:
|
|||
- /v3/api-docs
|
||||
- /doc.html
|
||||
- /webjars/**
|
||||
- /actuator/**
|
||||
- /instances/**
|
||||
verification-code:
|
||||
type: mysql
|
||||
expiration-time: 300
|
||||
redis-key: redis-29b9f4ddcf8072d2f856a67f76957821
|
||||
redis-key: redis-29b9f4ddcf8072d2f856a67f76957821
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: '*'
|
||||
endpoint:
|
||||
health:
|
||||
show-details: ALWAYS
|
||||
enabled: true
|
||||
|
|
@ -136,6 +136,18 @@ var fiction_save_url = gate_way_url + "/" + fiction_url + "/fiction/save";
|
|||
//小说集合列表
|
||||
var fictionCollection_list_url = gate_way_url + "/" + fiction_url + "/fictionCollection/list";
|
||||
var fictionCollection_add_url = gate_way_url + "/" + admin_manager_url + "/fiction/add" + access_token_url;
|
||||
//标签列表
|
||||
var tags_list_url = gate_way_url + "/" + admin_manager_url + "/tags/list";
|
||||
//新增标签
|
||||
var tags_add_url = gate_way_url + "/" + admin_manager_url + "/tags/add" + access_token_url;
|
||||
//标签保存
|
||||
var tags_save_url = gate_way_url + "/" + admin_manager_url + "/tags/save";
|
||||
//标签删除
|
||||
var tags_delete_url = gate_way_url + "/" + admin_manager_url;
|
||||
//标签批量删除
|
||||
var tags_batchRemove_url = gate_way_url + "/" + admin_manager_url + "/tags/batchRemove";
|
||||
//标签编辑
|
||||
var tags_edit_url = gate_way_url + "/" + admin_manager_url + "/tags/edit" + access_token_url ;
|
||||
|
||||
//页面跳转
|
||||
function postToPage(url, token) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>标签添加</title>
|
||||
<link rel="stylesheet" href="${springMacroRequestContext.contextPath}/system/component/pear/css/pear.css" />
|
||||
<link rel="stylesheet" href="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/pear/css/pear.css" />
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
|
|
@ -51,8 +51,9 @@
|
|||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script src="${springMacroRequestContext.contextPath}/system/component/layui/layui.js"></script>
|
||||
<script src="${springMacroRequestContext.contextPath}/system/component/pear/pear.js"></script>
|
||||
<script src="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/layui/layui.js"></script>
|
||||
<script src="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/pear/pear.js"></script>
|
||||
<script src="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/admin/js/mystyle-admin.js"></script>
|
||||
<script>
|
||||
layui.use(['form','jquery'],function(){
|
||||
let form = layui.form;
|
||||
|
|
@ -60,9 +61,9 @@
|
|||
|
||||
form.on('submit(tags-save)', function(data){
|
||||
var obj = data.field;
|
||||
obj['token'] = localStorage.getItem("token");
|
||||
obj['access_token'] = access_token;
|
||||
$.ajax({
|
||||
url:'/tags/save',
|
||||
url:tags_save_url,
|
||||
data:obj,
|
||||
type:'post',
|
||||
success:function(result){
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>分类编辑</title>
|
||||
<link rel="stylesheet" href="${springMacroRequestContext.contextPath}/system/component/pear/css/pear.css"/>
|
||||
<link rel="stylesheet" href="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/pear/css/pear.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
|
|
@ -62,8 +62,9 @@
|
|||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script src="${springMacroRequestContext.contextPath}/system/component/layui/layui.js"></script>
|
||||
<script src="${springMacroRequestContext.contextPath}/system/component/pear/pear.js"></script>
|
||||
<script src="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/layui/layui.js"></script>
|
||||
<script src="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/pear/pear.js"></script>
|
||||
<script src="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/admin/js/mystyle-admin.js"></script>
|
||||
<script>
|
||||
layui.use(['form', 'jquery'], function () {
|
||||
let form = layui.form;
|
||||
|
|
@ -71,9 +72,9 @@
|
|||
|
||||
form.on('submit(tags-edit)', function (data) {
|
||||
var obj = data.field;
|
||||
obj['token'] = localStorage.getItem("token");
|
||||
obj['access_token'] = access_token;
|
||||
$.ajax({
|
||||
url: '/tags/save',
|
||||
url: tags_save_url,
|
||||
data: obj,
|
||||
type: 'post',
|
||||
success: function (result) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>分类管理</title>
|
||||
<link rel="stylesheet" href="${springMacroRequestContext.contextPath}/system/component/pear/css/pear.css" />
|
||||
<link rel="stylesheet"
|
||||
href="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/pear/css/pear.css"/>
|
||||
</head>
|
||||
<body class="pear-container">
|
||||
<div class="layui-card">
|
||||
|
|
@ -49,22 +50,26 @@
|
|||
</script>
|
||||
|
||||
<script type="text/html" id="tags-bar">
|
||||
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i class="layui-icon layui-icon-edit"></i></button>
|
||||
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i class="layui-icon layui-icon-delete"></i></button>
|
||||
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>
|
||||
</button>
|
||||
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i class="layui-icon layui-icon-delete"></i>
|
||||
</button>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="tags-enable">
|
||||
<input type="checkbox" name="enable" value="{{d.id}}" lay-skin="switch" lay-text="启用|禁用" lay-filter="tags-enable" checked = "{{ d.enable == 0 ? 'true' : 'false' }}">
|
||||
<input type="checkbox" name="enable" value="{{d.id}}" lay-skin="switch" lay-text="启用|禁用" lay-filter="tags-enable"
|
||||
checked="{{ d.enable == 0 ? 'true' : 'false' }}">
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="tags-addTime">
|
||||
{{layui.util.toDateString(d.addTime, 'yyyy-MM-dd HH:mm:ss')}}
|
||||
</script>
|
||||
|
||||
<script src="${springMacroRequestContext.contextPath}/system/component/layui/layui.js"></script>
|
||||
<script src="${springMacroRequestContext.contextPath}/system/component/pear/pear.js"></script>
|
||||
<script src="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/layui/layui.js"></script>
|
||||
<script src="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/pear/pear.js"></script>
|
||||
<script src="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/admin/js/mystyle-admin.js"></script>
|
||||
<script>
|
||||
layui.use(['table', 'form', 'jquery','common'], function() {
|
||||
layui.use(['table', 'form', 'jquery', 'common'], function () {
|
||||
let table = layui.table;
|
||||
let form = layui.form;
|
||||
let $ = layui.jquery;
|
||||
|
|
@ -110,29 +115,31 @@
|
|||
|
||||
table.render({
|
||||
elem: '#tags-table',
|
||||
url: '/tags/list',
|
||||
headers: {token: localStorage.getItem("token")},
|
||||
url: tags_list_url,
|
||||
headers: {
|
||||
access_token: access_token
|
||||
},
|
||||
page: true,
|
||||
cols: cols,
|
||||
skin: 'line',
|
||||
skin: 'rows',
|
||||
toolbar: '#tags-toolbar',
|
||||
defaultToolbar: [{
|
||||
title: '刷新',
|
||||
layEvent: 'refresh',
|
||||
icon: 'layui-icon-refresh',
|
||||
}, 'filter', 'print', 'exports']
|
||||
,request: {
|
||||
, request: {
|
||||
pageName: 'pageNum' //页码的参数名称,默认:page
|
||||
,limitName: 'pageSize' //每页数据量的参数名,默认:limit
|
||||
, limitName: 'pageSize' //每页数据量的参数名,默认:limit
|
||||
}
|
||||
,response: {
|
||||
, response: {
|
||||
statusName: 'code' //规定数据状态的字段名称,默认:code
|
||||
,statusCode: 2001 //规定成功的状态码,默认:0
|
||||
,msgName: 'message' //规定状态信息的字段名称,默认:msg
|
||||
,countName: 'count' //规定数据总数的字段名称,默认:count
|
||||
,dataName: 'data' //规定数据列表的字段名称,默认:data
|
||||
, statusCode: 2001 //规定成功的状态码,默认:0
|
||||
, msgName: 'message' //规定状态信息的字段名称,默认:msg
|
||||
, countName: 'count' //规定数据总数的字段名称,默认:count
|
||||
, dataName: 'data' //规定数据列表的字段名称,默认:data
|
||||
}
|
||||
,parseData: function(res){ //将原始数据解析成 table 组件所规定的数据
|
||||
, parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
|
||||
return {
|
||||
"code": res.code, //解析接口状态
|
||||
"msg": res.message, //解析提示文本
|
||||
|
|
@ -142,7 +149,7 @@
|
|||
}
|
||||
});
|
||||
|
||||
table.on('tool(tags-table)', function(obj) {
|
||||
table.on('tool(tags-table)', function (obj) {
|
||||
if (obj.event === 'remove') {
|
||||
window.remove(obj);
|
||||
} else if (obj.event === 'edit') {
|
||||
|
|
@ -150,7 +157,7 @@
|
|||
}
|
||||
});
|
||||
|
||||
table.on('toolbar(tags-table)', function(obj) {
|
||||
table.on('toolbar(tags-table)', function (obj) {
|
||||
if (obj.event === 'add') {
|
||||
window.add();
|
||||
} else if (obj.event === 'refresh') {
|
||||
|
|
@ -160,59 +167,59 @@
|
|||
}
|
||||
});
|
||||
|
||||
form.on('submit(tags-query)', function(data) {
|
||||
form.on('submit(tags-query)', function (data) {
|
||||
table.reload('tags-table', {
|
||||
where: data.field
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
form.on('switch(tags-enable)', function(obj) {
|
||||
form.on('switch(tags-enable)', function (obj) {
|
||||
layer.tips(this.value + ' ' + this.name + ':' + obj.elem.checked, obj.othis);
|
||||
});
|
||||
|
||||
window.add = function() {
|
||||
window.add = function () {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '新增',
|
||||
shade: 0.1,
|
||||
area: [common.isModile()?'100%':'900px', common.isModile()?'100%':'600px'],
|
||||
content: '/tags/add?token=' + token
|
||||
area: [common.isModile() ? '100%' : '900px', common.isModile() ? '100%' : '600px'],
|
||||
content: tags_add_url
|
||||
});
|
||||
};
|
||||
|
||||
window.edit = function(obj) {
|
||||
window.edit = function (obj) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '修改',
|
||||
shade: 0.1,
|
||||
area: ['900px', '600px'],
|
||||
content: '/tags/edit?token=' + token + '&tagId=' + obj.data.id
|
||||
content: tags_edit_url + '&tagId=' + obj.data.id
|
||||
});
|
||||
};
|
||||
|
||||
window.remove = function(obj) {
|
||||
window.remove = function (obj) {
|
||||
|
||||
layer.confirm('确定要删除该标签', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function(index) {
|
||||
}, function (index) {
|
||||
layer.close(index);
|
||||
let loading = layer.load();
|
||||
$.ajax({
|
||||
url: "/tags/delete",
|
||||
data:{
|
||||
tagId:obj.data['id'],
|
||||
token:token
|
||||
url: tags_delete_url,
|
||||
data: {
|
||||
tagId: obj.data['id'],
|
||||
access_token: access_token
|
||||
},
|
||||
type: 'post',
|
||||
success: function(result) {
|
||||
success: function (result) {
|
||||
layer.close(loading);
|
||||
if (result.flag) {
|
||||
layer.msg(result.message, {
|
||||
icon: 1,
|
||||
time: 1000
|
||||
}, function() {
|
||||
}, function () {
|
||||
obj.del();
|
||||
});
|
||||
} else {
|
||||
|
|
@ -226,9 +233,9 @@
|
|||
});
|
||||
};
|
||||
|
||||
window.batchRemove = function(obj) {
|
||||
window.batchRemove = function (obj) {
|
||||
|
||||
var checkIds = common.checkField(obj,'id');
|
||||
var checkIds = common.checkField(obj, 'id');
|
||||
|
||||
if (checkIds === "") {
|
||||
layer.msg("未选中数据", {
|
||||
|
|
@ -241,23 +248,23 @@
|
|||
layer.confirm('确定要删除这些用户', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function(index) {
|
||||
}, function (index) {
|
||||
layer.close(index);
|
||||
let loading = layer.load();
|
||||
$.ajax({
|
||||
url: "/tags/batchRemove",
|
||||
data:{
|
||||
ids:checkIds,
|
||||
token:token
|
||||
url: tags_batchRemove_url,
|
||||
data: {
|
||||
ids: checkIds,
|
||||
access_token: access_token
|
||||
},
|
||||
type: 'post',
|
||||
success: function(result) {
|
||||
success: function (result) {
|
||||
layer.close(loading);
|
||||
if (result.flag) {
|
||||
layer.msg(result.message, {
|
||||
icon: 1,
|
||||
time: 1000
|
||||
}, function() {
|
||||
}, function () {
|
||||
table.reload('tags-table');
|
||||
});
|
||||
} else {
|
||||
|
|
@ -271,7 +278,7 @@
|
|||
});
|
||||
};
|
||||
|
||||
window.refresh = function(param) {
|
||||
window.refresh = function (param) {
|
||||
table.reload('tags-table');
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,81 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>mystyle-cloud-parent</artifactId>
|
||||
<groupId>com.zhangmeng</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>mystyle-cloud-admin-monitor</artifactId>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>8</source>
|
||||
<target>8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-sleuth</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/de.codecentric/spring-boot-admin-starter-server -->
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-starter-server</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-oauth2</artifactId>
|
||||
<version>2.2.4.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.zhangmeng.monitor;
|
||||
|
||||
import de.codecentric.boot.admin.server.config.EnableAdminServer;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
@EnableAdminServer
|
||||
public class AdminMonitorApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AdminMonitorApplication.class,args);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
package com.zhangmeng.monitor.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
|
||||
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
|
||||
import org.springframework.security.oauth2.provider.token.TokenStore;
|
||||
import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
|
||||
import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author 转身的背影在心底里沉沦
|
||||
* @date 2021年9月14日16:45:29
|
||||
* @version 1.0
|
||||
*/
|
||||
@Configuration
|
||||
@EnableResourceServer
|
||||
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)// 激活方法上的PreAuthorize注解
|
||||
public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
|
||||
|
||||
// 公钥
|
||||
private static final String PUBLIC_KEY = "public.key";
|
||||
|
||||
/***
|
||||
* 定义JwtTokenStore
|
||||
* @param jwtAccessTokenConverter
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public TokenStore tokenStore(JwtAccessTokenConverter jwtAccessTokenConverter) {
|
||||
return new JwtTokenStore(jwtAccessTokenConverter);
|
||||
}
|
||||
|
||||
/***
|
||||
* 定义JJwtAccessTokenConverter
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public JwtAccessTokenConverter jwtAccessTokenConverter() {
|
||||
JwtAccessTokenConverter converter = new JwtAccessTokenConverter();
|
||||
converter.setVerifierKey(getPubKey()); //秘钥的一部分
|
||||
return converter;
|
||||
}
|
||||
/**
|
||||
* 获取非对称加密公钥 Key
|
||||
* @return 公钥 Key
|
||||
*/
|
||||
private String getPubKey() {
|
||||
Resource resource = new ClassPathResource(PUBLIC_KEY);
|
||||
try {
|
||||
InputStreamReader inputStreamReader = new InputStreamReader(resource.getInputStream());
|
||||
BufferedReader br = new BufferedReader(inputStreamReader);
|
||||
return br.lines().collect(Collectors.joining("\n"));
|
||||
} catch (IOException ioe) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
* SpringSecurity
|
||||
* Http安全配置,对每个到达系统的http请求链接进行校验
|
||||
* @param http
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void configure(HttpSecurity http) throws Exception {
|
||||
http.headers().frameOptions().disable();
|
||||
// 所有请求必须认证通过
|
||||
http.authorizeRequests()
|
||||
// 跨域预检请求
|
||||
.antMatchers(HttpMethod.OPTIONS, "/**").permitAll();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
server:
|
||||
port: 31010
|
||||
spring:
|
||||
boot:
|
||||
admin:
|
||||
server:
|
||||
enabled: true
|
||||
application:
|
||||
name: mystyle-cloud-admin-monitor
|
||||
zipkin:
|
||||
sender:
|
||||
type: web
|
||||
base-url: http://localhost:9411/
|
||||
service:
|
||||
name: mystyle-cloud-admin-monitor
|
||||
sleuth:
|
||||
sampler:
|
||||
probability: 1
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 127.0.0.1:8848
|
||||
feign:
|
||||
sentinel:
|
||||
enabled: true
|
||||
|
|
@ -0,0 +1 @@
|
|||
-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAizuj0fBV2+dj4lM3G6efKYvC2czd07BqmzV++E2yBguVks3XWvsW8qlzmG+t1XBCnRFDI/t1Ddc/Jsnlfy4YzRN8otb/Xn6Yz9ACFvZIPGx/q0cqcrgVaR9rSQiSzsGTgUGHNJk8r3A4w9PSSB552Z9s6p5TsWK5ezlfgg+2ANKn1eJ6R/hzajS/B1bTAqYcl9ddo7prneoeAN5LjlMhc2e0cSVgQt8ALP+4x/bTMnDkMjG6R8lnDAxE27B2ZPaLOIOjkUMK+9mZa4RNBoCDG6J/fwPD1NUoVRCbyr/TVaS4EzyhfNK1QW3BlZ0NLSI/SFD3eryKaFQdacJHS31neQIDAQAB-----END PUBLIC KEY-----
|
||||
|
|
@ -1,7 +1,24 @@
|
|||
package com.zhangmeng.api.service.fiction;
|
||||
|
||||
import com.zhangmeng.model.entity.FictionCollection;
|
||||
import com.zhangmeng.model.vo.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@Api(tags = "小说集合")
|
||||
public interface FictionCollectionControllerApi {
|
||||
|
||||
@ApiOperation("爬取小说集合")
|
||||
public Result gen();
|
||||
|
||||
@ApiOperation("集合列表")
|
||||
public Result list(String title, Integer pageNum, Integer pageSize);
|
||||
|
||||
@ApiOperation("genFiction")
|
||||
public Result genFiction(String url);
|
||||
|
||||
@ApiOperation("根据获取小说集合详情")
|
||||
public FictionCollection findFictionCollectionById(@RequestParam("fiction_id") Long fiction_id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,5 +53,11 @@
|
|||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-starter-client</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -55,4 +55,15 @@ mystyle:
|
|||
- /v2/api-docs
|
||||
- /v3/api-docs
|
||||
- /doc.html
|
||||
- /webjars/**
|
||||
- /webjars/**
|
||||
- /actuator/**
|
||||
- /instances/**
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: '*'
|
||||
endpoint:
|
||||
health:
|
||||
show-details: ALWAYS
|
||||
enabled: true
|
||||
|
|
@ -15,6 +15,7 @@ import org.jsoup.select.Elements;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
|
@ -33,7 +34,7 @@ public class FictionCollectionController extends BaseController implements Ficti
|
|||
@Autowired
|
||||
private TianYuXiaoShuoJsoupService tianYuXiaoShuoJsoupService;
|
||||
|
||||
@ApiOperation("爬取小说集合")
|
||||
@Override
|
||||
@GetMapping("/gen")
|
||||
public Result gen() {
|
||||
Elements li = tianYuXiaoShuoJsoupService.fiction_collection();
|
||||
|
|
@ -52,7 +53,7 @@ public class FictionCollectionController extends BaseController implements Ficti
|
|||
return this.success();
|
||||
}
|
||||
|
||||
@ApiOperation("集合列表")
|
||||
@Override
|
||||
@GetMapping("/list")
|
||||
public Result list(String title, Integer pageNum, Integer pageSize) {
|
||||
Condition condition = new Condition(FictionCollection.class);
|
||||
|
|
@ -63,7 +64,7 @@ public class FictionCollectionController extends BaseController implements Ficti
|
|||
return this.fictionCollectionService.findByByConditionWithResult(new QueryParams(pageNum, pageSize, condition, "addTime desc"));
|
||||
}
|
||||
|
||||
@ApiOperation("genFiction")
|
||||
@Override
|
||||
@GetMapping("/genFiction")
|
||||
public Result genFiction(String url) {
|
||||
if (url != null) {
|
||||
|
|
@ -80,4 +81,10 @@ public class FictionCollectionController extends BaseController implements Ficti
|
|||
}
|
||||
return this.success("生成成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
@GetMapping("/findFictionCollectionById")
|
||||
public FictionCollection findFictionCollectionById(@RequestParam("fiction_id") Long fiction_id){
|
||||
return this.fictionCollectionService.findById(fiction_id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,5 +76,11 @@ spring:
|
|||
uri: lb://mystyle-cloud-fiction
|
||||
predicates:
|
||||
- Path=/mystyle-cloud-fiction/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: mystyle-cloud-admin-monitor
|
||||
uri: lb://mystyle-cloud-admin-monitor
|
||||
predicates:
|
||||
- Path=/mystyle-cloud-admin-monitor/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
|
|
@ -1,8 +1,11 @@
|
|||
package com.zhangmeng.model.base.baseController;
|
||||
|
||||
import com.zhangmeng.model.entity.Tags;
|
||||
import com.zhangmeng.model.vo.Result;
|
||||
import com.zhangmeng.model.vo.StatusCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BaseController extends ResponseController {
|
||||
|
||||
protected Result success(){
|
||||
|
|
@ -28,4 +31,8 @@ public class BaseController extends ResponseController {
|
|||
protected Result failure(String message,Object data) {
|
||||
return new Result(false,StatusCode.ERROR,message,data);
|
||||
}
|
||||
|
||||
protected Result responseJsonData(long total, List list) {
|
||||
return new Result(true,StatusCode.OK,"成功",total,list);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -406,4 +406,13 @@ public class CommonUtil {
|
|||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
public static void page_params_verify(Integer pageNum, Integer pageSize) {
|
||||
if (pageNum == null) {
|
||||
pageNum = CommonUtil.pageNum;
|
||||
}
|
||||
if (pageSize == null) {
|
||||
pageSize = CommonUtil.pageSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,5 +17,15 @@ public class SysConstant {
|
|||
|
||||
public static final String mystyle_cloud_fiction= "mystyle-cloud-fiction";
|
||||
|
||||
public static final String mystyle_cloud_admin_monitor= "mystyle-cloud-admin-monitor";
|
||||
|
||||
public static final String mystyle_cloud_fiction_prefix = "/fiction";
|
||||
|
||||
public static final String fictionCollection_prefix = "/fictionCollection";
|
||||
|
||||
public static final String tags_prefix = "/tags";
|
||||
|
||||
public static final String mail_prefix = "/mail";
|
||||
|
||||
public static final String fiction_prefix= "fiction";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,68 @@
|
|||
package com.zhangmeng.model.entity;
|
||||
|
||||
import com.zhangmeng.model.base.baseEntity.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author zhengmeng
|
||||
* @version 1.0
|
||||
* @date 2021年1月7日11:38:42
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Table(name = "tags")
|
||||
public class Tags extends BaseEntity<Long> {
|
||||
|
||||
public enum Type {
|
||||
Article("文章"),
|
||||
Fiction("小说");
|
||||
|
||||
Type(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
private String description;//描述
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public static List<Map<String,Object>> enumListMap(){
|
||||
Tags.Type[] values = Tags.Type.values();
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (Tags.Type value : values) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
String description = value.getDescription();
|
||||
map.put("description",description);
|
||||
map.put("value",value);
|
||||
list.add(map);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
private String tagName;
|
||||
|
||||
private Type type;
|
||||
|
||||
private String description;//描述
|
||||
|
||||
private Long article_id;//文章的id
|
||||
}
|
||||
14
pom.xml
14
pom.xml
|
|
@ -33,6 +33,7 @@
|
|||
<module>mystyle-cloud-quartz</module>
|
||||
<module>mystyle-cloud-mail</module>
|
||||
<module>mystyle-cloud-fiction</module>
|
||||
<module>mystyle-cloud-admin-monitor</module>
|
||||
|
||||
</modules>
|
||||
|
||||
|
|
@ -265,6 +266,19 @@
|
|||
<version>${commons-beanutils.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/de.codecentric/spring-boot-admin-starter-server -->
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-starter-server</artifactId>
|
||||
<version>2.5.4</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/de.codecentric/spring-boot-admin-starter-server -->
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-starter-client</artifactId>
|
||||
<version>2.5.4</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
</project>
|
||||
Loading…
Reference in New Issue