refactor: 删除 cms 模块的控制器类
- 移除了 CmsAdController、CmsAdRecordController、CmsArticleCategoryController、CmsArticleCommentController、CmsArticleContentController、CmsArticleController 和 CmsArticleCountController 类 - 这些控制器类可能已经不再使用或已被其他实现替代
This commit is contained in:
@@ -1,112 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsAdService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsAd;
|
|
||||||
import com.gxwebsoft.cms.param.CmsAdParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 广告位控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Tag(name = "广告位管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-ad")
|
|
||||||
public class CmsAdController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsAdService cmsAdService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询广告位")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsAd>> page(CmsAdParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsAdService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部广告位")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsAd>> list(CmsAdParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsAdService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "根据id查询广告位")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsAd> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
final CmsAd ad = cmsAdService.getByIdRel(id);
|
|
||||||
return success(ad);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "添加广告位")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsAd cmsAd) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
cmsAd.setUserId(loginUser.getUserId());
|
|
||||||
}
|
|
||||||
if (cmsAdService.save(cmsAd)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "修改广告位")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsAd cmsAd) {
|
|
||||||
if (cmsAdService.updateById(cmsAd)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除广告位")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsAdService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量添加广告位")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsAd> list) {
|
|
||||||
if (cmsAdService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量修改广告位")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsAd> batchParam) {
|
|
||||||
if (batchParam.update(cmsAdService, "ad_id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量删除广告位")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsAdService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsAdRecordService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsAdRecord;
|
|
||||||
import com.gxwebsoft.cms.param.CmsAdRecordParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 广告图片控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Tag(name = "广告图片管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-ad-record")
|
|
||||||
public class CmsAdRecordController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsAdRecordService cmsAdRecordService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询广告图片")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsAdRecord>> page(CmsAdRecordParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsAdRecordService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部广告图片")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsAdRecord>> list(CmsAdRecordParam param) {
|
|
||||||
PageParam<CmsAdRecord, CmsAdRecordParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return success(cmsAdRecordService.list(page.getOrderWrapper()));
|
|
||||||
// 使用关联查询
|
|
||||||
//return success(cmsAdRecordService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsAdRecord:list')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "根据id查询广告图片")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsAdRecord> get(@PathVariable("id") Integer id) {
|
|
||||||
return success(cmsAdRecordService.getById(id));
|
|
||||||
// 使用关联查询
|
|
||||||
//return success(cmsAdRecordService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "添加广告图片")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsAdRecord cmsAdRecord) {
|
|
||||||
if (cmsAdRecordService.save(cmsAdRecord)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "修改广告图片")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsAdRecord cmsAdRecord) {
|
|
||||||
if (cmsAdRecordService.updateById(cmsAdRecord)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除广告图片")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsAdRecordService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量添加广告图片")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsAdRecord> list) {
|
|
||||||
if (cmsAdRecordService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量修改广告图片")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsAdRecord> batchParam) {
|
|
||||||
if (batchParam.update(cmsAdRecordService, "ad_record_id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量删除广告图片")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsAdRecordService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsArticleCategoryService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleCategory;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleCategoryParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章分类表控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Tag(name = "文章分类表管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-article-category")
|
|
||||||
public class CmsArticleCategoryController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsArticleCategoryService cmsArticleCategoryService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询文章分类表")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsArticleCategory>> page(CmsArticleCategoryParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsArticleCategoryService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部文章分类表")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsArticleCategory>> list(CmsArticleCategoryParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsArticleCategoryService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "根据id查询文章分类表")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsArticleCategory> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsArticleCategoryService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "添加文章分类表")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsArticleCategory cmsArticleCategory) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
cmsArticleCategory.setUserId(loginUser.getUserId());
|
|
||||||
}
|
|
||||||
if (cmsArticleCategoryService.save(cmsArticleCategory)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "修改文章分类表")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsArticleCategory cmsArticleCategory) {
|
|
||||||
if (cmsArticleCategoryService.updateById(cmsArticleCategory)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除文章分类表")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsArticleCategoryService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量添加文章分类表")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleCategory> list) {
|
|
||||||
if (cmsArticleCategoryService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量修改文章分类表")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleCategory> batchParam) {
|
|
||||||
if (batchParam.update(cmsArticleCategoryService, "category_id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量删除文章分类表")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsArticleCategoryService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsArticleCommentService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleComment;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleCommentParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章评论表控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Tag(name = "文章评论表管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-article-comment")
|
|
||||||
public class CmsArticleCommentController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsArticleCommentService cmsArticleCommentService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询文章评论表")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsArticleComment>> page(CmsArticleCommentParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsArticleCommentService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部文章评论表")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsArticleComment>> list(CmsArticleCommentParam param) {
|
|
||||||
PageParam<CmsArticleComment, CmsArticleCommentParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return success(cmsArticleCommentService.list(page.getOrderWrapper()));
|
|
||||||
// 使用关联查询
|
|
||||||
//return success(cmsArticleCommentService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsArticleComment:list')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "根据id查询文章评论表")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsArticleComment> get(@PathVariable("id") Integer id) {
|
|
||||||
return success(cmsArticleCommentService.getById(id));
|
|
||||||
// 使用关联查询
|
|
||||||
//return success(cmsArticleCommentService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "添加文章评论表")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsArticleComment cmsArticleComment) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
cmsArticleComment.setUserId(loginUser.getUserId());
|
|
||||||
}
|
|
||||||
if (cmsArticleCommentService.save(cmsArticleComment)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "修改文章评论表")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsArticleComment cmsArticleComment) {
|
|
||||||
if (cmsArticleCommentService.updateById(cmsArticleComment)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除文章评论表")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsArticleCommentService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量添加文章评论表")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleComment> list) {
|
|
||||||
if (cmsArticleCommentService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量修改文章评论表")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleComment> batchParam) {
|
|
||||||
if (batchParam.update(cmsArticleCommentService, "comment_id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量删除文章评论表")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsArticleCommentService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsArticleContentService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleContent;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleContentParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章记录表控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Tag(name = "文章记录表管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-article-content")
|
|
||||||
public class CmsArticleContentController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsArticleContentService cmsArticleContentService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询文章记录表")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsArticleContent>> page(CmsArticleContentParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsArticleContentService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部文章记录表")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsArticleContent>> list(CmsArticleContentParam param) {
|
|
||||||
// PageParam<CmsArticleContent, CmsArticleContentParam> page = new PageParam<>(param);
|
|
||||||
// page.setDefaultOrder("create_time desc");
|
|
||||||
// return success(cmsArticleContentService.list(page.getOrderWrapper()));
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsArticleContentService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsArticleContent:list')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "根据id查询文章记录表")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsArticleContent> get(@PathVariable("id") Integer id) {
|
|
||||||
// return success(cmsArticleContentService.getById(id));
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsArticleContentService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "添加文章记录表")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsArticleContent cmsArticleContent) {
|
|
||||||
if (cmsArticleContentService.save(cmsArticleContent)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "修改文章记录表")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsArticleContent cmsArticleContent) {
|
|
||||||
if (cmsArticleContentService.updateById(cmsArticleContent)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除文章记录表")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsArticleContentService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量添加文章记录表")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleContent> list) {
|
|
||||||
if (cmsArticleContentService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量修改文章记录表")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleContent> batchParam) {
|
|
||||||
if (batchParam.update(cmsArticleContentService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量删除文章记录表")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsArticleContentService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,362 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
|
||||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
||||||
import com.gxwebsoft.cms.entity.*;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleImportParam;
|
|
||||||
import com.gxwebsoft.cms.service.*;
|
|
||||||
import com.gxwebsoft.common.core.utils.JSONUtil;
|
|
||||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import com.gxwebsoft.common.system.service.UserService;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import static com.gxwebsoft.common.core.constants.ArticleConstants.CACHE_KEY_ARTICLE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Validated
|
|
||||||
@Tag(name = "文章管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-article")
|
|
||||||
public class CmsArticleController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsArticleService cmsArticleService;
|
|
||||||
@Resource
|
|
||||||
private CmsArticleContentService articleContentService;
|
|
||||||
@Resource
|
|
||||||
@Lazy
|
|
||||||
private CmsNavigationService cmsNavigationService;
|
|
||||||
@Resource
|
|
||||||
private CmsModelService cmsModelService;
|
|
||||||
@Resource
|
|
||||||
private UserService userService;
|
|
||||||
@Resource
|
|
||||||
private RedisUtil redisUtil;
|
|
||||||
|
|
||||||
private static final long CACHE_MINUTES = 30L;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询文章")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsArticle>> page(CmsArticleParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsArticleService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部文章")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsArticle>> list(CmsArticleParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsArticleService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "根据id查询文章")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsArticle> get(@PathVariable("id") @NotNull Integer id) {
|
|
||||||
final CmsArticle article = cmsArticleService.getByIdRel(id);
|
|
||||||
if (ObjectUtil.isNotEmpty(article)) {
|
|
||||||
return success(article);
|
|
||||||
}
|
|
||||||
return fail("文章ID不存在",null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsArticle:save')")
|
|
||||||
@Operation(summary = "添加文章")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody @Valid CmsArticle article) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
article.setUserId(loginUser.getUserId());
|
|
||||||
article.setAuthor(loginUser.getNickname());
|
|
||||||
article.setMerchantId(loginUser.getMerchantId());
|
|
||||||
if (cmsArticleService.saveRel(article)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsArticle:update')")
|
|
||||||
@Operation(summary = "修改文章")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsArticle article) {
|
|
||||||
if (cmsArticleService.updateByIdRel(article)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsArticle:remove')")
|
|
||||||
@Operation(summary = "删除文章")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsArticleService.removeById(id)) {
|
|
||||||
redisUtil.delete(CACHE_KEY_ARTICLE + id);
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsArticle:save')")
|
|
||||||
@Operation(summary = "批量添加文章")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsArticle> list) {
|
|
||||||
if (cmsArticleService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsArticle:update')")
|
|
||||||
@Operation(summary = "批量修改文章")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticle> batchParam) {
|
|
||||||
if (batchParam.update(cmsArticleService, "article_id")) {
|
|
||||||
// 删除缓存
|
|
||||||
final List<Serializable> ids = batchParam.getIds();
|
|
||||||
ids.forEach(id -> {
|
|
||||||
redisUtil.delete(CACHE_KEY_ARTICLE + id);
|
|
||||||
});
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsArticle:remove')")
|
|
||||||
@Operation(summary = "批量删除文章")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsArticleService.removeByIds(ids)) {
|
|
||||||
// 删除缓存
|
|
||||||
ids.forEach(id -> {
|
|
||||||
redisUtil.delete(CACHE_KEY_ARTICLE + id);
|
|
||||||
});
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "读取上一篇")
|
|
||||||
@GetMapping("/getPrevious/{id}")
|
|
||||||
public ApiResult<CmsArticle> getPrevious(@PathVariable("id") Integer id) {
|
|
||||||
final CmsArticle item = cmsArticleService.getById(id);
|
|
||||||
if (ObjectUtil.isEmpty(item)) {
|
|
||||||
return success("没有找到上一篇文章",null);
|
|
||||||
}
|
|
||||||
CmsArticle article;
|
|
||||||
// TODO 按排序号规则
|
|
||||||
LambdaQueryWrapper<CmsArticle> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
wrapper.lt(CmsArticle::getSortNumber, item.getSortNumber());
|
|
||||||
wrapper.eq(CmsArticle::getStatus, 0);
|
|
||||||
wrapper.eq(CmsArticle::getType, 0);
|
|
||||||
wrapper.eq(CmsArticle::getCategoryId, item.getCategoryId());
|
|
||||||
wrapper.orderByDesc(CmsArticle::getSortNumber);
|
|
||||||
wrapper.last("limit 1");
|
|
||||||
article = cmsArticleService.getOne(wrapper);
|
|
||||||
if (ObjectUtil.isNotEmpty(article)) {
|
|
||||||
return success(article);
|
|
||||||
}
|
|
||||||
// TODO 按ID排序
|
|
||||||
LambdaQueryWrapper<CmsArticle> wrapper2 = new LambdaQueryWrapper<>();
|
|
||||||
wrapper2.lt(CmsArticle::getArticleId, item.getArticleId());
|
|
||||||
wrapper2.eq(CmsArticle::getStatus, 0);
|
|
||||||
wrapper2.eq(CmsArticle::getCategoryId, item.getCategoryId());
|
|
||||||
wrapper2.last("limit 1");
|
|
||||||
wrapper2.orderByDesc(CmsArticle::getArticleId);
|
|
||||||
article = cmsArticleService.getOne(wrapper2);
|
|
||||||
return success(article);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "读取下一篇")
|
|
||||||
@GetMapping("/getNext/{id}")
|
|
||||||
public ApiResult<CmsArticle> getNext(@PathVariable("id") Integer id) {
|
|
||||||
CmsArticle item = cmsArticleService.getById(id);
|
|
||||||
if (ObjectUtil.isEmpty(item)) {
|
|
||||||
return success("没有找到下一篇文章",null);
|
|
||||||
}
|
|
||||||
CmsArticle article;
|
|
||||||
// TODO 按排序号规则
|
|
||||||
LambdaQueryWrapper<CmsArticle> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
wrapper.gt(CmsArticle::getSortNumber, item.getSortNumber());
|
|
||||||
wrapper.eq(CmsArticle::getStatus, 0);
|
|
||||||
wrapper.eq(CmsArticle::getType, 0);
|
|
||||||
wrapper.eq(CmsArticle::getCategoryId, item.getCategoryId());
|
|
||||||
wrapper.orderByAsc(CmsArticle::getSortNumber);
|
|
||||||
wrapper.last("limit 1");
|
|
||||||
article = cmsArticleService.getOne(wrapper);
|
|
||||||
if (ObjectUtil.isNotEmpty(article)) {
|
|
||||||
return success(article);
|
|
||||||
}
|
|
||||||
// TODO 按ID排序
|
|
||||||
LambdaQueryWrapper<CmsArticle> wrapper2 = new LambdaQueryWrapper<>();
|
|
||||||
wrapper2.gt(CmsArticle::getArticleId, item.getArticleId());
|
|
||||||
wrapper2.eq(CmsArticle::getStatus, 0);
|
|
||||||
wrapper2.eq(CmsArticle::getCategoryId, item.getCategoryId());
|
|
||||||
wrapper2.last("limit 1");
|
|
||||||
wrapper2.orderByAsc(CmsArticle::getArticleId);
|
|
||||||
article = cmsArticleService.getOne(wrapper2);
|
|
||||||
return success(article);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "统计信息")
|
|
||||||
@GetMapping("/data")
|
|
||||||
public ApiResult<Map<String, Integer>> data(CmsArticleParam param) {
|
|
||||||
Map<String, Integer> data = new HashMap<>();
|
|
||||||
final LambdaQueryWrapper<CmsArticle> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
|
|
||||||
if (param.getMerchantId() != null) {
|
|
||||||
wrapper.eq(CmsArticle::getMerchantId, param.getMerchantId());
|
|
||||||
}
|
|
||||||
|
|
||||||
long totalNum = cmsArticleService.count(
|
|
||||||
wrapper.eq(CmsArticle::getDeleted, 0).eq(CmsArticle::getStatus, 0)
|
|
||||||
);
|
|
||||||
data.put("totalNum", Math.toIntExact(totalNum));
|
|
||||||
|
|
||||||
long totalNum2 = cmsArticleService.count(
|
|
||||||
wrapper.eq(CmsArticle::getStatus, 1)
|
|
||||||
);
|
|
||||||
data.put("totalNum2", Math.toIntExact(totalNum2));
|
|
||||||
|
|
||||||
long totalNum3 = cmsArticleService.count(
|
|
||||||
wrapper.gt(CmsArticle::getStatus, 1)
|
|
||||||
);
|
|
||||||
data.put("totalNum3", Math.toIntExact(totalNum3));
|
|
||||||
|
|
||||||
return success(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "密码校验")
|
|
||||||
@GetMapping("/checkArticlePassword")
|
|
||||||
public ApiResult<?> checkArticlePassword(CmsArticle param) {
|
|
||||||
if (!userService.comparePassword(param.getPassword(), param.getPassword2())) {
|
|
||||||
return fail("密码不正确");
|
|
||||||
}
|
|
||||||
return success("密码正确");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* excel批量导入文章
|
|
||||||
*/
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsArticle:save')")
|
|
||||||
@Operation(summary = "批量导入文章")
|
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
|
||||||
@PostMapping("/import")
|
|
||||||
public ApiResult<List<String>> importBatch(MultipartFile file) {
|
|
||||||
ImportParams importParams = new ImportParams();
|
|
||||||
try {
|
|
||||||
List<CmsArticleImportParam> list = ExcelImportUtil.importExcel(file.getInputStream(), CmsArticleImportParam.class, importParams);
|
|
||||||
list.forEach(d -> {
|
|
||||||
CmsArticle item = JSONUtil.parseObject(JSONUtil.toJSONString(d), CmsArticle.class);
|
|
||||||
assert item != null;
|
|
||||||
if (ObjectUtil.isNotEmpty(item)) {
|
|
||||||
if (item.getStatus() == null) {
|
|
||||||
item.setStatus(1);
|
|
||||||
}
|
|
||||||
if (cmsArticleService.save(item)) {
|
|
||||||
CmsArticleContent content = new CmsArticleContent();
|
|
||||||
content.setArticleId(item.getArticleId());
|
|
||||||
content.setContent(item.getContent());
|
|
||||||
articleContentService.save(content);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return success("成功导入" + list.size() + "条", null);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return fail("导入失败", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "按标签分页查询")
|
|
||||||
@GetMapping("/findTags")
|
|
||||||
public ApiResult<List<CmsArticle>> findTags(CmsArticleParam param) {
|
|
||||||
final String tags = param.getTags();
|
|
||||||
if (StringUtils.isNotBlank(tags)) {
|
|
||||||
final String[] split = tags.split(",");
|
|
||||||
final List<String> list = Arrays.asList(split);
|
|
||||||
LambdaQueryWrapper<CmsArticle> queryWrapper = new LambdaQueryWrapper();
|
|
||||||
if (StrUtil.isNotBlank(tags)) {
|
|
||||||
for (String s : list) {
|
|
||||||
queryWrapper.or().like(CmsArticle::getTags, s);
|
|
||||||
// queryWrapper.or().apply("LOCATE(" + "'" + s + "'," + "tags" + ") > 0");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (param.getCategoryId() != null) {
|
|
||||||
queryWrapper.eq(CmsArticle::getCategoryId, param.getCategoryId());
|
|
||||||
}
|
|
||||||
if (param.getDetail() != null) {
|
|
||||||
queryWrapper.eq(CmsArticle::getDetail, param.getDetail());
|
|
||||||
}
|
|
||||||
queryWrapper.last("limit 8");
|
|
||||||
List<CmsArticle> articles = cmsArticleService.list(queryWrapper);
|
|
||||||
return success(articles);
|
|
||||||
}
|
|
||||||
return success("", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "按标签分页查询")
|
|
||||||
@GetMapping("/pageTags")
|
|
||||||
public ApiResult<List<CmsArticle>> pageTags(CmsArticleParam param) {
|
|
||||||
final String tags = param.getTags();
|
|
||||||
if (StringUtils.isNotBlank(tags)) {
|
|
||||||
final String[] split = tags.split(",");
|
|
||||||
final List<String> list = Arrays.asList(split);
|
|
||||||
LambdaQueryWrapper<CmsArticle> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
for (String s : list) {
|
|
||||||
queryWrapper.or().like(CmsArticle::getTags, s);
|
|
||||||
}
|
|
||||||
queryWrapper.orderByDesc(CmsArticle::getCreateTime);
|
|
||||||
queryWrapper.last("limit 100");
|
|
||||||
List<CmsArticle> articles = cmsArticleService.list(queryWrapper);
|
|
||||||
if (!articles.isEmpty()) {
|
|
||||||
List<CmsNavigation> navigationList = cmsNavigationService.listByIds(articles.stream().map(CmsArticle::getCategoryId).toList());
|
|
||||||
for (CmsArticle article : articles) {
|
|
||||||
for (CmsNavigation navigation : navigationList) {
|
|
||||||
if (article.getCategoryId().equals(navigation.getNavigationId())) {
|
|
||||||
article.setCategoryName(navigation.getTitle());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return success(articles);
|
|
||||||
}
|
|
||||||
return success("", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "按IDS查询")
|
|
||||||
@GetMapping("/getByIds")
|
|
||||||
public ApiResult<List<CmsArticle>> getByIds(CmsArticleParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsArticleService.list(new LambdaQueryWrapper<CmsArticle>().in(CmsArticle::getArticleId, param.getArticleIds())));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsArticleCountService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleCount;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleCountParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点赞文章控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Tag(name = "点赞文章管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-article-count")
|
|
||||||
public class CmsArticleCountController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsArticleCountService cmsArticleCountService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询点赞文章")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsArticleCount>> page(CmsArticleCountParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsArticleCountService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部点赞文章")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsArticleCount>> list(CmsArticleCountParam param) {
|
|
||||||
PageParam<CmsArticleCount, CmsArticleCountParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return success(cmsArticleCountService.list(page.getOrderWrapper()));
|
|
||||||
// 使用关联查询
|
|
||||||
//return success(cmsArticleCountService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsArticleCount:list')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "根据id查询点赞文章")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsArticleCount> get(@PathVariable("id") Integer id) {
|
|
||||||
return success(cmsArticleCountService.getById(id));
|
|
||||||
// 使用关联查询
|
|
||||||
//return success(cmsArticleCountService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "添加点赞文章")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsArticleCount cmsArticleCount) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
cmsArticleCount.setUserId(loginUser.getUserId());
|
|
||||||
}
|
|
||||||
if (cmsArticleCountService.save(cmsArticleCount)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "修改点赞文章")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsArticleCount cmsArticleCount) {
|
|
||||||
if (cmsArticleCountService.updateById(cmsArticleCount)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除点赞文章")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsArticleCountService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量添加点赞文章")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleCount> list) {
|
|
||||||
if (cmsArticleCountService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量修改点赞文章")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleCount> batchParam) {
|
|
||||||
if (batchParam.update(cmsArticleCountService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量删除点赞文章")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsArticleCountService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsArticleLikeService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleLike;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleLikeParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点赞文章控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Tag(name = "点赞文章管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-article-like")
|
|
||||||
public class CmsArticleLikeController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsArticleLikeService cmsArticleLikeService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询点赞文章")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsArticleLike>> page(CmsArticleLikeParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsArticleLikeService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部点赞文章")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsArticleLike>> list(CmsArticleLikeParam param) {
|
|
||||||
PageParam<CmsArticleLike, CmsArticleLikeParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return success(cmsArticleLikeService.list(page.getOrderWrapper()));
|
|
||||||
// 使用关联查询
|
|
||||||
//return success(cmsArticleLikeService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsArticleLike:list')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "根据id查询点赞文章")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsArticleLike> get(@PathVariable("id") Integer id) {
|
|
||||||
return success(cmsArticleLikeService.getById(id));
|
|
||||||
// 使用关联查询
|
|
||||||
//return success(cmsArticleLikeService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "添加点赞文章")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsArticleLike cmsArticleLike) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
cmsArticleLike.setUserId(loginUser.getUserId());
|
|
||||||
}
|
|
||||||
if (cmsArticleLikeService.save(cmsArticleLike)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "修改点赞文章")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsArticleLike cmsArticleLike) {
|
|
||||||
if (cmsArticleLikeService.updateById(cmsArticleLike)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除点赞文章")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsArticleLikeService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量添加点赞文章")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleLike> list) {
|
|
||||||
if (cmsArticleLikeService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量修改点赞文章")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleLike> batchParam) {
|
|
||||||
if (batchParam.update(cmsArticleLikeService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量删除点赞文章")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsArticleLikeService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsNavigation;
|
|
||||||
import com.gxwebsoft.cms.service.CmsNavigationService;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsDesignService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsDesign;
|
|
||||||
import com.gxwebsoft.cms.param.CmsDesignParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面管理记录表控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Tag(name = "页面管理记录表管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-design")
|
|
||||||
public class CmsDesignController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsDesignService cmsDesignService;
|
|
||||||
@Resource
|
|
||||||
private CmsNavigationService cmsNavigationService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询页面管理记录表")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsDesign>> page(CmsDesignParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsDesignService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部页面管理记录表")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsDesign>> list(CmsDesignParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsDesignService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "根据id查询页面管理记录表")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsDesign> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsDesignService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "添加页面管理记录表")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsDesign cmsDesign) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
cmsDesign.setUserId(loginUser.getUserId());
|
|
||||||
}
|
|
||||||
if (cmsDesignService.save(cmsDesign)) {
|
|
||||||
try {
|
|
||||||
cmsNavigationService.update(new LambdaUpdateWrapper<CmsNavigation>().set(CmsNavigation::getBanner, cmsDesign.getPhoto()).eq(CmsNavigation::getNavigationId,cmsDesign.getCategoryId()));
|
|
||||||
// 同步翻译英文版
|
|
||||||
cmsDesignService.translate(cmsDesign);
|
|
||||||
return success("添加成功");
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "修改页面管理记录表")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsDesign cmsDesign) {
|
|
||||||
if (cmsDesignService.updateById(cmsDesign)) {
|
|
||||||
// 同步翻译英文版
|
|
||||||
cmsDesignService.translate(cmsDesign);
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除页面管理记录表")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsDesignService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量添加页面管理记录表")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsDesign> list) {
|
|
||||||
if (cmsDesignService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量修改页面管理记录表")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsDesign> batchParam) {
|
|
||||||
if (batchParam.update(cmsDesignService, "page_id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量删除页面管理记录表")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsDesignService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsDesignRecordService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsDesignRecord;
|
|
||||||
import com.gxwebsoft.cms.param.CmsDesignRecordParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面组件表控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Tag(name = "页面组件表管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-design-record")
|
|
||||||
public class CmsDesignRecordController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsDesignRecordService cmsDesignRecordService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询页面组件表")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsDesignRecord>> page(CmsDesignRecordParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsDesignRecordService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部页面组件表")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsDesignRecord>> list(CmsDesignRecordParam param) {
|
|
||||||
PageParam<CmsDesignRecord, CmsDesignRecordParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return success(cmsDesignRecordService.list(page.getOrderWrapper()));
|
|
||||||
// 使用关联查询
|
|
||||||
//return success(cmsDesignRecordService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsDesignRecord:list')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "根据id查询页面组件表")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsDesignRecord> get(@PathVariable("id") Integer id) {
|
|
||||||
return success(cmsDesignRecordService.getById(id));
|
|
||||||
// 使用关联查询
|
|
||||||
//return success(cmsDesignRecordService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "添加页面组件表")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsDesignRecord cmsDesignRecord) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
cmsDesignRecord.setUserId(loginUser.getUserId());
|
|
||||||
}
|
|
||||||
if (cmsDesignRecordService.save(cmsDesignRecord)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "修改页面组件表")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsDesignRecord cmsDesignRecord) {
|
|
||||||
if (cmsDesignRecordService.updateById(cmsDesignRecord)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除页面组件表")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsDesignRecordService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量添加页面组件表")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsDesignRecord> list) {
|
|
||||||
if (cmsDesignRecordService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量修改页面组件表")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsDesignRecord> batchParam) {
|
|
||||||
if (batchParam.update(cmsDesignRecordService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量删除页面组件表")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsDesignRecordService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,166 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsDomainMapper;
|
|
||||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsDomainService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsDomain;
|
|
||||||
import com.gxwebsoft.cms.param.CmsDomainParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站域名记录表控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:36:14
|
|
||||||
*/
|
|
||||||
@Tag(name = "网站域名记录表管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-domain")
|
|
||||||
public class CmsDomainController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsDomainService cmsDomainService;
|
|
||||||
@Resource
|
|
||||||
private CmsDomainMapper cmsDomainMapper;
|
|
||||||
@Resource
|
|
||||||
private RedisUtil redisUtil;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询网站域名记录表")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsDomain>> page(CmsDomainParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsDomainService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部网站域名记录表")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsDomain>> list(CmsDomainParam param) {
|
|
||||||
PageParam<CmsDomain, CmsDomainParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return success(cmsDomainService.list(page.getOrderWrapper()));
|
|
||||||
// 使用关联查询
|
|
||||||
//return success(cmsDomainService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsDomain:list')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "根据id查询网站域名记录表")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsDomain> get(@PathVariable("id") Integer id) {
|
|
||||||
return success(cmsDomainService.getById(id));
|
|
||||||
// 使用关联查询
|
|
||||||
//return success(cmsDomainService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "添加网站域名记录表")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsDomain cmsDomain) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
cmsDomain.setUserId(loginUser.getUserId());
|
|
||||||
}
|
|
||||||
if (cmsDomainService.save(cmsDomain)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "修改网站域名记录表")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsDomain cmsDomain) {
|
|
||||||
if (cmsDomainService.updateById(cmsDomain)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除网站域名记录表")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsDomainService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量添加网站域名记录表")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsDomain> list) {
|
|
||||||
if (cmsDomainService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量修改网站域名记录表")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsDomain> batchParam) {
|
|
||||||
if (batchParam.update(cmsDomainService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量删除网站域名记录表")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsDomainService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询授权域名信息")
|
|
||||||
@GetMapping("/getTenantIdByDomain")
|
|
||||||
public ApiResult<?> getTenantIdByDomain(CmsDomainParam param) {
|
|
||||||
final CmsDomain domain = cmsDomainService.getOne(new LambdaQueryWrapper<CmsDomain>().eq(CmsDomain::getDomain, param.getDomain()).last("limit 1"));
|
|
||||||
return success(domain);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "授权二级域名")
|
|
||||||
@PostMapping("/domain")
|
|
||||||
public ApiResult<?> domain(@RequestBody CmsDomain cmsDomain) {
|
|
||||||
final User loginUser = getLoginUser();
|
|
||||||
String key = "Domain:" + cmsDomain.getDomain();
|
|
||||||
final Integer tenantId = loginUser.getTenantId();
|
|
||||||
final CmsDomain domain = cmsDomainService.getOne(new LambdaQueryWrapper<CmsDomain>()
|
|
||||||
.eq(CmsDomain::getWebsiteId, cmsDomain.getWebsiteId()).last("limit 1"));
|
|
||||||
if (ObjectUtil.isNotEmpty(domain)) {
|
|
||||||
// 重写缓存
|
|
||||||
redisUtil.set(key,tenantId);
|
|
||||||
domain.setDomain(cmsDomain.getDomain());
|
|
||||||
cmsDomainService.updateById(domain);
|
|
||||||
return success("授权成功");
|
|
||||||
}
|
|
||||||
if(ObjectUtil.isEmpty(domain)){
|
|
||||||
cmsDomain.setUserId(loginUser.getUserId());
|
|
||||||
cmsDomain.setSortNumber(100);
|
|
||||||
cmsDomain.setStatus(1);
|
|
||||||
cmsDomain.setHostName("@");
|
|
||||||
cmsDomain.setWebsiteId(cmsDomain.getWebsiteId());
|
|
||||||
cmsDomain.setTenantId(tenantId);
|
|
||||||
if(cmsDomainService.save(cmsDomain)){
|
|
||||||
// 重写缓存
|
|
||||||
redisUtil.set(key,tenantId);
|
|
||||||
return success("授权成功");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return fail("授权失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsFormService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsForm;
|
|
||||||
import com.gxwebsoft.cms.param.CmsFormParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 表单设计表控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Tag(name = "表单设计表管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-form")
|
|
||||||
public class CmsFormController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsFormService cmsFormService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询表单设计表")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsForm>> page(CmsFormParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsFormService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部表单设计表")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsForm>> list(CmsFormParam param) {
|
|
||||||
PageParam<CmsForm, CmsFormParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return success(cmsFormService.list(page.getOrderWrapper()));
|
|
||||||
// 使用关联查询
|
|
||||||
//return success(cmsFormService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsForm:list')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "根据id查询表单设计表")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsForm> get(@PathVariable("id") Integer id) {
|
|
||||||
return success(cmsFormService.getById(id));
|
|
||||||
// 使用关联查询
|
|
||||||
//return success(cmsFormService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "添加表单设计表")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsForm cmsForm) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
cmsForm.setUserId(loginUser.getUserId());
|
|
||||||
}
|
|
||||||
if (cmsFormService.save(cmsForm)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "修改表单设计表")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsForm cmsForm) {
|
|
||||||
if (cmsFormService.updateById(cmsForm)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除表单设计表")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsFormService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量添加表单设计表")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsForm> list) {
|
|
||||||
if (cmsFormService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量修改表单设计表")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsForm> batchParam) {
|
|
||||||
if (batchParam.update(cmsFormService, "form_id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量删除表单设计表")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsFormService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsFormRecordService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsFormRecord;
|
|
||||||
import com.gxwebsoft.cms.param.CmsFormRecordParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 表单数据记录表控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Tag(name = "表单数据记录表管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-form-record")
|
|
||||||
public class CmsFormRecordController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsFormRecordService cmsFormRecordService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询表单数据记录表")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsFormRecord>> page(CmsFormRecordParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsFormRecordService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部表单数据记录表")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsFormRecord>> list(CmsFormRecordParam param) {
|
|
||||||
PageParam<CmsFormRecord, CmsFormRecordParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return success(cmsFormRecordService.list(page.getOrderWrapper()));
|
|
||||||
// 使用关联查询
|
|
||||||
//return success(cmsFormRecordService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsFormRecord:list')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "根据id查询表单数据记录表")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsFormRecord> get(@PathVariable("id") Integer id) {
|
|
||||||
return success(cmsFormRecordService.getById(id));
|
|
||||||
// 使用关联查询
|
|
||||||
//return success(cmsFormRecordService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "添加表单数据记录表")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsFormRecord cmsFormRecord) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
cmsFormRecord.setUserId(loginUser.getUserId());
|
|
||||||
}
|
|
||||||
if (cmsFormRecordService.save(cmsFormRecord)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "修改表单数据记录表")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsFormRecord cmsFormRecord) {
|
|
||||||
if (cmsFormRecordService.updateById(cmsFormRecord)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除表单数据记录表")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsFormRecordService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量添加表单数据记录表")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsFormRecord> list) {
|
|
||||||
if (cmsFormRecordService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量修改表单数据记录表")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsFormRecord> batchParam) {
|
|
||||||
if (batchParam.update(cmsFormRecordService, "form_record_id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量删除表单数据记录表")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsFormRecordService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsLangService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsLang;
|
|
||||||
import com.gxwebsoft.cms.param.CmsLangParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 国际化控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-01-06 19:29:26
|
|
||||||
*/
|
|
||||||
@Tag(name = "国际化管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-lang")
|
|
||||||
public class CmsLangController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsLangService cmsLangService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询国际化")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsLang>> page(CmsLangParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsLangService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部国际化")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsLang>> list(CmsLangParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsLangService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsLang:list')")
|
|
||||||
@Operation(summary = "根据id查询国际化")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsLang> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsLangService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsLang:save')")
|
|
||||||
@Operation(summary = "添加国际化")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsLang cmsLang) {
|
|
||||||
if (cmsLangService.save(cmsLang)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsLang:update')")
|
|
||||||
@Operation(summary = "修改国际化")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsLang cmsLang) {
|
|
||||||
if (cmsLangService.updateById(cmsLang)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsLang:remove')")
|
|
||||||
@Operation(summary = "删除国际化")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsLangService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsLang:save')")
|
|
||||||
@Operation(summary = "批量添加国际化")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsLang> list) {
|
|
||||||
if (cmsLangService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsLang:update')")
|
|
||||||
@Operation(summary = "批量修改国际化")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsLang> batchParam) {
|
|
||||||
if (batchParam.update(cmsLangService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsLang:reomve')")
|
|
||||||
@Operation(summary = "批量删除国际化")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsLangService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsLangLogService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsLangLog;
|
|
||||||
import com.gxwebsoft.cms.param.CmsLangLogParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 国际化记录启用控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-01-06 19:29:26
|
|
||||||
*/
|
|
||||||
@Tag(name = "国际化记录启用管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-lang-log")
|
|
||||||
public class CmsLangLogController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsLangLogService cmsLangLogService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询国际化记录启用")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsLangLog>> page(CmsLangLogParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsLangLogService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部国际化记录启用")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsLangLog>> list(CmsLangLogParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsLangLogService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsLangLog:list')")
|
|
||||||
@Operation(summary = "根据id查询国际化记录启用")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsLangLog> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsLangLogService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsLangLog:save')")
|
|
||||||
@Operation(summary = "添加国际化记录启用")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsLangLog cmsLangLog) {
|
|
||||||
if (cmsLangLogService.save(cmsLangLog)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsLangLog:update')")
|
|
||||||
@Operation(summary = "修改国际化记录启用")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsLangLog cmsLangLog) {
|
|
||||||
if (cmsLangLogService.updateById(cmsLangLog)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsLangLog:remove')")
|
|
||||||
@Operation(summary = "删除国际化记录启用")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsLangLogService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsLangLog:save')")
|
|
||||||
@Operation(summary = "批量添加国际化记录启用")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsLangLog> list) {
|
|
||||||
if (cmsLangLogService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsLangLog:update')")
|
|
||||||
@Operation(summary = "批量修改国际化记录启用")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsLangLog> batchParam) {
|
|
||||||
if (batchParam.update(cmsLangLogService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsLangLog:remove')")
|
|
||||||
@Operation(summary = "批量删除国际化记录启用")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsLangLogService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsLinkService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsLink;
|
|
||||||
import com.gxwebsoft.cms.param.CmsLinkParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 常用链接控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Tag(name = "常用链接管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-link")
|
|
||||||
public class CmsLinkController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsLinkService cmsLinkService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询常用链接")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsLink>> page(CmsLinkParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsLinkService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部常用链接")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsLink>> list(CmsLinkParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsLinkService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsLink:list')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "根据id查询常用链接")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsLink> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsLinkService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "添加常用链接")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsLink cmsLink) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
cmsLink.setUserId(loginUser.getUserId());
|
|
||||||
}
|
|
||||||
if (cmsLinkService.save(cmsLink)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "修改常用链接")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsLink cmsLink) {
|
|
||||||
if (cmsLinkService.updateById(cmsLink)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除常用链接")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsLinkService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量添加常用链接")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsLink> list) {
|
|
||||||
if (cmsLinkService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量修改常用链接")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsLink> batchParam) {
|
|
||||||
if (batchParam.update(cmsLinkService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量删除常用链接")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsLinkService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.gxwebsoft.cms.service.CmsWebsiteService;
|
|
||||||
import com.gxwebsoft.cms.vo.CmsVO;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站应用主入口
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:36:14
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Tag(name = "网站应用")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms")
|
|
||||||
public class CmsMainController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsWebsiteService cmsWebsiteService;
|
|
||||||
|
|
||||||
@Operation(summary = "网站基本信息", description = "获取网站的基本信息,包括配置、导航、设置和过期状态等")
|
|
||||||
@GetMapping("/getSiteInfo")
|
|
||||||
public ApiResult<CmsVO> getSiteInfo() {
|
|
||||||
try {
|
|
||||||
Integer tenantId = getTenantId();
|
|
||||||
if (ObjectUtil.isEmpty(tenantId)) {
|
|
||||||
return fail("租户ID不能为空", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
CmsVO websiteVO = cmsWebsiteService.getSiteInfo(tenantId);
|
|
||||||
return success(websiteVO);
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
return fail(e.getMessage(), null);
|
|
||||||
} catch (RuntimeException e) {
|
|
||||||
return fail(e.getMessage(), null);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("获取网站信息失败", e);
|
|
||||||
return fail("获取网站信息失败", null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,118 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsModelService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsModel;
|
|
||||||
import com.gxwebsoft.cms.param.CmsModelParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 模型控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-11-26 15:44:53
|
|
||||||
*/
|
|
||||||
@Tag(name = "模型管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-model")
|
|
||||||
public class CmsModelController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsModelService cmsModelService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询模型")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsModel>> page(CmsModelParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsModelService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部模型")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsModel>> list(CmsModelParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsModelService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "根据id查询模型")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsModel> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsModelService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsModel:save')")
|
|
||||||
@Operation(summary = "添加模型")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsModel cmsModel) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
cmsModel.setUserId(loginUser.getUserId());
|
|
||||||
}
|
|
||||||
if (cmsModelService.save(cmsModel)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsModel:update')")
|
|
||||||
@Operation(summary = "修改模型")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsModel cmsModel) {
|
|
||||||
if (cmsModelService.updateById(cmsModel)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsModel:remove')")
|
|
||||||
@Operation(summary = "删除模型")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsModelService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsModel:save')")
|
|
||||||
@Operation(summary = "批量添加模型")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsModel> list) {
|
|
||||||
if (cmsModelService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsModel:update')")
|
|
||||||
@Operation(summary = "批量修改模型")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsModel> batchParam) {
|
|
||||||
if (batchParam.update(cmsModelService, "model_id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsModel:remvoe')")
|
|
||||||
@Operation(summary = "批量删除模型")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsModelService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,190 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsDesign;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsModel;
|
|
||||||
import com.gxwebsoft.cms.service.CmsDesignService;
|
|
||||||
import com.gxwebsoft.cms.service.CmsModelService;
|
|
||||||
import com.gxwebsoft.common.core.utils.CommonUtil;
|
|
||||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsNavigationService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsNavigation;
|
|
||||||
import com.gxwebsoft.cms.param.CmsNavigationParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import com.gxwebsoft.common.system.service.UserService;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站导航记录表控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Tag(name = "网站导航记录表管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-navigation")
|
|
||||||
public class CmsNavigationController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsNavigationService cmsNavigationService;
|
|
||||||
@Resource
|
|
||||||
private CmsModelService cmsModelService;
|
|
||||||
@Resource
|
|
||||||
private CmsDesignService cmsDesignService;
|
|
||||||
@Resource
|
|
||||||
private UserService userService;
|
|
||||||
@Resource
|
|
||||||
private RedisUtil redisUtil;
|
|
||||||
|
|
||||||
|
|
||||||
private static final String SITE_INFO_KEY_PREFIX = "SiteInfo:";
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询网站导航记录表")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsNavigation>> page(CmsNavigationParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsNavigationService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部网站导航记录表")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsNavigation>> list(CmsNavigationParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsNavigationService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "根据id查询网站导航记录表")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsNavigation> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsNavigationService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "添加网站导航记录表")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsNavigation cmsNavigation) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
cmsNavigation.setUserId(loginUser.getUserId());
|
|
||||||
cmsNavigation.setTenantId(loginUser.getTenantId());
|
|
||||||
}
|
|
||||||
// 去除前面空格
|
|
||||||
cmsNavigation.setTitle(StrUtil.trimStart(cmsNavigation.getTitle()));
|
|
||||||
if (cmsNavigationService.save(cmsNavigation)) {
|
|
||||||
// 添加成功事务处理
|
|
||||||
cmsNavigationService.saveAsync(cmsNavigation);
|
|
||||||
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "修改网站导航记录表")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsNavigation cmsNavigation) {
|
|
||||||
if (cmsNavigationService.updateById(cmsNavigation)) {
|
|
||||||
// 修改成功事务处理
|
|
||||||
cmsNavigationService.saveAsync(cmsNavigation);
|
|
||||||
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除网站导航记录表")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsNavigationService.removeById(id)) {
|
|
||||||
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量添加网站导航记录表")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsNavigation> list) {
|
|
||||||
if (cmsNavigationService.saveBatch(list)) {
|
|
||||||
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量修改网站导航记录表")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsNavigation> batchParam) {
|
|
||||||
if (batchParam.update(cmsNavigationService, "navigation_id")) {
|
|
||||||
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量删除网站导航记录表")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsNavigationService.removeByIds(ids)) {
|
|
||||||
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "获取树形结构的网站导航数据")
|
|
||||||
@GetMapping("/tree")
|
|
||||||
public ApiResult<List<CmsNavigation>> tree(CmsNavigationParam param) {
|
|
||||||
param.setHide(0);
|
|
||||||
final List<CmsNavigation> navigations = cmsNavigationService.listRel(param);
|
|
||||||
return success(CommonUtil.toTreeData(navigations, 0, CmsNavigation::getParentId, CmsNavigation::getNavigationId, CmsNavigation::setChildren));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "根据path获取导航")
|
|
||||||
@GetMapping("/getNavigationByPath")
|
|
||||||
public ApiResult<CmsNavigation> getNavigationByPath(CmsNavigationParam param) {
|
|
||||||
final CmsNavigation navigation = cmsNavigationService.getOne(new LambdaUpdateWrapper<CmsNavigation>().eq(CmsNavigation::getModel, param.getModel()).last("limit 1"));
|
|
||||||
if (ObjectUtil.isNotEmpty(navigation)) {
|
|
||||||
// 页面元素
|
|
||||||
final CmsDesign design = cmsDesignService.getOne(new LambdaUpdateWrapper<CmsDesign>().eq(CmsDesign::getCategoryId, navigation.getNavigationId()).last("limit 1"));
|
|
||||||
// 模型信息
|
|
||||||
final CmsModel model = cmsModelService.getOne(new LambdaQueryWrapper<CmsModel>().eq(CmsModel::getModel, navigation.getModel()).last("limit 1"));
|
|
||||||
navigation.setBanner(model.getBanner());
|
|
||||||
// 上级导航
|
|
||||||
if (!navigation.getParentId().equals(0)) {
|
|
||||||
final CmsNavigation parent = cmsNavigationService.getById(navigation.getParentId());
|
|
||||||
navigation.setParentPath(parent.getPath());
|
|
||||||
navigation.setParentName(parent.getTitle());
|
|
||||||
}
|
|
||||||
// 页面信息
|
|
||||||
navigation.setDesign(design);
|
|
||||||
// 页面布局
|
|
||||||
if (ObjectUtil.isNotEmpty(design)) {
|
|
||||||
navigation.setLayout(design.getLayout());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return success(navigation);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "密码校验")
|
|
||||||
@GetMapping("/checkNavigationPassword")
|
|
||||||
public ApiResult<?> checkNavigationPassword(CmsNavigationParam param) {
|
|
||||||
if (!userService.comparePassword(param.getPassword(), param.getPassword2())) {
|
|
||||||
return fail("密码不正确");
|
|
||||||
}
|
|
||||||
return success("密码正确");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsStatisticsService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsStatistics;
|
|
||||||
import com.gxwebsoft.cms.param.CmsStatisticsParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 站点统计信息表控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-07-25 12:32:06
|
|
||||||
*/
|
|
||||||
@Tag(name = "站点统计信息表管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-statistics")
|
|
||||||
public class CmsStatisticsController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsStatisticsService cmsStatisticsService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询站点统计信息表")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsStatistics>> page(CmsStatisticsParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsStatisticsService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsStatistics:list')")
|
|
||||||
@Operation(summary = "查询全部站点统计信息表")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsStatistics>> list(CmsStatisticsParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsStatisticsService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "根据id查询站点统计信息表")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsStatistics> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsStatisticsService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsStatistics:save')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "添加站点统计信息表")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsStatistics cmsStatistics) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
cmsStatistics.setUserId(loginUser.getUserId());
|
|
||||||
}
|
|
||||||
if (cmsStatisticsService.save(cmsStatistics)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsStatistics:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "修改站点统计信息表")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsStatistics cmsStatistics) {
|
|
||||||
if (cmsStatisticsService.updateById(cmsStatistics)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsStatistics:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "删除站点统计信息表")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsStatisticsService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsStatistics:save')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量添加站点统计信息表")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsStatistics> list) {
|
|
||||||
if (cmsStatisticsService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsStatistics:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量修改站点统计信息表")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsStatistics> batchParam) {
|
|
||||||
if (batchParam.update(cmsStatisticsService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsStatistics:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量删除站点统计信息表")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsStatisticsService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,118 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsTemplateService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsTemplate;
|
|
||||||
import com.gxwebsoft.cms.param.CmsTemplateParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站模版控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-01-21 14:21:16
|
|
||||||
*/
|
|
||||||
@Tag(name = "网站模版管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-template")
|
|
||||||
public class CmsTemplateController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsTemplateService cmsTemplateService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询网站模版")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsTemplate>> page(CmsTemplateParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsTemplateService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部网站模版")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsTemplate>> list(CmsTemplateParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsTemplateService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "根据id查询网站模版")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsTemplate> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsTemplateService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsTemplate:save')")
|
|
||||||
@Operation(summary = "添加网站模版")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsTemplate cmsTemplate) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
cmsTemplate.setUserId(loginUser.getUserId());
|
|
||||||
}
|
|
||||||
if (cmsTemplateService.save(cmsTemplate)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsTemplate:update')")
|
|
||||||
@Operation(summary = "修改网站模版")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsTemplate cmsTemplate) {
|
|
||||||
if (cmsTemplateService.updateById(cmsTemplate)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsTemplate:remove')")
|
|
||||||
@Operation(summary = "删除网站模版")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsTemplateService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsTemplate:save')")
|
|
||||||
@Operation(summary = "批量添加网站模版")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsTemplate> list) {
|
|
||||||
if (cmsTemplateService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsTemplate:update')")
|
|
||||||
@Operation(summary = "批量修改网站模版")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsTemplate> batchParam) {
|
|
||||||
if (batchParam.update(cmsTemplateService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsTemplate:remove')")
|
|
||||||
@Operation(summary = "批量删除网站模版")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsTemplateService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,199 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsWebsite;
|
|
||||||
import com.gxwebsoft.cms.param.CmsWebsiteParam;
|
|
||||||
import com.gxwebsoft.cms.service.CmsWebsiteService;
|
|
||||||
import com.gxwebsoft.cms.vo.CmsVO;
|
|
||||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站信息记录表控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:36:14
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Tag(name = "网站信息记录表管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-website")
|
|
||||||
public class CmsWebsiteController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsWebsiteService cmsWebsiteService;
|
|
||||||
@Resource
|
|
||||||
private RedisUtil redisUtil;
|
|
||||||
|
|
||||||
private static final String SITE_INFO_KEY_PREFIX = "SiteInfo:";
|
|
||||||
private static final String MP_INFO_KEY_PREFIX = "MpInfo:";
|
|
||||||
private static final String SELECT_PAYMENT_KEY_PREFIX = "SelectPayment:";
|
|
||||||
private static final String SYS_DOMAIN_SUFFIX = ".websoft.top";
|
|
||||||
private static final String DOMAIN_SUFFIX = ".wsdns.cn";
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询网站信息记录表")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsWebsite>> page(CmsWebsiteParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsWebsiteService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部网站信息记录表")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsWebsite>> list(CmsWebsiteParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsWebsiteService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询网站信息记录表")
|
|
||||||
@GetMapping("/pageAll")
|
|
||||||
public ApiResult<PageResult<CmsWebsite>> pageAll(CmsWebsiteParam param) {
|
|
||||||
return success(cmsWebsiteService.pageRelAll(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "根据id查询网站信息记录表")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsWebsite> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsWebsiteService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "根据id查询网站信息记录表")
|
|
||||||
@GetMapping("/getAll/{id}")
|
|
||||||
public ApiResult<CmsWebsite> getAll(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsWebsiteService.getByIdRelAll(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:website:save')")
|
|
||||||
@Operation(summary = "添加网站信息记录表")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsWebsite cmsWebsite) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
cmsWebsite.setLoginUser(loginUser);
|
|
||||||
return success("创建成功", cmsWebsiteService.create(cmsWebsite));
|
|
||||||
}
|
|
||||||
return fail("创建失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:website:update')")
|
|
||||||
@Operation(summary = "修改网站信息记录表")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsWebsite cmsWebsite) {
|
|
||||||
if (cmsWebsiteService.updateById(cmsWebsite)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:website:update')")
|
|
||||||
@Operation(summary = "修改网站信息记录表")
|
|
||||||
@PutMapping("/updateAll")
|
|
||||||
public ApiResult<?> updateAll(@RequestBody CmsWebsite cmsWebsite) {
|
|
||||||
if (cmsWebsiteService.updateByIdAll(cmsWebsite)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:website:remove')")
|
|
||||||
@Operation(summary = "删除网站信息记录表")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsWebsiteService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:website:remove')")
|
|
||||||
@Operation(summary = "删除网站信息记录表")
|
|
||||||
@DeleteMapping("/removeAll/{id}")
|
|
||||||
public ApiResult<?> removeAll(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsWebsiteService.removeByIdAll(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:website:save')")
|
|
||||||
@Operation(summary = "批量添加网站信息记录表")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsWebsite> list) {
|
|
||||||
if (cmsWebsiteService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:website:update')")
|
|
||||||
@Operation(summary = "批量修改网站信息记录表")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsWebsite> batchParam) {
|
|
||||||
if (batchParam.update(cmsWebsiteService, "website_id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:website:remove')")
|
|
||||||
@Operation(summary = "批量删除网站信息记录表")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsWebsiteService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "网站基本信息", description = "获取网站的基本信息,包括配置、导航、设置和过期状态等")
|
|
||||||
@GetMapping("/getSiteInfo")
|
|
||||||
public ApiResult<CmsVO> getSiteInfo() {
|
|
||||||
try {
|
|
||||||
Integer tenantId = getTenantId();
|
|
||||||
if (ObjectUtil.isEmpty(tenantId)) {
|
|
||||||
return fail("租户ID不能为空", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
CmsVO websiteVO = cmsWebsiteService.getSiteInfo(tenantId);
|
|
||||||
|
|
||||||
return success(websiteVO);
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
return fail(e.getMessage(), null);
|
|
||||||
} catch (RuntimeException e) {
|
|
||||||
return fail(e.getMessage(), null);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("获取网站信息失败", e);
|
|
||||||
return fail("获取网站信息失败", null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "清除缓存")
|
|
||||||
@DeleteMapping("/clearSiteInfo/{key}")
|
|
||||||
public ApiResult<?> clearSiteInfo(@PathVariable("key") String key) {
|
|
||||||
// 清除指定key
|
|
||||||
redisUtil.delete(key);
|
|
||||||
// 清除缓存
|
|
||||||
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
|
||||||
// 清除小程序缓存
|
|
||||||
redisUtil.delete(MP_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
|
||||||
// 选择支付方式
|
|
||||||
redisUtil.delete(SELECT_PAYMENT_KEY_PREFIX.concat(getTenantId().toString()));
|
|
||||||
return success("清除成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,118 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsWebsiteFieldService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsWebsiteField;
|
|
||||||
import com.gxwebsoft.cms.param.CmsWebsiteFieldParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 应用参数控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:36:14
|
|
||||||
*/
|
|
||||||
@Tag(name = "应用参数管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-website-field")
|
|
||||||
public class CmsWebsiteFieldController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsWebsiteFieldService cmsWebsiteFieldService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询应用参数")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsWebsiteField>> page(CmsWebsiteFieldParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsWebsiteFieldService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部应用参数")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsWebsiteField>> list(CmsWebsiteFieldParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsWebsiteFieldService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "根据id查询应用参数")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsWebsiteField> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsWebsiteFieldService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "添加应用参数")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsWebsiteField cmsWebsiteField) {
|
|
||||||
if (cmsWebsiteFieldService.save(cmsWebsiteField)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "修改应用参数")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsWebsiteField cmsWebsiteField) {
|
|
||||||
if (cmsWebsiteFieldService.updateById(cmsWebsiteField)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "删除应用参数")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsWebsiteFieldService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量添加应用参数")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsWebsiteField> list) {
|
|
||||||
if (cmsWebsiteFieldService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量修改应用参数")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsWebsiteField> batchParam) {
|
|
||||||
if (batchParam.update(cmsWebsiteFieldService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "批量删除应用参数")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsWebsiteFieldService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "获取网站配置参数-对象形式")
|
|
||||||
@GetMapping("/config")
|
|
||||||
public ApiResult<?> getConfig(CmsWebsiteFieldParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
final List<CmsWebsiteField> fields = cmsWebsiteFieldService.listRel(param);
|
|
||||||
|
|
||||||
HashMap<String, Object> config = new HashMap<>();
|
|
||||||
fields.forEach(d -> {
|
|
||||||
config.put(d.getName(), d.getValue());
|
|
||||||
});
|
|
||||||
return success(config);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
package cms.controller;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.cms.service.CmsWebsiteSettingService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsWebsiteSetting;
|
|
||||||
import com.gxwebsoft.cms.param.CmsWebsiteSettingParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站设置控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-02-19 01:35:44
|
|
||||||
*/
|
|
||||||
@Tag(name = "网站设置管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/cms/cms-website-setting")
|
|
||||||
public class CmsWebsiteSettingController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private CmsWebsiteSettingService cmsWebsiteSettingService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询网站设置")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<CmsWebsiteSetting>> page(CmsWebsiteSettingParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsWebsiteSettingService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部网站设置")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<CmsWebsiteSetting>> list(CmsWebsiteSettingParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(cmsWebsiteSettingService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "根据id查询网站设置")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<CmsWebsiteSetting> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
final CmsWebsiteSetting cmsWebsiteSetting = cmsWebsiteSettingService.getOne(new LambdaQueryWrapper<CmsWebsiteSetting>().eq(CmsWebsiteSetting::getWebsiteId, id));
|
|
||||||
if(ObjectUtil.isEmpty(cmsWebsiteSetting)){
|
|
||||||
final CmsWebsiteSetting setting = new CmsWebsiteSetting();
|
|
||||||
setting.setWebsiteId(id);
|
|
||||||
cmsWebsiteSettingService.save(setting);
|
|
||||||
return success(cmsWebsiteSettingService.getOne(new LambdaQueryWrapper<CmsWebsiteSetting>().eq(CmsWebsiteSetting::getWebsiteId, id)));
|
|
||||||
}
|
|
||||||
return success(cmsWebsiteSetting);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:save')")
|
|
||||||
@Operation(summary = "添加网站设置")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody CmsWebsiteSetting cmsWebsiteSetting) {
|
|
||||||
if (cmsWebsiteSettingService.save(cmsWebsiteSetting)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:website:update')")
|
|
||||||
@Operation(summary = "修改网站设置")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody CmsWebsiteSetting cmsWebsiteSetting) {
|
|
||||||
if (cmsWebsiteSettingService.updateById(cmsWebsiteSetting)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:remove')")
|
|
||||||
@Operation(summary = "删除网站设置")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (cmsWebsiteSettingService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:save')")
|
|
||||||
@Operation(summary = "批量添加网站设置")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<CmsWebsiteSetting> list) {
|
|
||||||
if (cmsWebsiteSettingService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:update')")
|
|
||||||
@Operation(summary = "批量修改网站设置")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsWebsiteSetting> batchParam) {
|
|
||||||
if (batchParam.update(cmsWebsiteSettingService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:remove')")
|
|
||||||
@Operation(summary = "批量删除网站设置")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (cmsWebsiteSettingService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsAd;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsLangLog;
|
|
||||||
import com.gxwebsoft.cms.param.CmsAdParam;
|
|
||||||
import com.gxwebsoft.cms.param.CmsLangLogParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 广告位Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsAdMapper extends BaseMapper<CmsAd> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsAd>
|
|
||||||
*/
|
|
||||||
List<CmsAd> selectPageRel(@Param("page") IPage<CmsAd> page,
|
|
||||||
@Param("param") CmsAdParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsAd> selectListRel(@Param("param") CmsAdParam param);
|
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
|
||||||
List<CmsAd> selectListAllRel(@Param("param") CmsAdParam param);
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsAdRecord;
|
|
||||||
import com.gxwebsoft.cms.param.CmsAdRecordParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 广告图片Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsAdRecordMapper extends BaseMapper<CmsAdRecord> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsAdRecord>
|
|
||||||
*/
|
|
||||||
List<CmsAdRecord> selectPageRel(@Param("page") IPage<CmsAdRecord> page,
|
|
||||||
@Param("param") CmsAdRecordParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsAdRecord> selectListRel(@Param("param") CmsAdRecordParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleCategory;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleCategoryParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章分类表Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsArticleCategoryMapper extends BaseMapper<CmsArticleCategory> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsArticleCategory>
|
|
||||||
*/
|
|
||||||
List<CmsArticleCategory> selectPageRel(@Param("page") IPage<CmsArticleCategory> page,
|
|
||||||
@Param("param") CmsArticleCategoryParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsArticleCategory> selectListRel(@Param("param") CmsArticleCategoryParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleComment;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleCommentParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章评论表Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsArticleCommentMapper extends BaseMapper<CmsArticleComment> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsArticleComment>
|
|
||||||
*/
|
|
||||||
List<CmsArticleComment> selectPageRel(@Param("page") IPage<CmsArticleComment> page,
|
|
||||||
@Param("param") CmsArticleCommentParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsArticleComment> selectListRel(@Param("param") CmsArticleCommentParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleContent;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleContentParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章记录表Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsArticleContentMapper extends BaseMapper<CmsArticleContent> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsArticleContent>
|
|
||||||
*/
|
|
||||||
List<CmsArticleContent> selectPageRel(@Param("page") IPage<CmsArticleContent> page,
|
|
||||||
@Param("param") CmsArticleContentParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsArticleContent> selectListRel(@Param("param") CmsArticleContentParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleCount;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleCountParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点赞文章Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsArticleCountMapper extends BaseMapper<CmsArticleCount> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsArticleCount>
|
|
||||||
*/
|
|
||||||
List<CmsArticleCount> selectPageRel(@Param("page") IPage<CmsArticleCount> page,
|
|
||||||
@Param("param") CmsArticleCountParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsArticleCount> selectListRel(@Param("param") CmsArticleCountParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleLike;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleLikeParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点赞文章Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsArticleLikeMapper extends BaseMapper<CmsArticleLike> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsArticleLike>
|
|
||||||
*/
|
|
||||||
List<CmsArticleLike> selectPageRel(@Param("page") IPage<CmsArticleLike> page,
|
|
||||||
@Param("param") CmsArticleLikeParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsArticleLike> selectListRel(@Param("param") CmsArticleLikeParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticle;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsLangLog;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleParam;
|
|
||||||
import com.gxwebsoft.cms.param.CmsLangLogParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsArticleMapper extends BaseMapper<CmsArticle> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsArticle>
|
|
||||||
*/
|
|
||||||
List<CmsArticle> selectPageRel(@Param("page") IPage<CmsArticle> page,
|
|
||||||
@Param("param") CmsArticleParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsArticle> selectListRel(@Param("param") CmsArticleParam param);
|
|
||||||
|
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
|
||||||
List<CmsArticle> selectListAllRel(@Param("param") CmsArticleParam param);
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsDesign;
|
|
||||||
import com.gxwebsoft.cms.param.CmsDesignParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面管理记录表Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsDesignMapper extends BaseMapper<CmsDesign> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsDesign>
|
|
||||||
*/
|
|
||||||
List<CmsDesign> selectPageRel(@Param("page") IPage<CmsDesign> page,
|
|
||||||
@Param("param") CmsDesignParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsDesign> selectListRel(@Param("param") CmsDesignParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsDesignRecord;
|
|
||||||
import com.gxwebsoft.cms.param.CmsDesignRecordParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面组件表Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsDesignRecordMapper extends BaseMapper<CmsDesignRecord> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsDesignRecord>
|
|
||||||
*/
|
|
||||||
List<CmsDesignRecord> selectPageRel(@Param("page") IPage<CmsDesignRecord> page,
|
|
||||||
@Param("param") CmsDesignRecordParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsDesignRecord> selectListRel(@Param("param") CmsDesignRecordParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsDomain;
|
|
||||||
import com.gxwebsoft.cms.param.CmsDomainParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站域名记录表Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:36:14
|
|
||||||
*/
|
|
||||||
public interface CmsDomainMapper extends BaseMapper<CmsDomain> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsDomain>
|
|
||||||
*/
|
|
||||||
List<CmsDomain> selectPageRel(@Param("page") IPage<CmsDomain> page,
|
|
||||||
@Param("param") CmsDomainParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsDomain> selectListRel(@Param("param") CmsDomainParam param);
|
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
|
||||||
CmsDomain getDomain(@Param("domain") String domain);
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsForm;
|
|
||||||
import com.gxwebsoft.cms.param.CmsFormParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 表单设计表Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsFormMapper extends BaseMapper<CmsForm> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsForm>
|
|
||||||
*/
|
|
||||||
List<CmsForm> selectPageRel(@Param("page") IPage<CmsForm> page,
|
|
||||||
@Param("param") CmsFormParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsForm> selectListRel(@Param("param") CmsFormParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsFormRecord;
|
|
||||||
import com.gxwebsoft.cms.param.CmsFormRecordParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 表单数据记录表Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsFormRecordMapper extends BaseMapper<CmsFormRecord> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsFormRecord>
|
|
||||||
*/
|
|
||||||
List<CmsFormRecord> selectPageRel(@Param("page") IPage<CmsFormRecord> page,
|
|
||||||
@Param("param") CmsFormRecordParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsFormRecord> selectListRel(@Param("param") CmsFormRecordParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsLangLog;
|
|
||||||
import com.gxwebsoft.cms.param.CmsLangLogParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 国际化记录启用Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-01-06 19:29:26
|
|
||||||
*/
|
|
||||||
public interface CmsLangLogMapper extends BaseMapper<CmsLangLog> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsLangLog>
|
|
||||||
*/
|
|
||||||
List<CmsLangLog> selectPageRel(@Param("page") IPage<CmsLangLog> page,
|
|
||||||
@Param("param") CmsLangLogParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsLangLog> selectListRel(@Param("param") CmsLangLogParam param);
|
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
|
||||||
List<CmsLangLog> selectListAllRel(@Param("param") CmsLangLogParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsLang;
|
|
||||||
import com.gxwebsoft.cms.param.CmsLangParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 国际化Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-01-06 19:29:26
|
|
||||||
*/
|
|
||||||
public interface CmsLangMapper extends BaseMapper<CmsLang> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsLang>
|
|
||||||
*/
|
|
||||||
List<CmsLang> selectPageRel(@Param("page") IPage<CmsLang> page,
|
|
||||||
@Param("param") CmsLangParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsLang> selectListRel(@Param("param") CmsLangParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsLangLog;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsLink;
|
|
||||||
import com.gxwebsoft.cms.param.CmsLangLogParam;
|
|
||||||
import com.gxwebsoft.cms.param.CmsLinkParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 常用链接Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsLinkMapper extends BaseMapper<CmsLink> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsLink>
|
|
||||||
*/
|
|
||||||
List<CmsLink> selectPageRel(@Param("page") IPage<CmsLink> page,
|
|
||||||
@Param("param") CmsLinkParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsLink> selectListRel(@Param("param") CmsLinkParam param);
|
|
||||||
|
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
|
||||||
List<CmsLink> selectListAllRel(@Param("param") CmsLinkParam param);
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsModel;
|
|
||||||
import com.gxwebsoft.cms.param.CmsModelParam;
|
|
||||||
import com.gxwebsoft.cms.param.CmsWebsiteFieldParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 模型Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-11-26 15:44:53
|
|
||||||
*/
|
|
||||||
public interface CmsModelMapper extends BaseMapper<CmsModel> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsModel>
|
|
||||||
*/
|
|
||||||
List<CmsModel> selectPageRel(@Param("page") IPage<CmsModel> page,
|
|
||||||
@Param("param") CmsModelParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsModel> selectListRel(@Param("param") CmsModelParam param);
|
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
|
||||||
List<CmsModel> selectListAllRel(@Param("param") CmsModelParam param);
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsModel;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsNavigation;
|
|
||||||
import com.gxwebsoft.cms.param.CmsModelParam;
|
|
||||||
import com.gxwebsoft.cms.param.CmsNavigationParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站导航记录表Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsNavigationMapper extends BaseMapper<CmsNavigation> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsNavigation>
|
|
||||||
*/
|
|
||||||
List<CmsNavigation> selectPageRel(@Param("page") IPage<CmsNavigation> page,
|
|
||||||
@Param("param") CmsNavigationParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsNavigation> selectListRel(@Param("param") CmsNavigationParam param);
|
|
||||||
|
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
|
||||||
List<CmsNavigation> selectListAllRel(@Param("param") CmsNavigationParam param);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsStatistics;
|
|
||||||
import com.gxwebsoft.cms.param.CmsStatisticsParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 站点统计信息表Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-07-25 12:32:06
|
|
||||||
*/
|
|
||||||
public interface CmsStatisticsMapper extends BaseMapper<CmsStatistics> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsStatistics>
|
|
||||||
*/
|
|
||||||
List<CmsStatistics> selectPageRel(@Param("page") IPage<CmsStatistics> page,
|
|
||||||
@Param("param") CmsStatisticsParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsStatistics> selectListRel(@Param("param") CmsStatisticsParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsTemplate;
|
|
||||||
import com.gxwebsoft.cms.param.CmsTemplateParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站模版Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-01-21 14:21:16
|
|
||||||
*/
|
|
||||||
public interface CmsTemplateMapper extends BaseMapper<CmsTemplate> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsTemplate>
|
|
||||||
*/
|
|
||||||
List<CmsTemplate> selectPageRel(@Param("page") IPage<CmsTemplate> page,
|
|
||||||
@Param("param") CmsTemplateParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsTemplate> selectListRel(@Param("param") CmsTemplateParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsWebsiteField;
|
|
||||||
import com.gxwebsoft.cms.param.CmsWebsiteFieldParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 应用参数Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:36:14
|
|
||||||
*/
|
|
||||||
public interface CmsWebsiteFieldMapper extends BaseMapper<CmsWebsiteField> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsWebsiteField>
|
|
||||||
*/
|
|
||||||
List<CmsWebsiteField> selectPageRel(@Param("page") IPage<CmsWebsiteField> page,
|
|
||||||
@Param("param") CmsWebsiteFieldParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsWebsiteField> selectListRel(@Param("param") CmsWebsiteFieldParam param);
|
|
||||||
|
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
|
||||||
List<CmsWebsiteField> selectListAllRel(@Param("param") CmsWebsiteFieldParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsWebsite;
|
|
||||||
import com.gxwebsoft.cms.param.CmsWebsiteParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站信息记录表Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:36:14
|
|
||||||
*/
|
|
||||||
public interface CmsWebsiteMapper extends BaseMapper<CmsWebsite> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsWebsite>
|
|
||||||
*/
|
|
||||||
List<CmsWebsite> selectPageRel(@Param("page") IPage<CmsWebsite> page,
|
|
||||||
@Param("param") CmsWebsiteParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsWebsite> selectListRel(@Param("param") CmsWebsiteParam param);
|
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
|
||||||
List<CmsWebsite> selectPageRelAll(@Param("page") IPage<CmsWebsite> page,
|
|
||||||
@Param("param") CmsWebsiteParam param);
|
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
|
||||||
CmsWebsite getByIdRelAll(@Param("websiteId") Integer id);
|
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
|
||||||
boolean updateByIdAll(@Param("param") CmsWebsite cmsWebsite);
|
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
|
||||||
boolean removeByIdAll(@Param("websiteId") Integer id);
|
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
|
||||||
CmsWebsite getByTenantId(@Param("tenantId") Integer tenantId);
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package cms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsWebsiteSetting;
|
|
||||||
import com.gxwebsoft.cms.param.CmsWebsiteSettingParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站设置Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-02-19 01:35:44
|
|
||||||
*/
|
|
||||||
public interface CmsWebsiteSettingMapper extends BaseMapper<CmsWebsiteSetting> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsWebsiteSetting>
|
|
||||||
*/
|
|
||||||
List<CmsWebsiteSetting> selectPageRel(@Param("page") IPage<CmsWebsiteSetting> page,
|
|
||||||
@Param("param") CmsWebsiteSettingParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<CmsWebsiteSetting> selectListRel(@Param("param") CmsWebsiteSettingParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsAdRecord;
|
|
||||||
import com.gxwebsoft.cms.param.CmsAdRecordParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 广告图片Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsAdRecordService extends IService<CmsAdRecord> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsAdRecord>
|
|
||||||
*/
|
|
||||||
PageResult<CmsAdRecord> pageRel(CmsAdRecordParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsAdRecord>
|
|
||||||
*/
|
|
||||||
List<CmsAdRecord> listRel(CmsAdRecordParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param adRecordId ID
|
|
||||||
* @return CmsAdRecord
|
|
||||||
*/
|
|
||||||
CmsAdRecord getByIdRel(Integer adRecordId);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsAd;
|
|
||||||
import com.gxwebsoft.cms.param.CmsAdParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 广告位Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsAdService extends IService<CmsAd> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsAd>
|
|
||||||
*/
|
|
||||||
PageResult<CmsAd> pageRel(CmsAdParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsAd>
|
|
||||||
*/
|
|
||||||
List<CmsAd> listRel(CmsAdParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param adId ID
|
|
||||||
* @return CmsAd
|
|
||||||
*/
|
|
||||||
CmsAd getByIdRel(Integer adId);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleCategory;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleCategoryParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章分类表Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsArticleCategoryService extends IService<CmsArticleCategory> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsArticleCategory>
|
|
||||||
*/
|
|
||||||
PageResult<CmsArticleCategory> pageRel(CmsArticleCategoryParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsArticleCategory>
|
|
||||||
*/
|
|
||||||
List<CmsArticleCategory> listRel(CmsArticleCategoryParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param categoryId 文章分类ID
|
|
||||||
* @return CmsArticleCategory
|
|
||||||
*/
|
|
||||||
CmsArticleCategory getByIdRel(Integer categoryId);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleComment;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleCommentParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章评论表Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsArticleCommentService extends IService<CmsArticleComment> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsArticleComment>
|
|
||||||
*/
|
|
||||||
PageResult<CmsArticleComment> pageRel(CmsArticleCommentParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsArticleComment>
|
|
||||||
*/
|
|
||||||
List<CmsArticleComment> listRel(CmsArticleCommentParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param commentId 评价ID
|
|
||||||
* @return CmsArticleComment
|
|
||||||
*/
|
|
||||||
CmsArticleComment getByIdRel(Integer commentId);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticle;
|
|
||||||
import com.gxwebsoft.cms.entity.TranslateDataVo;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleContent;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleContentParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章记录表Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsArticleContentService extends IService<CmsArticleContent> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsArticleContent>
|
|
||||||
*/
|
|
||||||
PageResult<CmsArticleContent> pageRel(CmsArticleContentParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsArticleContent>
|
|
||||||
*/
|
|
||||||
List<CmsArticleContent> listRel(CmsArticleContentParam param);
|
|
||||||
|
|
||||||
|
|
||||||
CmsArticleContent getByIdRel(Integer id);
|
|
||||||
|
|
||||||
void translate(CmsArticle article);
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleCount;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleCountParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点赞文章Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsArticleCountService extends IService<CmsArticleCount> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsArticleCount>
|
|
||||||
*/
|
|
||||||
PageResult<CmsArticleCount> pageRel(CmsArticleCountParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsArticleCount>
|
|
||||||
*/
|
|
||||||
List<CmsArticleCount> listRel(CmsArticleCountParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id 主键ID
|
|
||||||
* @return CmsArticleCount
|
|
||||||
*/
|
|
||||||
CmsArticleCount getByIdRel(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleLike;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleLikeParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点赞文章Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsArticleLikeService extends IService<CmsArticleLike> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsArticleLike>
|
|
||||||
*/
|
|
||||||
PageResult<CmsArticleLike> pageRel(CmsArticleLikeParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsArticleLike>
|
|
||||||
*/
|
|
||||||
List<CmsArticleLike> listRel(CmsArticleLikeParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id 主键ID
|
|
||||||
* @return CmsArticleLike
|
|
||||||
*/
|
|
||||||
CmsArticleLike getByIdRel(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticle;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleParam;
|
|
||||||
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsArticleService extends IService<CmsArticle> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsArticle>
|
|
||||||
*/
|
|
||||||
PageResult<CmsArticle> pageRel(CmsArticleParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsArticle>
|
|
||||||
*/
|
|
||||||
List<CmsArticle> listRel(CmsArticleParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param articleId 文章ID
|
|
||||||
* @return CmsArticle
|
|
||||||
*/
|
|
||||||
CmsArticle getByIdRel(Integer articleId);
|
|
||||||
|
|
||||||
void saveInc(Integer formId);
|
|
||||||
|
|
||||||
boolean saveRel(@Valid CmsArticle article);
|
|
||||||
|
|
||||||
boolean updateByIdRel(CmsArticle article);
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsDesign;
|
|
||||||
import com.gxwebsoft.cms.param.CmsDesignParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面管理记录表Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsDesignService extends IService<CmsDesign> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsDesign>
|
|
||||||
*/
|
|
||||||
PageResult<CmsDesign> pageRel(CmsDesignParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsDesign>
|
|
||||||
*/
|
|
||||||
List<CmsDesign> listRel(CmsDesignParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param pageId ID
|
|
||||||
* @return CmsDesign
|
|
||||||
*/
|
|
||||||
CmsDesign getByIdRel(Integer pageId);
|
|
||||||
|
|
||||||
void translate(CmsDesign cmsDesign);
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsDomain;
|
|
||||||
import com.gxwebsoft.cms.param.CmsDomainParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站域名记录表Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:36:14
|
|
||||||
*/
|
|
||||||
public interface CmsDomainService extends IService<CmsDomain> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsDomain>
|
|
||||||
*/
|
|
||||||
PageResult<CmsDomain> pageRel(CmsDomainParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsDomain>
|
|
||||||
*/
|
|
||||||
List<CmsDomain> listRel(CmsDomainParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id ID
|
|
||||||
* @return CmsDomain
|
|
||||||
*/
|
|
||||||
CmsDomain getByIdRel(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsFormRecord;
|
|
||||||
import com.gxwebsoft.cms.param.CmsFormRecordParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 表单数据记录表Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsFormRecordService extends IService<CmsFormRecord> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsFormRecord>
|
|
||||||
*/
|
|
||||||
PageResult<CmsFormRecord> pageRel(CmsFormRecordParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsFormRecord>
|
|
||||||
*/
|
|
||||||
List<CmsFormRecord> listRel(CmsFormRecordParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param formRecordId ID
|
|
||||||
* @return CmsFormRecord
|
|
||||||
*/
|
|
||||||
CmsFormRecord getByIdRel(Integer formRecordId);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsForm;
|
|
||||||
import com.gxwebsoft.cms.param.CmsFormParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 表单设计表Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsFormService extends IService<CmsForm> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsForm>
|
|
||||||
*/
|
|
||||||
PageResult<CmsForm> pageRel(CmsFormParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsForm>
|
|
||||||
*/
|
|
||||||
List<CmsForm> listRel(CmsFormParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param formId ID
|
|
||||||
* @return CmsForm
|
|
||||||
*/
|
|
||||||
CmsForm getByIdRel(Integer formId);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsLangLog;
|
|
||||||
import com.gxwebsoft.cms.param.CmsLangLogParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 国际化记录启用Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-01-06 19:29:26
|
|
||||||
*/
|
|
||||||
public interface CmsLangLogService extends IService<CmsLangLog> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsLangLog>
|
|
||||||
*/
|
|
||||||
PageResult<CmsLangLog> pageRel(CmsLangLogParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsLangLog>
|
|
||||||
*/
|
|
||||||
List<CmsLangLog> listRel(CmsLangLogParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id ID
|
|
||||||
* @return CmsLangLog
|
|
||||||
*/
|
|
||||||
CmsLangLog getByIdRel(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsLang;
|
|
||||||
import com.gxwebsoft.cms.param.CmsLangParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 国际化Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-01-06 19:29:26
|
|
||||||
*/
|
|
||||||
public interface CmsLangService extends IService<CmsLang> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsLang>
|
|
||||||
*/
|
|
||||||
PageResult<CmsLang> pageRel(CmsLangParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsLang>
|
|
||||||
*/
|
|
||||||
List<CmsLang> listRel(CmsLangParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id ID
|
|
||||||
* @return CmsLang
|
|
||||||
*/
|
|
||||||
CmsLang getByIdRel(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsLink;
|
|
||||||
import com.gxwebsoft.cms.param.CmsLinkParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 常用链接Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsLinkService extends IService<CmsLink> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsLink>
|
|
||||||
*/
|
|
||||||
PageResult<CmsLink> pageRel(CmsLinkParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsLink>
|
|
||||||
*/
|
|
||||||
List<CmsLink> listRel(CmsLinkParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id 自增ID
|
|
||||||
* @return CmsLink
|
|
||||||
*/
|
|
||||||
CmsLink getByIdRel(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsModel;
|
|
||||||
import com.gxwebsoft.cms.param.CmsModelParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 模型Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-11-26 15:44:53
|
|
||||||
*/
|
|
||||||
public interface CmsModelService extends IService<CmsModel> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsModel>
|
|
||||||
*/
|
|
||||||
PageResult<CmsModel> pageRel(CmsModelParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsModel>
|
|
||||||
*/
|
|
||||||
List<CmsModel> listRel(CmsModelParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param modelId ID
|
|
||||||
* @return CmsModel
|
|
||||||
*/
|
|
||||||
CmsModel getByIdRel(Integer modelId);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsNavigation;
|
|
||||||
import com.gxwebsoft.cms.param.CmsNavigationParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站导航记录表Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
public interface CmsNavigationService extends IService<CmsNavigation> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsNavigation>
|
|
||||||
*/
|
|
||||||
PageResult<CmsNavigation> pageRel(CmsNavigationParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsNavigation>
|
|
||||||
*/
|
|
||||||
List<CmsNavigation> listRel(CmsNavigationParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param navigationId ID
|
|
||||||
* @return CmsNavigation
|
|
||||||
*/
|
|
||||||
CmsNavigation getByIdRel(Integer navigationId);
|
|
||||||
|
|
||||||
void saveAsync(CmsNavigation cmsNavigation);
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsStatistics;
|
|
||||||
import com.gxwebsoft.cms.param.CmsStatisticsParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 站点统计信息表Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-07-25 12:32:06
|
|
||||||
*/
|
|
||||||
public interface CmsStatisticsService extends IService<CmsStatistics> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsStatistics>
|
|
||||||
*/
|
|
||||||
PageResult<CmsStatistics> pageRel(CmsStatisticsParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsStatistics>
|
|
||||||
*/
|
|
||||||
List<CmsStatistics> listRel(CmsStatisticsParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id 自增ID
|
|
||||||
* @return CmsStatistics
|
|
||||||
*/
|
|
||||||
CmsStatistics getByIdRel(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsTemplate;
|
|
||||||
import com.gxwebsoft.cms.param.CmsTemplateParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站模版Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-01-21 14:21:16
|
|
||||||
*/
|
|
||||||
public interface CmsTemplateService extends IService<CmsTemplate> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsTemplate>
|
|
||||||
*/
|
|
||||||
PageResult<CmsTemplate> pageRel(CmsTemplateParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsTemplate>
|
|
||||||
*/
|
|
||||||
List<CmsTemplate> listRel(CmsTemplateParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id ID
|
|
||||||
* @return CmsTemplate
|
|
||||||
*/
|
|
||||||
CmsTemplate getByIdRel(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsWebsiteField;
|
|
||||||
import com.gxwebsoft.cms.param.CmsWebsiteFieldParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 应用参数Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:36:14
|
|
||||||
*/
|
|
||||||
public interface CmsWebsiteFieldService extends IService<CmsWebsiteField> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsWebsiteField>
|
|
||||||
*/
|
|
||||||
PageResult<CmsWebsiteField> pageRel(CmsWebsiteFieldParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsWebsiteField>
|
|
||||||
*/
|
|
||||||
List<CmsWebsiteField> listRel(CmsWebsiteFieldParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id 自增ID
|
|
||||||
* @return CmsWebsiteField
|
|
||||||
*/
|
|
||||||
CmsWebsiteField getByIdRel(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsWebsite;
|
|
||||||
import com.gxwebsoft.cms.param.CmsWebsiteParam;
|
|
||||||
import com.gxwebsoft.cms.vo.CmsVO;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站信息记录表Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:36:14
|
|
||||||
*/
|
|
||||||
public interface CmsWebsiteService extends IService<CmsWebsite> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsWebsite>
|
|
||||||
*/
|
|
||||||
PageResult<CmsWebsite> pageRel(CmsWebsiteParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsWebsite>
|
|
||||||
*/
|
|
||||||
List<CmsWebsite> listRel(CmsWebsiteParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param websiteId 站点ID
|
|
||||||
* @return CmsWebsite
|
|
||||||
*/
|
|
||||||
CmsWebsite getByIdRel(Integer websiteId);
|
|
||||||
|
|
||||||
PageResult<CmsWebsite> pageRelAll(CmsWebsiteParam param);
|
|
||||||
|
|
||||||
// 创建站点
|
|
||||||
CmsWebsite create(CmsWebsite cmsWebsite);
|
|
||||||
|
|
||||||
CmsWebsite getByIdRelAll(Integer id);
|
|
||||||
|
|
||||||
boolean updateByIdAll(CmsWebsite cmsWebsite);
|
|
||||||
|
|
||||||
boolean removeByIdAll(Integer id);
|
|
||||||
|
|
||||||
CmsWebsite getByTenantId(Integer tenantId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取网站基本信息(VO格式)
|
|
||||||
*
|
|
||||||
* @param tenantId 租户ID
|
|
||||||
* @return 网站信息VO
|
|
||||||
*/
|
|
||||||
CmsVO getSiteInfo(Integer tenantId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清除网站信息缓存
|
|
||||||
*
|
|
||||||
* @param tenantId 租户ID
|
|
||||||
*/
|
|
||||||
void clearSiteInfoCache(Integer tenantId);
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package cms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsWebsiteSetting;
|
|
||||||
import com.gxwebsoft.cms.param.CmsWebsiteSettingParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站设置Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-02-19 01:35:44
|
|
||||||
*/
|
|
||||||
public interface CmsWebsiteSettingService extends IService<CmsWebsiteSetting> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<CmsWebsiteSetting>
|
|
||||||
*/
|
|
||||||
PageResult<CmsWebsiteSetting> pageRel(CmsWebsiteSettingParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<CmsWebsiteSetting>
|
|
||||||
*/
|
|
||||||
List<CmsWebsiteSetting> listRel(CmsWebsiteSettingParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id 自增ID
|
|
||||||
* @return CmsWebsiteSetting
|
|
||||||
*/
|
|
||||||
CmsWebsiteSetting getByIdRel(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsAdRecordMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsAdRecordService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsAdRecord;
|
|
||||||
import com.gxwebsoft.cms.param.CmsAdRecordParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 广告图片Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsAdRecordServiceImpl extends ServiceImpl<CmsAdRecordMapper, CmsAdRecord> implements CmsAdRecordService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsAdRecord> pageRel(CmsAdRecordParam param) {
|
|
||||||
PageParam<CmsAdRecord, CmsAdRecordParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
List<CmsAdRecord> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsAdRecord> listRel(CmsAdRecordParam param) {
|
|
||||||
List<CmsAdRecord> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsAdRecord, CmsAdRecordParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsAdRecord getByIdRel(Integer adRecordId) {
|
|
||||||
CmsAdRecordParam param = new CmsAdRecordParam();
|
|
||||||
param.setAdRecordId(adRecordId);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsAdMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsAdService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsAd;
|
|
||||||
import com.gxwebsoft.cms.param.CmsAdParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 广告位Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsAdServiceImpl extends ServiceImpl<CmsAdMapper, CmsAd> implements CmsAdService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsAd> pageRel(CmsAdParam param) {
|
|
||||||
PageParam<CmsAd, CmsAdParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time asc");
|
|
||||||
List<CmsAd> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsAd> listRel(CmsAdParam param) {
|
|
||||||
List<CmsAd> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsAd, CmsAdParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("create_time asc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsAd getByIdRel(Integer adId) {
|
|
||||||
CmsAdParam param = new CmsAdParam();
|
|
||||||
param.setAdId(adId);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsArticleCategoryMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsArticleCategoryService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleCategory;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleCategoryParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章分类表Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsArticleCategoryServiceImpl extends ServiceImpl<CmsArticleCategoryMapper, CmsArticleCategory> implements CmsArticleCategoryService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsArticleCategory> pageRel(CmsArticleCategoryParam param) {
|
|
||||||
PageParam<CmsArticleCategory, CmsArticleCategoryParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
List<CmsArticleCategory> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsArticleCategory> listRel(CmsArticleCategoryParam param) {
|
|
||||||
List<CmsArticleCategory> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsArticleCategory, CmsArticleCategoryParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsArticleCategory getByIdRel(Integer categoryId) {
|
|
||||||
CmsArticleCategoryParam param = new CmsArticleCategoryParam();
|
|
||||||
param.setCategoryId(categoryId);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsArticleCommentMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsArticleCommentService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleComment;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleCommentParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章评论表Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsArticleCommentServiceImpl extends ServiceImpl<CmsArticleCommentMapper, CmsArticleComment> implements CmsArticleCommentService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsArticleComment> pageRel(CmsArticleCommentParam param) {
|
|
||||||
PageParam<CmsArticleComment, CmsArticleCommentParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
List<CmsArticleComment> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsArticleComment> listRel(CmsArticleCommentParam param) {
|
|
||||||
List<CmsArticleComment> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsArticleComment, CmsArticleCommentParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsArticleComment getByIdRel(Integer commentId) {
|
|
||||||
CmsArticleCommentParam param = new CmsArticleCommentParam();
|
|
||||||
param.setCommentId(commentId);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,189 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.entity.*;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsArticleContentMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsArticleContentService;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleContentParam;
|
|
||||||
import com.gxwebsoft.cms.service.CmsArticleService;
|
|
||||||
import com.gxwebsoft.cms.service.CmsLangLogService;
|
|
||||||
import com.gxwebsoft.cms.service.CmsNavigationService;
|
|
||||||
import com.gxwebsoft.common.core.utils.AliYunSender;
|
|
||||||
import com.gxwebsoft.common.core.utils.JSONUtil;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章记录表Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsArticleContentServiceImpl extends ServiceImpl<CmsArticleContentMapper, CmsArticleContent> implements CmsArticleContentService {
|
|
||||||
@Resource
|
|
||||||
@Lazy
|
|
||||||
private CmsNavigationService cmsNavigationService;
|
|
||||||
@Resource
|
|
||||||
@Lazy
|
|
||||||
private CmsArticleService cmsArticleService;
|
|
||||||
@Resource
|
|
||||||
private CmsLangLogService cmsLangLogService;
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsArticleContent> pageRel(CmsArticleContentParam param) {
|
|
||||||
PageParam<CmsArticleContent, CmsArticleContentParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
List<CmsArticleContent> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsArticleContent> listRel(CmsArticleContentParam param) {
|
|
||||||
List<CmsArticleContent> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsArticleContent, CmsArticleContentParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsArticleContent getByIdRel(Integer id) {
|
|
||||||
CmsArticleContentParam param = new CmsArticleContentParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void translate(CmsArticle article) {
|
|
||||||
// 未开启多语言
|
|
||||||
if(cmsLangLogService.count() == 0){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 仅限定新增简体中文才会同步翻译其他目标语言
|
|
||||||
if(!article.getLang().equals("zh_CN")){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 是否启用自动翻译
|
|
||||||
if(!article.getTranslation()){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 查询关联的默认语言栏目ID
|
|
||||||
CmsNavigation navigation = cmsNavigationService.getOne(new LambdaQueryWrapper<CmsNavigation>().eq(CmsNavigation::getLangCategoryId, article.getCategoryId()).last("limit 1"));
|
|
||||||
if (ObjectUtil.isNotEmpty(navigation)) {
|
|
||||||
TranslateDataVo vo = new TranslateDataVo();
|
|
||||||
vo.setFormatType("text");
|
|
||||||
vo.setSourceLanguage("auto");
|
|
||||||
vo.setTargetLanguage("en");
|
|
||||||
|
|
||||||
// 翻译标题
|
|
||||||
vo.setScene("title");
|
|
||||||
vo.setSourceText(article.getTitle());
|
|
||||||
article.setTitle(getTranslateApi(vo));
|
|
||||||
|
|
||||||
// 翻译摘要
|
|
||||||
vo.setSourceText(article.getComments());
|
|
||||||
vo.setScene("description");
|
|
||||||
article.setComments(getTranslateApi(vo));
|
|
||||||
|
|
||||||
// 翻译产品概述
|
|
||||||
vo.setSourceText(article.getOverview());
|
|
||||||
article.setOverview(getTranslateApi(vo));
|
|
||||||
|
|
||||||
// 翻译关键词
|
|
||||||
vo.setScene("title");
|
|
||||||
vo.setSourceText(article.getTags());
|
|
||||||
article.setTags(getTranslateApi(vo));
|
|
||||||
|
|
||||||
// 翻译话题
|
|
||||||
vo.setScene("title");
|
|
||||||
vo.setSourceText(article.getTopic());
|
|
||||||
article.setTopic(getTranslateApi(vo));
|
|
||||||
|
|
||||||
// 翻译来源
|
|
||||||
vo.setScene("title");
|
|
||||||
vo.setSourceText(article.getSource());
|
|
||||||
article.setSource(getTranslateApi(vo));
|
|
||||||
|
|
||||||
// 翻译内容
|
|
||||||
vo.setScene(null);
|
|
||||||
vo.setSourceText(article.getContent());
|
|
||||||
article.setContent(getTranslateApi(vo));
|
|
||||||
|
|
||||||
// 其他参数
|
|
||||||
article.setLang("en");
|
|
||||||
article.setCategoryId(navigation.getNavigationId());
|
|
||||||
|
|
||||||
|
|
||||||
CmsArticle target = cmsArticleService.getOne(new LambdaQueryWrapper<CmsArticle>().eq(CmsArticle::getLangArticleId,article.getArticleId()).last("limit 1"));
|
|
||||||
if(article.getIsUpdate() != null && target != null){
|
|
||||||
// 更新操作
|
|
||||||
if (ObjectUtil.isNotEmpty(target)) {
|
|
||||||
target.setTitle(article.getTitle());
|
|
||||||
target.setImage(article.getImage());
|
|
||||||
target.setFiles(article.getFiles());
|
|
||||||
target.setComments(article.getComments());
|
|
||||||
target.setTags(article.getTags());
|
|
||||||
target.setRecommend(article.getRecommend());
|
|
||||||
target.setOverview(article.getOverview());
|
|
||||||
target.setContent(article.getContent());
|
|
||||||
cmsArticleService.updateById(target);
|
|
||||||
this.update(new LambdaUpdateWrapper<CmsArticleContent>().eq(CmsArticleContent::getArticleId, target.getArticleId()).set(CmsArticleContent::getContent,target.getContent()));
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
// 新增操作
|
|
||||||
article.setLangArticleId(article.getArticleId());
|
|
||||||
cmsArticleService.save(article);
|
|
||||||
final CmsArticleContent content = new CmsArticleContent();
|
|
||||||
content.setArticleId(article.getArticleId());
|
|
||||||
content.setContent(article.getContent());
|
|
||||||
content.setTenantId(article.getTenantId());
|
|
||||||
this.save(content);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 机器翻译
|
|
||||||
* 阿里云接口
|
|
||||||
* <a href="https://help.aliyun.com/zh/machine-translation/developer-reference/using-rest-api?spm=a2c4g.11186623.help-menu-30396.d_4_3_0.7c071674A2aU4c">...</a>
|
|
||||||
*/
|
|
||||||
public String getTranslateApi(TranslateDataVo item){
|
|
||||||
String serviceURL = "http://mt.cn-hangzhou.aliyuncs.com/api/translate/web/ecommerce";
|
|
||||||
String accessKeyId = "LTAI5tEsyhW4GCKbds1qsopg";// 使用您的阿里云访问密钥 AccessKeyId
|
|
||||||
String accessKeySecret = "zltFlQrYVAoq2KMFDWgLa3GhkMNeyO"; // 使用您的阿里云访问密钥
|
|
||||||
|
|
||||||
final Map<String, Object> map = new HashMap<>();
|
|
||||||
map.put("FormatType","text");
|
|
||||||
map.put("SourceLanguage","auto");
|
|
||||||
map.put("TargetLanguage","en");
|
|
||||||
map.put("SourceText",item.getSourceText());
|
|
||||||
map.put("Scene","description");
|
|
||||||
map.put("Context","产品介绍");
|
|
||||||
// Sender代码请参考帮助文档“签名方法”
|
|
||||||
String result = AliYunSender.sendPost(serviceURL, JSONUtil.toJSONString(map), accessKeyId, accessKeySecret);
|
|
||||||
JSONObject jsonObject = JSON.parseObject(result);
|
|
||||||
final Object code = jsonObject.get("Code");
|
|
||||||
if (code.equals("200")) {
|
|
||||||
final Object data = jsonObject.get("Data");
|
|
||||||
JSONObject data1 = JSON.parseObject(data.toString());
|
|
||||||
final Object translated = data1.get("Translated");
|
|
||||||
final Object wordCount = data1.get("WordCount");
|
|
||||||
return translated.toString();
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsArticleCountMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsArticleCountService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleCount;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleCountParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点赞文章Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsArticleCountServiceImpl extends ServiceImpl<CmsArticleCountMapper, CmsArticleCount> implements CmsArticleCountService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsArticleCount> pageRel(CmsArticleCountParam param) {
|
|
||||||
PageParam<CmsArticleCount, CmsArticleCountParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
List<CmsArticleCount> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsArticleCount> listRel(CmsArticleCountParam param) {
|
|
||||||
List<CmsArticleCount> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsArticleCount, CmsArticleCountParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsArticleCount getByIdRel(Integer id) {
|
|
||||||
CmsArticleCountParam param = new CmsArticleCountParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsArticleLikeMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsArticleLikeService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleLike;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleLikeParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点赞文章Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsArticleLikeServiceImpl extends ServiceImpl<CmsArticleLikeMapper, CmsArticleLike> implements CmsArticleLikeService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsArticleLike> pageRel(CmsArticleLikeParam param) {
|
|
||||||
PageParam<CmsArticleLike, CmsArticleLikeParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
List<CmsArticleLike> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsArticleLike> listRel(CmsArticleLikeParam param) {
|
|
||||||
List<CmsArticleLike> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsArticleLike, CmsArticleLikeParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsArticleLike getByIdRel(Integer id) {
|
|
||||||
CmsArticleLikeParam param = new CmsArticleLikeParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,246 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticleContent;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsModel;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsNavigation;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsArticleMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsArticleContentService;
|
|
||||||
import com.gxwebsoft.cms.service.CmsArticleService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticle;
|
|
||||||
import com.gxwebsoft.cms.param.CmsArticleParam;
|
|
||||||
import com.gxwebsoft.cms.service.CmsModelService;
|
|
||||||
import com.gxwebsoft.cms.service.CmsNavigationService;
|
|
||||||
import com.gxwebsoft.common.core.utils.JSONUtil;
|
|
||||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.system.service.UserService;
|
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static com.gxwebsoft.common.core.constants.ArticleConstants.CACHE_KEY_ARTICLE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文章Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsArticleServiceImpl extends ServiceImpl<CmsArticleMapper, CmsArticle> implements CmsArticleService {
|
|
||||||
@Resource
|
|
||||||
@Lazy
|
|
||||||
private CmsNavigationService cmsNavigationService;
|
|
||||||
@Resource
|
|
||||||
private CmsArticleContentService cmsArticleContentService;
|
|
||||||
@Resource
|
|
||||||
private UserService userService;
|
|
||||||
@Resource
|
|
||||||
private CmsModelService cmsModelService;
|
|
||||||
@Resource
|
|
||||||
private RedisUtil redisUtil;
|
|
||||||
|
|
||||||
private static final int PERMISSION_PASSWORD = 2;
|
|
||||||
private static final long CACHE_MINUTES = 30L;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsArticle> pageRel(CmsArticleParam param) {
|
|
||||||
if (param.getParentId() != null && !param.getParentId().equals(0)) {
|
|
||||||
final List<CmsNavigation> cmsNavigations = cmsNavigationService.list(new LambdaQueryWrapper<CmsNavigation>().eq(CmsNavigation::getParentId, param.getParentId()));
|
|
||||||
if (!CollectionUtils.isEmpty(cmsNavigations)) {
|
|
||||||
param.setCategoryIds(cmsNavigations.stream().map(CmsNavigation::getNavigationId).collect(Collectors.toSet()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PageParam<CmsArticle, CmsArticleParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("sort_number asc,create_time desc");
|
|
||||||
List<CmsArticle> list = baseMapper.selectPageRel(page, param);
|
|
||||||
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsArticle> listRel(CmsArticleParam param) {
|
|
||||||
List<CmsArticle> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsArticle, CmsArticleParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("sort_number asc,create_time desc");
|
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(param.getSceneType())) {
|
|
||||||
// 导出数据
|
|
||||||
if (param.getSceneType().equals("Content")) {
|
|
||||||
final Set<Integer> collectIds = list.stream().map(CmsArticle::getArticleId).collect(Collectors.toSet());
|
|
||||||
final List<CmsArticleContent> contents = cmsArticleContentService.list(new LambdaQueryWrapper<CmsArticleContent>().in(CmsArticleContent::getArticleId, collectIds));
|
|
||||||
final Map<Integer, List<CmsArticleContent>> collect = contents.stream().collect(Collectors.groupingBy(CmsArticleContent::getArticleId));
|
|
||||||
list.forEach(d -> {
|
|
||||||
final List<CmsArticleContent> cmsArticleContents = collect.get(d.getArticleId());
|
|
||||||
final CmsArticleContent content = cmsArticleContents.get(0);
|
|
||||||
if (ObjectUtil.isNotEmpty(content)) {
|
|
||||||
d.setContent(content.getContent());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsArticle getByIdRel(Integer articleId) {
|
|
||||||
// String key = CACHE_KEY_ARTICLE + articleId;
|
|
||||||
// final String cacheInfo = redisUtil.get(key);
|
|
||||||
// if (StrUtil.isNotBlank(cacheInfo)) {
|
|
||||||
// final CmsArticle article = JSONUtil.parseObject(cacheInfo, CmsArticle.class);
|
|
||||||
// // 更新阅读数量
|
|
||||||
// assert article != null;
|
|
||||||
// article.setActualViews(article.getActualViews() + 1);
|
|
||||||
// updateById(article);
|
|
||||||
// return article;
|
|
||||||
// }
|
|
||||||
// 缓存不存在
|
|
||||||
CmsArticleParam param = new CmsArticleParam();
|
|
||||||
param.setArticleId(articleId);
|
|
||||||
final CmsArticle article = param.getOne(baseMapper.selectListRel(param));
|
|
||||||
if (ObjectUtil.isNotEmpty(article)) {
|
|
||||||
// 更新阅读数量
|
|
||||||
article.setActualViews(article.getActualViews() + 1);
|
|
||||||
updateById(article);
|
|
||||||
// 读取Banner
|
|
||||||
// final CmsModel model = cmsModelService.getOne(new LambdaQueryWrapper<CmsModel>().eq(CmsModel::getModel, article.getModel()).last("limit 1"));
|
|
||||||
// if (ObjectUtil.isNotEmpty(model)) {
|
|
||||||
// article.setBanner(model.getBanner());
|
|
||||||
// }
|
|
||||||
// 附加文字内容
|
|
||||||
CmsArticleContent content = cmsArticleContentService.getOne(new LambdaQueryWrapper<CmsArticleContent>().eq(CmsArticleContent::getArticleId, article.getArticleId()).last("limit 1"));
|
|
||||||
if (content != null) {
|
|
||||||
article.setContent(content.getContent());
|
|
||||||
}
|
|
||||||
// redisUtil.set(key, article, CACHE_MINUTES, TimeUnit.MINUTES);
|
|
||||||
return article;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void saveInc(Integer formId) {
|
|
||||||
final CmsArticle article = getById(formId);
|
|
||||||
if (ObjectUtil.isNull(article)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
article.setBmUsers(article.getBmUsers() + 1);
|
|
||||||
updateById(article);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean saveRel(CmsArticle article) {
|
|
||||||
try {
|
|
||||||
// 保存文章模型
|
|
||||||
final CmsNavigation cmsNavigation = cmsNavigationService.getByIdRel(article.getCategoryId());
|
|
||||||
final CmsModel modelInfo = cmsNavigation.getModelInfo();
|
|
||||||
final String componentDetail = modelInfo.getComponentDetail();
|
|
||||||
if (ObjectUtil.isNotEmpty(componentDetail)) {
|
|
||||||
final String[] split = componentDetail.split("/");
|
|
||||||
article.setModel(modelInfo.getModel());
|
|
||||||
if (split[2].equals(modelInfo.getModel())) {
|
|
||||||
article.setDetail(split[2].concat("/").concat(split[3]));
|
|
||||||
} else {
|
|
||||||
article.setDetail(split[2]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 是否密码可见
|
|
||||||
if (article.getPermission() != null && article.getPermission() == PERMISSION_PASSWORD) {
|
|
||||||
article.setPassword(userService.encodePassword(article.getPassword()));
|
|
||||||
}
|
|
||||||
// 保存文章内容
|
|
||||||
final boolean save = save(article);
|
|
||||||
if(StrUtil.isBlank(article.getContent())){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (save) {
|
|
||||||
final CmsArticleContent content = new CmsArticleContent();
|
|
||||||
content.setArticleId(article.getArticleId());
|
|
||||||
content.setContent(article.getContent());
|
|
||||||
content.setTenantId(article.getTenantId());
|
|
||||||
cmsArticleContentService.save(content);
|
|
||||||
// 同步翻译并保存
|
|
||||||
cmsArticleContentService.translate(article);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean updateByIdRel(CmsArticle article) {
|
|
||||||
// 是否密码可见
|
|
||||||
if (article.getPermission() == PERMISSION_PASSWORD) {
|
|
||||||
article.setPassword(userService.encodePassword(article.getPassword()));
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
// 保存文章模型
|
|
||||||
final CmsNavigation cmsNavigation = cmsNavigationService.getByIdRel(article.getCategoryId());
|
|
||||||
// 模型信息
|
|
||||||
if (ObjectUtil.isNotEmpty(cmsNavigation)) {
|
|
||||||
final CmsModel modelInfo = cmsNavigation.getModelInfo();
|
|
||||||
final String componentDetail = modelInfo.getComponentDetail();
|
|
||||||
if (ObjectUtil.isNotEmpty(componentDetail)) {
|
|
||||||
final String[] split = componentDetail.split("/");
|
|
||||||
article.setModel(modelInfo.getModel());
|
|
||||||
if (split[2].equals(modelInfo.getModel())) {
|
|
||||||
article.setDetail(split[2].concat("/").concat(split[3]));
|
|
||||||
} else {
|
|
||||||
article.setDetail(split[2]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 修正父级栏目ID
|
|
||||||
if (article.getParentId().equals(0)) {
|
|
||||||
final CmsNavigation current = cmsNavigationService.getById(article.getCategoryId());
|
|
||||||
if (ObjectUtil.isNotEmpty(current)) {
|
|
||||||
article.setParentId(current.getParentId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (updateById(article)) {
|
|
||||||
if (StrUtil.isBlank(article.getContent())) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
// 删除缓存
|
|
||||||
String key = CACHE_KEY_ARTICLE + article.getArticleId();
|
|
||||||
redisUtil.delete(key);
|
|
||||||
// 更新内容
|
|
||||||
final boolean update = cmsArticleContentService.update(new LambdaUpdateWrapper<CmsArticleContent>().eq(CmsArticleContent::getArticleId, article.getArticleId()).set(CmsArticleContent::getContent, article.getContent()));
|
|
||||||
if (update) {
|
|
||||||
// 同步翻译并保存
|
|
||||||
article.setIsUpdate(true);
|
|
||||||
cmsArticleContentService.translate(article);
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
// 添加内容
|
|
||||||
final CmsArticleContent content = new CmsArticleContent();
|
|
||||||
content.setArticleId(article.getArticleId());
|
|
||||||
content.setContent(article.getContent());
|
|
||||||
content.setTenantId(article.getTenantId());
|
|
||||||
cmsArticleContentService.save(content);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsDesignRecordMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsDesignRecordService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsDesignRecord;
|
|
||||||
import com.gxwebsoft.cms.param.CmsDesignRecordParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面组件表Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsDesignRecordServiceImpl extends ServiceImpl<CmsDesignRecordMapper, CmsDesignRecord> implements CmsDesignRecordService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsDesignRecord> pageRel(CmsDesignRecordParam param) {
|
|
||||||
PageParam<CmsDesignRecord, CmsDesignRecordParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
List<CmsDesignRecord> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsDesignRecord> listRel(CmsDesignRecordParam param) {
|
|
||||||
List<CmsDesignRecord> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsDesignRecord, CmsDesignRecordParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsDesignRecord getByIdRel(Integer id) {
|
|
||||||
CmsDesignRecordParam param = new CmsDesignRecordParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsNavigation;
|
|
||||||
import com.gxwebsoft.cms.entity.TranslateDataVo;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsDesignMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsArticleContentService;
|
|
||||||
import com.gxwebsoft.cms.service.CmsDesignService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsDesign;
|
|
||||||
import com.gxwebsoft.cms.param.CmsDesignParam;
|
|
||||||
import com.gxwebsoft.cms.service.CmsLangLogService;
|
|
||||||
import com.gxwebsoft.cms.service.CmsNavigationService;
|
|
||||||
import com.gxwebsoft.common.core.utils.AliYunSender;
|
|
||||||
import com.gxwebsoft.common.core.utils.JSONUtil;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面管理记录表Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsDesignServiceImpl extends ServiceImpl<CmsDesignMapper, CmsDesign> implements CmsDesignService {
|
|
||||||
@Resource
|
|
||||||
private CmsLangLogService cmsLangLogService;
|
|
||||||
@Resource
|
|
||||||
@Lazy
|
|
||||||
private CmsNavigationService cmsNavigationService;
|
|
||||||
@Resource
|
|
||||||
@Lazy
|
|
||||||
private CmsArticleContentService cmsArticleContentService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsDesign> pageRel(CmsDesignParam param) {
|
|
||||||
PageParam<CmsDesign, CmsDesignParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time asc");
|
|
||||||
List<CmsDesign> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsDesign> listRel(CmsDesignParam param) {
|
|
||||||
List<CmsDesign> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsDesign, CmsDesignParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time asc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsDesign getByIdRel(Integer pageId) {
|
|
||||||
CmsDesignParam param = new CmsDesignParam();
|
|
||||||
param.setPageId(pageId);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void translate(CmsDesign cmsDesign) {
|
|
||||||
// 是否启用自动翻译
|
|
||||||
if (!cmsDesign.getTranslation()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 未开启多语言
|
|
||||||
if (cmsLangLogService.count() == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 查询关联的默认语言栏目ID
|
|
||||||
CmsNavigation navigation = cmsNavigationService.getOne(new LambdaQueryWrapper<CmsNavigation>().eq(CmsNavigation::getLangCategoryId, cmsDesign.getCategoryId()).last("limit 1"));
|
|
||||||
if (ObjectUtil.isEmpty(navigation)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 仅限定新增简体中文才会同步翻译其他目标语言
|
|
||||||
if (!navigation.getLang().equals("en")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 查找要翻译的单页面信息
|
|
||||||
final CmsDesign design = getOne(new LambdaQueryWrapper<CmsDesign>().eq(CmsDesign::getCategoryId, navigation.getNavigationId()).last("limit 1"));
|
|
||||||
if (ObjectUtil.isNotEmpty(design)) {
|
|
||||||
|
|
||||||
TranslateDataVo vo = new TranslateDataVo();
|
|
||||||
vo.setFormatType("text");
|
|
||||||
vo.setSourceLanguage("auto");
|
|
||||||
vo.setTargetLanguage("en");
|
|
||||||
|
|
||||||
// 翻译标题
|
|
||||||
vo.setScene("title");
|
|
||||||
vo.setSourceText(cmsDesign.getName());
|
|
||||||
design.setName(getTranslateApi(vo));
|
|
||||||
|
|
||||||
// 翻译关键词
|
|
||||||
vo.setSourceText(cmsDesign.getKeywords());
|
|
||||||
design.setKeywords(getTranslateApi(vo));
|
|
||||||
|
|
||||||
// 翻译描述
|
|
||||||
vo.setSourceText(cmsDesign.getDescription());
|
|
||||||
design.setDescription(getTranslateApi(vo));
|
|
||||||
|
|
||||||
// 翻译页面内容
|
|
||||||
vo.setScene(null);
|
|
||||||
vo.setSourceText(cmsDesign.getContent());
|
|
||||||
design.setContent(getTranslateApi(vo));
|
|
||||||
design.setShowBanner(cmsDesign.getShowBanner());
|
|
||||||
design.setStyle(cmsDesign.getStyle());
|
|
||||||
design.setShowButton(cmsDesign.getShowButton());
|
|
||||||
design.setBuyUrl(cmsDesign.getBuyUrl());
|
|
||||||
updateById(design);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 机器翻译
|
|
||||||
* 阿里云接口
|
|
||||||
* <a href="https://help.aliyun.com/zh/machine-translation/developer-reference/using-rest-api?spm=a2c4g.11186623.help-menu-30396.d_4_3_0.7c071674A2aU4c">...</a>
|
|
||||||
*/
|
|
||||||
public String getTranslateApi(TranslateDataVo item) {
|
|
||||||
String serviceURL = "http://mt.cn-hangzhou.aliyuncs.com/api/translate/web/ecommerce";
|
|
||||||
String accessKeyId = "LTAI5tEsyhW4GCKbds1qsopg";// 使用您的阿里云访问密钥 AccessKeyId
|
|
||||||
String accessKeySecret = "zltFlQrYVAoq2KMFDWgLa3GhkMNeyO"; // 使用您的阿里云访问密钥
|
|
||||||
|
|
||||||
final Map<String, Object> map = new HashMap<>();
|
|
||||||
map.put("FormatType", "text");
|
|
||||||
map.put("SourceLanguage", "auto");
|
|
||||||
map.put("TargetLanguage", "en");
|
|
||||||
map.put("SourceText", item.getSourceText());
|
|
||||||
map.put("Scene", "description");
|
|
||||||
map.put("Context", "产品介绍");
|
|
||||||
// Sender代码请参考帮助文档“签名方法”
|
|
||||||
String result = AliYunSender.sendPost(serviceURL, JSONUtil.toJSONString(map), accessKeyId, accessKeySecret);
|
|
||||||
JSONObject jsonObject = JSON.parseObject(result);
|
|
||||||
final Object code = jsonObject.get("Code");
|
|
||||||
if (code.equals("200")) {
|
|
||||||
final Object data = jsonObject.get("Data");
|
|
||||||
JSONObject data1 = JSON.parseObject(data.toString());
|
|
||||||
final Object translated = data1.get("Translated");
|
|
||||||
final Object wordCount = data1.get("WordCount");
|
|
||||||
return translated.toString();
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsDomainMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsDomainService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsDomain;
|
|
||||||
import com.gxwebsoft.cms.param.CmsDomainParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站域名记录表Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:36:14
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsDomainServiceImpl extends ServiceImpl<CmsDomainMapper, CmsDomain> implements CmsDomainService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsDomain> pageRel(CmsDomainParam param) {
|
|
||||||
PageParam<CmsDomain, CmsDomainParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
List<CmsDomain> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsDomain> listRel(CmsDomainParam param) {
|
|
||||||
List<CmsDomain> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsDomain, CmsDomainParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsDomain getByIdRel(Integer id) {
|
|
||||||
CmsDomainParam param = new CmsDomainParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsFormRecordMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsFormRecordService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsFormRecord;
|
|
||||||
import com.gxwebsoft.cms.param.CmsFormRecordParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 表单数据记录表Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsFormRecordServiceImpl extends ServiceImpl<CmsFormRecordMapper, CmsFormRecord> implements CmsFormRecordService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsFormRecord> pageRel(CmsFormRecordParam param) {
|
|
||||||
PageParam<CmsFormRecord, CmsFormRecordParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
List<CmsFormRecord> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsFormRecord> listRel(CmsFormRecordParam param) {
|
|
||||||
List<CmsFormRecord> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsFormRecord, CmsFormRecordParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsFormRecord getByIdRel(Integer formRecordId) {
|
|
||||||
CmsFormRecordParam param = new CmsFormRecordParam();
|
|
||||||
param.setFormRecordId(formRecordId);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsFormMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsFormService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsForm;
|
|
||||||
import com.gxwebsoft.cms.param.CmsFormParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 表单设计表Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsFormServiceImpl extends ServiceImpl<CmsFormMapper, CmsForm> implements CmsFormService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsForm> pageRel(CmsFormParam param) {
|
|
||||||
PageParam<CmsForm, CmsFormParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
List<CmsForm> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsForm> listRel(CmsFormParam param) {
|
|
||||||
List<CmsForm> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsForm, CmsFormParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsForm getByIdRel(Integer formId) {
|
|
||||||
CmsFormParam param = new CmsFormParam();
|
|
||||||
param.setFormId(formId);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsLangLogMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsLangLogService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsLangLog;
|
|
||||||
import com.gxwebsoft.cms.param.CmsLangLogParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 国际化记录启用Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-01-06 19:29:26
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsLangLogServiceImpl extends ServiceImpl<CmsLangLogMapper, CmsLangLog> implements CmsLangLogService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsLangLog> pageRel(CmsLangLogParam param) {
|
|
||||||
PageParam<CmsLangLog, CmsLangLogParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
List<CmsLangLog> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsLangLog> listRel(CmsLangLogParam param) {
|
|
||||||
List<CmsLangLog> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsLangLog, CmsLangLogParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsLangLog getByIdRel(Integer id) {
|
|
||||||
CmsLangLogParam param = new CmsLangLogParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsLangMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsLangService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsLang;
|
|
||||||
import com.gxwebsoft.cms.param.CmsLangParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 国际化Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-01-06 19:29:26
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsLangServiceImpl extends ServiceImpl<CmsLangMapper, CmsLang> implements CmsLangService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsLang> pageRel(CmsLangParam param) {
|
|
||||||
PageParam<CmsLang, CmsLangParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
List<CmsLang> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsLang> listRel(CmsLangParam param) {
|
|
||||||
List<CmsLang> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsLang, CmsLangParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsLang getByIdRel(Integer id) {
|
|
||||||
CmsLangParam param = new CmsLangParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsLinkMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsLinkService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsLink;
|
|
||||||
import com.gxwebsoft.cms.param.CmsLinkParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 常用链接Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsLinkServiceImpl extends ServiceImpl<CmsLinkMapper, CmsLink> implements CmsLinkService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsLink> pageRel(CmsLinkParam param) {
|
|
||||||
PageParam<CmsLink, CmsLinkParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("sort_number asc,create_time asc");
|
|
||||||
List<CmsLink> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsLink> listRel(CmsLinkParam param) {
|
|
||||||
List<CmsLink> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsLink, CmsLinkParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("create_time asc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsLink getByIdRel(Integer id) {
|
|
||||||
CmsLinkParam param = new CmsLinkParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsModelMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsModelService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsModel;
|
|
||||||
import com.gxwebsoft.cms.param.CmsModelParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 模型Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-11-26 15:44:53
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsModelServiceImpl extends ServiceImpl<CmsModelMapper, CmsModel> implements CmsModelService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsModel> pageRel(CmsModelParam param) {
|
|
||||||
PageParam<CmsModel, CmsModelParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time asc");
|
|
||||||
List<CmsModel> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsModel> listRel(CmsModelParam param) {
|
|
||||||
List<CmsModel> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsModel, CmsModelParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time asc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsModel getByIdRel(Integer modelId) {
|
|
||||||
CmsModelParam param = new CmsModelParam();
|
|
||||||
param.setModelId(modelId);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,161 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsDesign;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsModel;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsNavigationMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsDesignService;
|
|
||||||
import com.gxwebsoft.cms.service.CmsModelService;
|
|
||||||
import com.gxwebsoft.cms.service.CmsNavigationService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsNavigation;
|
|
||||||
import com.gxwebsoft.cms.param.CmsNavigationParam;
|
|
||||||
import com.gxwebsoft.common.core.exception.BusinessException;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.system.service.UserService;
|
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.text.MessageFormat;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站导航记录表Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:47:57
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsNavigationServiceImpl extends ServiceImpl<CmsNavigationMapper, CmsNavigation> implements CmsNavigationService {
|
|
||||||
@Resource
|
|
||||||
@Lazy
|
|
||||||
private CmsDesignService cmsDesignService;
|
|
||||||
@Resource
|
|
||||||
private CmsModelService cmsModelService;
|
|
||||||
@Resource
|
|
||||||
private UserService userService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsNavigation> pageRel(CmsNavigationParam param) {
|
|
||||||
PageParam<CmsNavigation, CmsNavigationParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("sort_number asc, position asc, navigation_id asc");
|
|
||||||
List<CmsNavigation> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsNavigation> listRel(CmsNavigationParam param) {
|
|
||||||
List<CmsNavigation> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsNavigation, CmsNavigationParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("sort_number asc, position asc,navigation_id asc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsNavigation getByIdRel(Integer navigationId) {
|
|
||||||
CmsNavigationParam param = new CmsNavigationParam();
|
|
||||||
param.setNavigationId(navigationId);
|
|
||||||
CmsNavigation navigation;
|
|
||||||
navigation = param.getOne(baseMapper.selectListRel(param));
|
|
||||||
if (ObjectUtil.isEmpty(navigation)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// 父级栏目并且是page模型则读取子项目第一条
|
|
||||||
if (navigation.getParentId().equals(0) && navigation.getModel().equals("page")) {
|
|
||||||
final CmsNavigation parent = this.getOne(new LambdaQueryWrapper<CmsNavigation>().eq(CmsNavigation::getParentId, navigation.getNavigationId()).last("limit 1"));
|
|
||||||
if (ObjectUtil.isNotEmpty(parent)) {
|
|
||||||
navigation = parent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 所属页面
|
|
||||||
navigation.setDesign(cmsDesignService.getOne(new LambdaQueryWrapper<CmsDesign>().eq(CmsDesign::getCategoryId, navigation.getNavigationId()).last("limit 1")));
|
|
||||||
// 所属模型
|
|
||||||
if (StrUtil.isNotBlank(navigation.getModel())) {
|
|
||||||
navigation.setModelInfo(cmsModelService.getOne(new LambdaQueryWrapper<CmsModel>().eq(CmsModel::getModel, navigation.getModel()).last("limit 1")));
|
|
||||||
if (StrUtil.isBlank(navigation.getBanner())) {
|
|
||||||
navigation.setBanner(navigation.getModelInfo().getBanner());
|
|
||||||
navigation.setMpBanner(navigation.getModelInfo().getThumb());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return navigation;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 配置路由生成规则
|
|
||||||
* path:/模型/导航ID
|
|
||||||
* component: /pages/模型/index.vue
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void saveAsync(CmsNavigation navigation) {
|
|
||||||
// TODO 1.设计path和component生产规则
|
|
||||||
final String path = navigation.getPath();
|
|
||||||
final CmsModel model = cmsModelService.getOne(new LambdaQueryWrapper<CmsModel>().eq(CmsModel::getModel, navigation.getModel()).last("limit 1"));
|
|
||||||
// 1.自动配置
|
|
||||||
navigation.setPath("/" + navigation.getModel() + "/" + navigation.getNavigationId());
|
|
||||||
navigation.setTarget("_self");
|
|
||||||
navigation.setComponent(MessageFormat.format("/pages/{0}/{1}", navigation.getModel(), "[id].vue"));
|
|
||||||
|
|
||||||
// 1.2自定义文件后缀
|
|
||||||
if(!navigation.getModel().equals("index") && model.getSuffix() != null){
|
|
||||||
navigation.setPath(navigation.getPath() + model.getSuffix());
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2.特例:默认首页
|
|
||||||
if (navigation.getPath().equals("/") || navigation.getModel().equals("index")) {
|
|
||||||
final long count = count(new LambdaQueryWrapper<CmsNavigation>().eq(CmsNavigation::getPath, "/").eq(CmsNavigation::getLang,navigation.getLang()));
|
|
||||||
if(count > 1){
|
|
||||||
throw new BusinessException("路由地址已存在!");
|
|
||||||
}
|
|
||||||
navigation.setPath("/");
|
|
||||||
navigation.setComponent("/pages/index.vue");
|
|
||||||
navigation.setModel("index");
|
|
||||||
navigation.setHome(1);
|
|
||||||
}
|
|
||||||
// 3.外链模型
|
|
||||||
if (navigation.getModel().equals("links")) {
|
|
||||||
navigation.setPath(path);
|
|
||||||
navigation.setTarget("_blank");
|
|
||||||
navigation.setComponent(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 4.密码可见
|
|
||||||
if(StrUtil.isNotBlank(navigation.getPassword())){
|
|
||||||
navigation.setPassword(userService.encodePassword(navigation.getPassword()));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 更新操作
|
|
||||||
updateById(navigation);
|
|
||||||
|
|
||||||
// TODO 2.同步添加页面
|
|
||||||
final CmsDesign one = cmsDesignService.getOne(new LambdaQueryWrapper<CmsDesign>().eq(CmsDesign::getCategoryId, navigation.getNavigationId()).eq(CmsDesign::getDeleted, 0).last("limit 1"));
|
|
||||||
if (ObjectUtil.isEmpty(one)) {
|
|
||||||
final CmsDesign design = new CmsDesign();
|
|
||||||
design.setName(navigation.getTitle());
|
|
||||||
design.setCategoryId(navigation.getNavigationId());
|
|
||||||
design.setKeywords(navigation.getTitle());
|
|
||||||
design.setDescription(navigation.getComments());
|
|
||||||
design.setPath(navigation.getPath());
|
|
||||||
design.setComponent(navigation.getComponent());
|
|
||||||
design.setTenantId(navigation.getTenantId());
|
|
||||||
if (StrUtil.isNotBlank(navigation.getContent())) {
|
|
||||||
design.setContent(navigation.getContent());
|
|
||||||
}
|
|
||||||
cmsDesignService.save(design);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 面包屑
|
|
||||||
// final CmsNavigation parent = getById(navigation.getParentId());
|
|
||||||
// if (ObjectUtil.isNotEmpty(parent) && navigation.getParentId() > 0) {
|
|
||||||
// navigation.setParentName(parent.getTitle());
|
|
||||||
// navigation.setParentPath(parent.getPath());
|
|
||||||
// navigation.setParentId(parent.getNavigationId());
|
|
||||||
// updateById(parent);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsStatisticsMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsStatisticsService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsStatistics;
|
|
||||||
import com.gxwebsoft.cms.param.CmsStatisticsParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 站点统计信息表Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-07-25 12:32:06
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsStatisticsServiceImpl extends ServiceImpl<CmsStatisticsMapper, CmsStatistics> implements CmsStatisticsService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsStatistics> pageRel(CmsStatisticsParam param) {
|
|
||||||
PageParam<CmsStatistics, CmsStatisticsParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
List<CmsStatistics> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsStatistics> listRel(CmsStatisticsParam param) {
|
|
||||||
List<CmsStatistics> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsStatistics, CmsStatisticsParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsStatistics getByIdRel(Integer id) {
|
|
||||||
CmsStatisticsParam param = new CmsStatisticsParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsTemplateMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsTemplateService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsTemplate;
|
|
||||||
import com.gxwebsoft.cms.param.CmsTemplateParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站模版Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-01-21 14:21:16
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsTemplateServiceImpl extends ServiceImpl<CmsTemplateMapper, CmsTemplate> implements CmsTemplateService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsTemplate> pageRel(CmsTemplateParam param) {
|
|
||||||
PageParam<CmsTemplate, CmsTemplateParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
List<CmsTemplate> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsTemplate> listRel(CmsTemplateParam param) {
|
|
||||||
List<CmsTemplate> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsTemplate, CmsTemplateParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsTemplate getByIdRel(Integer id) {
|
|
||||||
CmsTemplateParam param = new CmsTemplateParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsWebsiteFieldMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsWebsiteFieldService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsWebsiteField;
|
|
||||||
import com.gxwebsoft.cms.param.CmsWebsiteFieldParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 应用参数Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:36:14
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsWebsiteFieldServiceImpl extends ServiceImpl<CmsWebsiteFieldMapper, CmsWebsiteField> implements CmsWebsiteFieldService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsWebsiteField> pageRel(CmsWebsiteFieldParam param) {
|
|
||||||
PageParam<CmsWebsiteField, CmsWebsiteFieldParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time asc");
|
|
||||||
List<CmsWebsiteField> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsWebsiteField> listRel(CmsWebsiteFieldParam param) {
|
|
||||||
List<CmsWebsiteField> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsWebsiteField, CmsWebsiteFieldParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time asc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsWebsiteField getByIdRel(Integer id) {
|
|
||||||
CmsWebsiteFieldParam param = new CmsWebsiteFieldParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,415 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.entity.*;
|
|
||||||
import com.gxwebsoft.cms.mapper.*;
|
|
||||||
import com.gxwebsoft.cms.param.*;
|
|
||||||
import com.gxwebsoft.cms.service.*;
|
|
||||||
import com.gxwebsoft.cms.vo.CmsVO;
|
|
||||||
import com.gxwebsoft.common.core.utils.JSONUtil;
|
|
||||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import com.gxwebsoft.common.system.service.CompanyService;
|
|
||||||
import com.gxwebsoft.common.system.service.UserService;
|
|
||||||
import com.gxwebsoft.project.entity.Project;
|
|
||||||
import com.gxwebsoft.project.service.ProjectService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站信息记录表Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-09-10 20:36:14
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
public class CmsWebsiteServiceImpl extends ServiceImpl<CmsWebsiteMapper, CmsWebsite> implements CmsWebsiteService {
|
|
||||||
|
|
||||||
private static final String SITE_INFO_KEY_PREFIX = "SiteInfo:";
|
|
||||||
@Resource
|
|
||||||
private CmsWebsiteFieldMapper cmsWebsiteFieldMapper;
|
|
||||||
@Resource
|
|
||||||
private CmsModelMapper cmsModelMapper;
|
|
||||||
@Resource
|
|
||||||
private CmsNavigationMapper cmsNavigationMapper;
|
|
||||||
@Resource
|
|
||||||
private CmsLangLogMapper cmsLangLogMapper;
|
|
||||||
@Resource
|
|
||||||
private CmsAdMapper cmsAdMapper;
|
|
||||||
@Resource
|
|
||||||
private CmsLinkMapper cmsLinkMapper;
|
|
||||||
@Resource
|
|
||||||
private CmsArticleMapper cmsArticleMapper;
|
|
||||||
@Resource
|
|
||||||
private CmsWebsiteFieldService cmsWebsiteFieldService;
|
|
||||||
@Resource
|
|
||||||
private CmsModelService cmsModelService;
|
|
||||||
@Resource
|
|
||||||
private CmsNavigationService cmsNavigationService;
|
|
||||||
@Resource
|
|
||||||
private CmsLangLogService cmsLangLogService;
|
|
||||||
@Resource
|
|
||||||
private CmsAdService cmsAdService;
|
|
||||||
@Resource
|
|
||||||
private CmsLinkService cmsLinkService;
|
|
||||||
@Resource
|
|
||||||
private CmsArticleService cmsArticleService;
|
|
||||||
@Resource
|
|
||||||
private CmsArticleContentService cmsArticleContentService;
|
|
||||||
@Resource
|
|
||||||
private CmsWebsiteMapper cmsWebsiteMapper;
|
|
||||||
@Resource
|
|
||||||
private ProjectService projectService;
|
|
||||||
@Resource
|
|
||||||
private RedisUtil redisUtil;
|
|
||||||
@Resource
|
|
||||||
private UserService userService;
|
|
||||||
@Resource
|
|
||||||
private CompanyService companyService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsWebsite> pageRel(CmsWebsiteParam param) {
|
|
||||||
PageParam<CmsWebsite, CmsWebsiteParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
List<CmsWebsite> list = baseMapper.selectPageRel(page, param);
|
|
||||||
list.forEach(d -> {
|
|
||||||
LocalDateTime now = LocalDateTime.now();
|
|
||||||
// 即将过期(一周内过期的)
|
|
||||||
d.setSoon(d.getExpirationTime().minusDays(30).compareTo(now));
|
|
||||||
// 是否过期 -1已过期 大于0 未过期
|
|
||||||
d.setStatus(d.getExpirationTime().compareTo(now));
|
|
||||||
});
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsWebsite> listRel(CmsWebsiteParam param) {
|
|
||||||
List<CmsWebsite> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsWebsite, CmsWebsiteParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsWebsite getByIdRel(Integer websiteId) {
|
|
||||||
CmsWebsiteParam param = new CmsWebsiteParam();
|
|
||||||
param.setWebsiteId(websiteId);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsWebsite> pageRelAll(CmsWebsiteParam param) {
|
|
||||||
PageParam<CmsWebsite, CmsWebsiteParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
List<CmsWebsite> list = baseMapper.selectPageRelAll(page, param);
|
|
||||||
list.forEach(d -> {
|
|
||||||
LocalDateTime now = LocalDateTime.now();
|
|
||||||
// 即将过期(一周内过期的)
|
|
||||||
d.setSoon(d.getExpirationTime().minusDays(30).compareTo(now));
|
|
||||||
// 是否过期 -1已过期 大于0 未过期
|
|
||||||
d.setStatus(d.getExpirationTime().compareTo(now));
|
|
||||||
});
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsWebsite create(CmsWebsite website) {
|
|
||||||
final User loginUser = website.getLoginUser();
|
|
||||||
// 创建站点
|
|
||||||
// website.setWebsiteName("网站名称");
|
|
||||||
website.setWebsiteCode("site-".concat(loginUser.getTenantId().toString()));
|
|
||||||
// if (StrUtil.isBlank(website.getWebsiteLogo())) {
|
|
||||||
// website.setWebsiteLogo("https://oss.wsdns.cn/20240822/0252ad4ed46449cdafe12f8d3d96c2ea.svg");
|
|
||||||
// }
|
|
||||||
website.setWebsiteIcon("/favicon.ico");
|
|
||||||
website.setWebsiteType("云·企业官网");
|
|
||||||
website.setAdminUrl("site.websoft.top");
|
|
||||||
website.setVersion(10);
|
|
||||||
website.setExpirationTime(LocalDateTime.now().plusMonths(1));
|
|
||||||
website.setUserId(loginUser.getUserId());
|
|
||||||
website.setDeveloper(loginUser.getNickname());
|
|
||||||
website.setTenantId(loginUser.getTenantId());
|
|
||||||
website.setTemplateId(loginUser.getTemplateId());
|
|
||||||
website.setCompanyId(loginUser.getCompanyId());
|
|
||||||
|
|
||||||
// 初始化数据
|
|
||||||
if(save(website)){
|
|
||||||
// 插入网站设置记录
|
|
||||||
// final CmsWebsiteSetting setting = new CmsWebsiteSetting();
|
|
||||||
// setting.setWebsiteId(website.getWebsiteId());
|
|
||||||
// setting.setCreateTime(DateUtil.date());
|
|
||||||
// setting.setUpdateTime(DateUtil.date());
|
|
||||||
// cmsWebsiteSettingService.save(setting);
|
|
||||||
|
|
||||||
// 将网站创建者的userId做为查询条件 10257(4716),10324(6978),10398(26564)
|
|
||||||
Integer websiteUserId = website.getTemplateId() != null ? website.getTemplateId() : 0;
|
|
||||||
|
|
||||||
|
|
||||||
// TODO 国际化
|
|
||||||
final CmsLangLogParam cmsLangLogParam = new CmsLangLogParam();
|
|
||||||
cmsLangLogParam.setWebsiteUserId(websiteUserId);
|
|
||||||
final List<CmsLangLog> logs = cmsLangLogMapper.selectListAllRel(cmsLangLogParam);
|
|
||||||
logs.forEach(d->{
|
|
||||||
d.setTenantId(loginUser.getTenantId());
|
|
||||||
});
|
|
||||||
cmsLangLogService.saveBatch(logs);
|
|
||||||
|
|
||||||
// TODO 复制参数
|
|
||||||
final CmsWebsiteFieldParam param = new CmsWebsiteFieldParam();
|
|
||||||
param.setUserId(websiteUserId);
|
|
||||||
final List<CmsWebsiteField> fields = cmsWebsiteFieldMapper.selectListAllRel(param);
|
|
||||||
fields.forEach(d->{
|
|
||||||
d.setTenantId(loginUser.getTenantId());
|
|
||||||
});
|
|
||||||
cmsWebsiteFieldService.saveBatch(fields);
|
|
||||||
|
|
||||||
// TODO 复制模型
|
|
||||||
final CmsModelParam modelParam = new CmsModelParam();
|
|
||||||
modelParam.setWebsiteUserId(websiteUserId);
|
|
||||||
final List<CmsModel> models = cmsModelMapper.selectListAllRel(modelParam);
|
|
||||||
models.forEach(d->{
|
|
||||||
d.setUserId(loginUser.getUserId());
|
|
||||||
d.setTenantId(loginUser.getTenantId());
|
|
||||||
});
|
|
||||||
cmsModelService.saveBatch(models);
|
|
||||||
|
|
||||||
// TODO 复制广告
|
|
||||||
final CmsAdParam cmsAdParam = new CmsAdParam();
|
|
||||||
cmsAdParam.setWebsiteUserId(websiteUserId);
|
|
||||||
final List<CmsAd> ads = cmsAdMapper.selectListAllRel(cmsAdParam);
|
|
||||||
ads.forEach(d -> {
|
|
||||||
d.setUserId(loginUser.getUserId());
|
|
||||||
d.setTenantId(loginUser.getTenantId());
|
|
||||||
});
|
|
||||||
cmsAdService.saveBatch(ads);
|
|
||||||
|
|
||||||
// TODO 复制链接
|
|
||||||
CmsLinkParam cmsLinkParam = new CmsLinkParam();
|
|
||||||
cmsLinkParam.setWebsiteUserId(websiteUserId);
|
|
||||||
final List<CmsLink> links = cmsLinkMapper.selectListAllRel(cmsLinkParam);
|
|
||||||
links.forEach(d -> {
|
|
||||||
d.setUserId(loginUser.getUserId());
|
|
||||||
d.setTenantId(loginUser.getTenantId());
|
|
||||||
});
|
|
||||||
cmsLinkService.saveBatch(links);
|
|
||||||
|
|
||||||
// TODO 复制订单
|
|
||||||
// CmsOrderParam cmsOrderParam = new CmsOrderParam();
|
|
||||||
// cmsOrderParam.setWebsiteUserId(websiteUserId);
|
|
||||||
// final List<CmsOrder> orders = cmsOrderMapper.selectListAllRel(cmsOrderParam);
|
|
||||||
// orders.forEach(d -> {
|
|
||||||
// d.setUserId(loginUser.getUserId());
|
|
||||||
// d.setTenantId(loginUser.getTenantId());
|
|
||||||
// });
|
|
||||||
// cmsOrderService.saveBatch(orders);
|
|
||||||
|
|
||||||
|
|
||||||
// TODO 复制栏目和文章、文章内容
|
|
||||||
CmsNavigationParam cmsNavigationParam = new CmsNavigationParam();
|
|
||||||
cmsNavigationParam.setWebsiteUserId(websiteUserId);
|
|
||||||
cmsNavigationParam.setParentId(0);
|
|
||||||
final List<CmsNavigation> parents = cmsNavigationMapper.selectListAllRel(cmsNavigationParam);
|
|
||||||
parents.forEach(d -> {
|
|
||||||
Integer navigationId = d.getNavigationId();
|
|
||||||
// 复制顶级栏目
|
|
||||||
d.setTenantId(loginUser.getTenantId());
|
|
||||||
d.setUserId(loginUser.getUserId());
|
|
||||||
if (cmsNavigationService.save(d)) {
|
|
||||||
cmsNavigationService.saveAsync(d);
|
|
||||||
// 复制栏目文章
|
|
||||||
CmsArticleParam cmsArticleParam = new CmsArticleParam();
|
|
||||||
cmsArticleParam.setWebsiteUserId(websiteUserId);
|
|
||||||
cmsArticleParam.setCategoryId(navigationId);
|
|
||||||
final List<CmsArticle> articles = cmsArticleMapper.selectListAllRel(cmsArticleParam);
|
|
||||||
articles.forEach(a -> {
|
|
||||||
a.setCategoryId(d.getNavigationId());
|
|
||||||
a.setUserId(loginUser.getUserId());
|
|
||||||
a.setTenantId(loginUser.getTenantId());
|
|
||||||
if (cmsArticleService.save(a)) {
|
|
||||||
final CmsArticleContent content = new CmsArticleContent();
|
|
||||||
content.setArticleId(a.getArticleId());
|
|
||||||
content.setContent(a.getContent());
|
|
||||||
cmsArticleContentService.save(content);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// 复制子栏目
|
|
||||||
cmsNavigationParam.setParentId(navigationId);
|
|
||||||
final List<CmsNavigation> navigations = cmsNavigationMapper.selectListAllRel(cmsNavigationParam);
|
|
||||||
navigations.forEach(c -> {
|
|
||||||
cmsArticleParam.setCategoryId(c.getNavigationId());
|
|
||||||
c.setParentId(d.getNavigationId());
|
|
||||||
c.setTenantId(loginUser.getTenantId());
|
|
||||||
c.setUserId(loginUser.getUserId());
|
|
||||||
cmsNavigationService.save(c);
|
|
||||||
cmsNavigationService.saveAsync(c);
|
|
||||||
// 复制子栏目文章
|
|
||||||
final List<CmsArticle> articles2 = cmsArticleMapper.selectListAllRel(cmsArticleParam);
|
|
||||||
articles2.forEach(a2 -> {
|
|
||||||
a2.setCategoryId(c.getNavigationId());
|
|
||||||
a2.setParentId(c.getParentId());
|
|
||||||
a2.setUserId(loginUser.getUserId());
|
|
||||||
a2.setTenantId(loginUser.getTenantId());
|
|
||||||
if (cmsArticleService.save(a2)) {
|
|
||||||
final CmsArticleContent content = new CmsArticleContent();
|
|
||||||
content.setArticleId(a2.getArticleId());
|
|
||||||
content.setContent(a2.getContent());
|
|
||||||
cmsArticleContentService.save(content);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 新增项目
|
|
||||||
final Project project = new Project();
|
|
||||||
project.setUserId(website.getUserId());
|
|
||||||
project.setAppName(website.getWebsiteName());
|
|
||||||
project.setAppIcon(website.getWebsiteIcon());
|
|
||||||
project.setAppCode(website.getWebsiteCode());
|
|
||||||
project.setAdminUrl(website.getAdminUrl());
|
|
||||||
project.setRenewMoney(website.getPrice());
|
|
||||||
project.setWebsiteId(website.getWebsiteId());
|
|
||||||
project.setAdminUrl(website.getAdminUrl());
|
|
||||||
project.setAppType(website.getWebsiteType());
|
|
||||||
project.setAppIcon(website.getWebsiteLogo());
|
|
||||||
project.setAppUrl(website.getDomain());
|
|
||||||
project.setCompanyId(website.getUserId());
|
|
||||||
project.setTenantId(5);
|
|
||||||
projectService.save(project);
|
|
||||||
}
|
|
||||||
return website;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsWebsite getByIdRelAll(Integer id) {
|
|
||||||
return cmsWebsiteMapper.getByIdRelAll(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean updateByIdAll(CmsWebsite cmsWebsite) {
|
|
||||||
return baseMapper.updateByIdAll(cmsWebsite);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean removeByIdAll(Integer id) {
|
|
||||||
return baseMapper.removeByIdAll(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsWebsite getByTenantId(Integer tenantId) {
|
|
||||||
return baseMapper.getByTenantId(tenantId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsVO getSiteInfo(Integer tenantId) {
|
|
||||||
// 参数验证
|
|
||||||
if (ObjectUtil.isEmpty(tenantId)) {
|
|
||||||
throw new IllegalArgumentException("租户ID不能为空");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 尝试从缓存获取
|
|
||||||
String cacheKey = SITE_INFO_KEY_PREFIX + tenantId;
|
|
||||||
String siteInfo = redisUtil.get(cacheKey);
|
|
||||||
if (StrUtil.isNotBlank(siteInfo)) {
|
|
||||||
log.info("从缓存获取网站信息,租户ID: {}", tenantId);
|
|
||||||
try {
|
|
||||||
return JSONUtil.parseObject(siteInfo, CmsVO.class);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.warn("缓存解析失败,从数据库重新获取: {}", e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 从数据库获取站点信息
|
|
||||||
CmsWebsite website = getWebsiteFromDatabase(tenantId);
|
|
||||||
|
|
||||||
if (website == null) {
|
|
||||||
throw new RuntimeException("请先创建站点");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 构建完整的网站信息
|
|
||||||
buildCompleteWebsiteInfo(website);
|
|
||||||
|
|
||||||
// 处理过期时间
|
|
||||||
CmsWebsiteServiceImplHelper.processExpirationTime(website);
|
|
||||||
|
|
||||||
// 转换为VO对象
|
|
||||||
CmsVO websiteVO = CmsWebsiteServiceImplHelper.convertToVO(website);
|
|
||||||
|
|
||||||
// 缓存结果
|
|
||||||
try {
|
|
||||||
redisUtil.set(cacheKey, websiteVO, 1L, TimeUnit.DAYS);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.warn("缓存网站信息失败: {}", e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
log.info("获取网站信息成功,网站ID: {}, 租户ID: {}", website.getWebsiteId(), tenantId);
|
|
||||||
return websiteVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clearSiteInfoCache(Integer tenantId) {
|
|
||||||
if (tenantId != null) {
|
|
||||||
String cacheKey = SITE_INFO_KEY_PREFIX + tenantId;
|
|
||||||
redisUtil.delete(cacheKey);
|
|
||||||
log.info("清除网站信息缓存成功,租户ID: {}", tenantId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 从数据库获取网站信息
|
|
||||||
*/
|
|
||||||
private CmsWebsite getWebsiteFromDatabase(Integer tenantId) {
|
|
||||||
return getByTenantId(tenantId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 构建完整的网站信息
|
|
||||||
*/
|
|
||||||
private void buildCompleteWebsiteInfo(CmsWebsite website) {
|
|
||||||
// 设置网站状态
|
|
||||||
CmsWebsiteServiceImplHelper.setWebsiteStatus(website);
|
|
||||||
|
|
||||||
// 设置网站配置
|
|
||||||
CmsWebsiteServiceImplHelper.setWebsiteConfig(website);
|
|
||||||
|
|
||||||
// 设置网站导航
|
|
||||||
setWebsiteNavigation(website);
|
|
||||||
|
|
||||||
// 设置网站设置信息
|
|
||||||
CmsWebsiteServiceImplHelper.setWebsiteSetting(website);
|
|
||||||
|
|
||||||
// 设置服务器时间信息
|
|
||||||
CmsWebsiteServiceImplHelper.setServerTimeInfo(website);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置网站导航
|
|
||||||
*/
|
|
||||||
private void setWebsiteNavigation(CmsWebsite website) {
|
|
||||||
// 获取顶部导航
|
|
||||||
CmsNavigationParam navigationParam = new CmsNavigationParam();
|
|
||||||
navigationParam.setHide(0);
|
|
||||||
navigationParam.setTop(0);
|
|
||||||
navigationParam.setBottom(null);
|
|
||||||
List<CmsNavigation> topNavs = cmsNavigationService.listRel(navigationParam);
|
|
||||||
website.setTopNavs(topNavs);
|
|
||||||
|
|
||||||
// 获取底部导航
|
|
||||||
navigationParam.setTop(null);
|
|
||||||
navigationParam.setBottom(0);
|
|
||||||
List<CmsNavigation> bottomNavs = cmsNavigationService.listRel(navigationParam);
|
|
||||||
website.setBottomNavs(bottomNavs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,222 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsNavigation;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsWebsite;
|
|
||||||
import com.gxwebsoft.cms.vo.CmsNavigationVO;
|
|
||||||
import com.gxwebsoft.cms.vo.CmsVO;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.time.temporal.ChronoUnit;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* CmsWebsiteServiceImpl 辅助方法
|
|
||||||
* 包含转换和处理逻辑
|
|
||||||
*/
|
|
||||||
public class CmsWebsiteServiceImplHelper {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理过期时间,只处理真正需要的字段
|
|
||||||
*/
|
|
||||||
public static void processExpirationTime(CmsWebsite website) {
|
|
||||||
if (website.getExpirationTime() != null) {
|
|
||||||
LocalDateTime now = LocalDateTime.now();
|
|
||||||
LocalDateTime expirationTime = website.getExpirationTime();
|
|
||||||
|
|
||||||
// 计算是否即将过期(30天内过期)
|
|
||||||
LocalDateTime thirtyDaysLater = now.plusDays(30);
|
|
||||||
website.setSoon(expirationTime.isBefore(thirtyDaysLater) ? 1 : 0);
|
|
||||||
|
|
||||||
// 计算是否已过期
|
|
||||||
website.setExpired(expirationTime.isBefore(now) ? -1 : 1);
|
|
||||||
|
|
||||||
// 计算剩余天数
|
|
||||||
long daysBetween = ChronoUnit.DAYS.between(now, expirationTime);
|
|
||||||
website.setExpiredDays(daysBetween);
|
|
||||||
} else {
|
|
||||||
// 没有过期时间的默认值
|
|
||||||
website.setSoon(0);
|
|
||||||
website.setExpired(1);
|
|
||||||
website.setExpiredDays(0L);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将实体对象转换为VO对象
|
|
||||||
*/
|
|
||||||
public static CmsVO convertToVO(CmsWebsite website) {
|
|
||||||
CmsVO vo = new CmsVO();
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
||||||
|
|
||||||
// 基本信息
|
|
||||||
vo.setAppId(website.getTenantId());
|
|
||||||
vo.setAppName(website.getTenantName());
|
|
||||||
vo.setTitle(website.getWebsiteName());
|
|
||||||
vo.setKeywords(website.getKeywords());
|
|
||||||
vo.setDescription(website.getComments());
|
|
||||||
vo.setLogo(website.getWebsiteLogo());
|
|
||||||
vo.setMpQrCode(website.getWebsiteDarkLogo());
|
|
||||||
vo.setDomain(website.getDomain());
|
|
||||||
vo.setRunning(website.getRunning());
|
|
||||||
vo.setVersion(website.getVersion());
|
|
||||||
vo.setCreateTime(String.valueOf(website.getCreateTime()));
|
|
||||||
|
|
||||||
// 时间字段 - 格式化为字符串
|
|
||||||
if (website.getExpirationTime() != null) {
|
|
||||||
vo.setExpirationTime(website.getExpirationTime().format(formatter));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 过期相关信息
|
|
||||||
vo.setExpired(website.getExpired());
|
|
||||||
vo.setExpiredDays(website.getExpiredDays());
|
|
||||||
vo.setSoon(website.getSoon());
|
|
||||||
|
|
||||||
// 状态信息
|
|
||||||
vo.setStatusIcon(website.getStatusIcon());
|
|
||||||
vo.setStatusText(website.getStatusText());
|
|
||||||
|
|
||||||
// 复杂对象
|
|
||||||
vo.setConfig(website.getConfig());
|
|
||||||
vo.setServerTime(website.getServerTime());
|
|
||||||
vo.setSetting(website.getSetting()); // CmsWebsiteSetting对象可以直接设置给Object类型
|
|
||||||
|
|
||||||
// 导航信息
|
|
||||||
vo.setTopNavs(convertNavigationToVO(website.getTopNavs()));
|
|
||||||
vo.setBottomNavs(convertNavigationToVO(website.getBottomNavs()));
|
|
||||||
|
|
||||||
return vo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 安全转换 target 字段为整数
|
|
||||||
*
|
|
||||||
* @param target 字符串类型的 target 值
|
|
||||||
* @return 对应的整数值
|
|
||||||
*/
|
|
||||||
private static Integer convertTargetToInteger(String target) {
|
|
||||||
if (target == null) {
|
|
||||||
return 0; // 默认值:当前窗口
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (target.toLowerCase()) {
|
|
||||||
case "_self":
|
|
||||||
return 0; // 当前窗口
|
|
||||||
case "_blank":
|
|
||||||
return 1; // 新窗口
|
|
||||||
default:
|
|
||||||
// 如果是数字字符串,尝试直接转换
|
|
||||||
try {
|
|
||||||
return Integer.valueOf(target);
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
// 转换失败时返回默认值
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 转换导航列表为VO
|
|
||||||
*/
|
|
||||||
public static List<CmsNavigationVO> convertNavigationToVO(List<CmsNavigation> navigations) {
|
|
||||||
if (navigations == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return navigations.stream().map(nav -> {
|
|
||||||
CmsNavigationVO navVO = new CmsNavigationVO();
|
|
||||||
navVO.setNavigationId(nav.getNavigationId());
|
|
||||||
navVO.setNavigationName(nav.getTitle()); // 修复:使用 title 字段
|
|
||||||
navVO.setNavigationUrl(nav.getPath()); // 修复:使用 path 字段
|
|
||||||
navVO.setNavigationIcon(nav.getIcon()); // 修复:使用 icon 字段
|
|
||||||
navVO.setNavigationColor(nav.getColor()); // 修复:使用 color 字段
|
|
||||||
navVO.setParentId(nav.getParentId());
|
|
||||||
navVO.setSort(nav.getSortNumber()); // 修复:使用 sortNumber 字段
|
|
||||||
navVO.setHide(nav.getHide());
|
|
||||||
navVO.setTop(nav.getTop());
|
|
||||||
// 安全转换 target 字段:将字符串值映射为整数
|
|
||||||
navVO.setTarget(convertTargetToInteger(nav.getTarget()));
|
|
||||||
navVO.setNavigationType(nav.getModel()); // 修复:使用 model 字段
|
|
||||||
|
|
||||||
// 递归处理子导航
|
|
||||||
if (nav.getChildren() != null) {
|
|
||||||
navVO.setChildren(convertNavigationToVO(nav.getChildren()));
|
|
||||||
}
|
|
||||||
|
|
||||||
return navVO;
|
|
||||||
}).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置网站状态
|
|
||||||
*/
|
|
||||||
public static void setWebsiteStatus(CmsWebsite website) {
|
|
||||||
if (website.getRunning() != null) {
|
|
||||||
switch (website.getRunning()) {
|
|
||||||
case 0:
|
|
||||||
website.setStatusIcon("🔴");
|
|
||||||
website.setStatusText("未开通");
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
website.setStatusIcon("🟢");
|
|
||||||
website.setStatusText("正常运行");
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
website.setStatusIcon("🟡");
|
|
||||||
website.setStatusText("维护中");
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
website.setStatusIcon("🔴");
|
|
||||||
website.setStatusText("违规关停");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
website.setStatusIcon("❓");
|
|
||||||
website.setStatusText("未知状态");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置网站配置
|
|
||||||
*/
|
|
||||||
public static void setWebsiteConfig(CmsWebsite website) {
|
|
||||||
HashMap<String, Object> config = new HashMap<>();
|
|
||||||
config.put("websiteName", website.getWebsiteName());
|
|
||||||
config.put("websiteComments", website.getComments());
|
|
||||||
config.put("websiteTitle", website.getWebsiteName());
|
|
||||||
config.put("websiteKeywords", website.getKeywords());
|
|
||||||
config.put("websiteDescription", website.getContent()); // 使用 content 字段作为描述
|
|
||||||
config.put("websiteLogo", website.getWebsiteLogo());
|
|
||||||
config.put("websiteIcon", website.getWebsiteIcon());
|
|
||||||
config.put("domain", website.getDomain());
|
|
||||||
website.setConfig(config);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置服务器时间信息
|
|
||||||
*/
|
|
||||||
public static void setServerTimeInfo(CmsWebsite website) {
|
|
||||||
HashMap<String, Object> serverTime = new HashMap<>();
|
|
||||||
LocalDateTime now = LocalDateTime.now();
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
||||||
|
|
||||||
serverTime.put("currentTime", now.format(formatter));
|
|
||||||
serverTime.put("timestamp", System.currentTimeMillis());
|
|
||||||
serverTime.put("timezone", "Asia/Shanghai");
|
|
||||||
|
|
||||||
website.setServerTime(serverTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置网站设置信息
|
|
||||||
*/
|
|
||||||
public static void setWebsiteSetting(CmsWebsite website) {
|
|
||||||
// 这里可以根据需要设置网站的其他设置信息
|
|
||||||
// 暂时设置为null,因为setting字段类型是CmsWebsiteSetting而不是HashMap
|
|
||||||
website.setSetting(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package cms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.cms.mapper.CmsWebsiteSettingMapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsWebsiteSettingService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsWebsiteSetting;
|
|
||||||
import com.gxwebsoft.cms.param.CmsWebsiteSettingParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站设置Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-02-19 01:35:44
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CmsWebsiteSettingServiceImpl extends ServiceImpl<CmsWebsiteSettingMapper, CmsWebsiteSetting> implements CmsWebsiteSettingService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<CmsWebsiteSetting> pageRel(CmsWebsiteSettingParam param) {
|
|
||||||
PageParam<CmsWebsiteSetting, CmsWebsiteSettingParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
List<CmsWebsiteSetting> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CmsWebsiteSetting> listRel(CmsWebsiteSettingParam param) {
|
|
||||||
List<CmsWebsiteSetting> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<CmsWebsiteSetting, CmsWebsiteSettingParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CmsWebsiteSetting getByIdRel(Integer id) {
|
|
||||||
CmsWebsiteSettingParam param = new CmsWebsiteSettingParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user