refactor: 删除 docs 模块的全部代码
- 移除了 DocsContentController、DocsController、DocsUserController 三个控制器 - 删除了 DocsContent、Docs、DocsUser三个实体类 - 移除了 DocsContentMapper、DocsMapper、DocsUserMapper 三个 Mapper 接口 - 删除了 DocsContentParam、DocsParam、DocsUserParam 三个查询参数类 - 移除了 DocsContentServiceImpl 服务实现类- 删除了相关的 XML 映射文件
This commit is contained in:
@@ -1,129 +0,0 @@
|
||||
package com.gxwebsoft.docs.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.docs.service.DocsContentService;
|
||||
import com.gxwebsoft.docs.entity.DocsContent;
|
||||
import com.gxwebsoft.docs.param.DocsContentParam;
|
||||
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-03-26 09:29:15
|
||||
*/
|
||||
@Tag(name = "文档内容记录表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/docs/docs-content")
|
||||
public class DocsContentController extends BaseController {
|
||||
@Resource
|
||||
private DocsContentService docsContentService;
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docsContent:list')")
|
||||
@Operation(summary = "分页查询文档内容记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<DocsContent>> page(DocsContentParam param) {
|
||||
// 使用关联查询
|
||||
return success(docsContentService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docsContent:list')")
|
||||
@Operation(summary = "查询全部文档内容记录表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<DocsContent>> list(DocsContentParam param) {
|
||||
// 使用关联查询
|
||||
return success(docsContentService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docsContent:list')")
|
||||
@Operation(summary = "根据id查询文档内容记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<DocsContent> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(docsContentService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docsContent:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加文档内容记录表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody DocsContent docsContent) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
docsContent.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (docsContentService.save(docsContent)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docsContent:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改文档内容记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody DocsContent docsContent) {
|
||||
if (docsContentService.updateById(docsContent)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docsContent:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除文档内容记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (docsContentService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docsContent:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加文档内容记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<DocsContent> list) {
|
||||
if (docsContentService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docsContent:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改文档内容记录表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<DocsContent> batchParam) {
|
||||
if (batchParam.update(docsContentService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docsContent:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除文档内容记录表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (docsContentService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
package com.gxwebsoft.docs.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.docs.service.DocsService;
|
||||
import com.gxwebsoft.docs.entity.Docs;
|
||||
import com.gxwebsoft.docs.param.DocsParam;
|
||||
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-03-26 09:29:15
|
||||
*/
|
||||
@Tag(name = "知识库管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/docs/docs")
|
||||
public class DocsController extends BaseController {
|
||||
@Resource
|
||||
private DocsService docsService;
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docs:list')")
|
||||
@Operation(summary = "分页查询知识库")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Docs>> page(DocsParam param) {
|
||||
// 使用关联查询
|
||||
return success(docsService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docs:list')")
|
||||
@Operation(summary = "查询全部知识库")
|
||||
@GetMapping()
|
||||
public ApiResult<List<Docs>> list(DocsParam param) {
|
||||
// 使用关联查询
|
||||
return success(docsService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docs:list')")
|
||||
@Operation(summary = "根据id查询知识库")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<Docs> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(docsService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docs:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加知识库")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Docs docs) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
docs.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (docsService.save(docs)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docs:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改知识库")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Docs docs) {
|
||||
if (docsService.updateById(docs)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docs:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除知识库")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (docsService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docs:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加知识库")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Docs> list) {
|
||||
if (docsService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docs:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改知识库")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Docs> batchParam) {
|
||||
if (batchParam.update(docsService, "book_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docs:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除知识库")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (docsService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
package com.gxwebsoft.docs.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.docs.service.DocsUserService;
|
||||
import com.gxwebsoft.docs.entity.DocsUser;
|
||||
import com.gxwebsoft.docs.param.DocsUserParam;
|
||||
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-03-26 09:29:15
|
||||
*/
|
||||
@Tag(name = "知识库成员管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/docs/docs-user")
|
||||
public class DocsUserController extends BaseController {
|
||||
@Resource
|
||||
private DocsUserService docsUserService;
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docsUser:list')")
|
||||
@Operation(summary = "分页查询知识库成员")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<DocsUser>> page(DocsUserParam param) {
|
||||
// 使用关联查询
|
||||
return success(docsUserService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docsUser:list')")
|
||||
@Operation(summary = "查询全部知识库成员")
|
||||
@GetMapping()
|
||||
public ApiResult<List<DocsUser>> list(DocsUserParam param) {
|
||||
// 使用关联查询
|
||||
return success(docsUserService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docsUser:list')")
|
||||
@Operation(summary = "根据id查询知识库成员")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<DocsUser> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(docsUserService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docsUser:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加知识库成员")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody DocsUser docsUser) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
docsUser.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (docsUserService.save(docsUser)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docsUser:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改知识库成员")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody DocsUser docsUser) {
|
||||
if (docsUserService.updateById(docsUser)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docsUser:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除知识库成员")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (docsUserService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docsUser:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加知识库成员")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<DocsUser> list) {
|
||||
if (docsUserService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docsUser:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改知识库成员")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<DocsUser> batchParam) {
|
||||
if (batchParam.update(docsUserService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('docs:docsUser:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除知识库成员")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (docsUserService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package com.gxwebsoft.docs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 知识库
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-26 09:29:15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "Docs对象", description = "知识库")
|
||||
public class Docs implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "book_id", type = IdType.AUTO)
|
||||
private Integer bookId;
|
||||
|
||||
@Schema(description = "知识库名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "知识库标识")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "封面图")
|
||||
private String photo;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "用户昵称")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "用户头像")
|
||||
@TableField(exist = false)
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "文档内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package com.gxwebsoft.docs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 文档内容记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-26 09:29:15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "DocsContent对象", description = "文档内容记录表")
|
||||
public class DocsContent implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "文档ID")
|
||||
private Integer docsId;
|
||||
|
||||
@Schema(description = "文档标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "文档内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
package com.gxwebsoft.docs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 知识库成员
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-26 09:29:15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "DocsUser对象", description = "知识库成员")
|
||||
public class DocsUser implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "自增ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "应用ID")
|
||||
private Integer docsId;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "角色,10体验成员 20开发者成员 30管理员 ")
|
||||
private Integer role;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1待确认")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.gxwebsoft.docs.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.docs.entity.DocsContent;
|
||||
import com.gxwebsoft.docs.param.DocsContentParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文档内容记录表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-26 09:29:15
|
||||
*/
|
||||
public interface DocsContentMapper extends BaseMapper<DocsContent> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<DocsContent>
|
||||
*/
|
||||
List<DocsContent> selectPageRel(@Param("page") IPage<DocsContent> page,
|
||||
@Param("param") DocsContentParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<DocsContent> selectListRel(@Param("param") DocsContentParam param);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.gxwebsoft.docs.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.docs.entity.Docs;
|
||||
import com.gxwebsoft.docs.param.DocsParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 知识库Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-26 09:29:15
|
||||
*/
|
||||
public interface DocsMapper extends BaseMapper<Docs> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<Docs>
|
||||
*/
|
||||
List<Docs> selectPageRel(@Param("page") IPage<Docs> page,
|
||||
@Param("param") DocsParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<Docs> selectListRel(@Param("param") DocsParam param);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.gxwebsoft.docs.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.docs.entity.DocsUser;
|
||||
import com.gxwebsoft.docs.param.DocsUserParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 知识库成员Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-26 09:29:15
|
||||
*/
|
||||
public interface DocsUserMapper extends BaseMapper<DocsUser> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<DocsUser>
|
||||
*/
|
||||
List<DocsUser> selectPageRel(@Param("page") IPage<DocsUser> page,
|
||||
@Param("param") DocsUserParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<DocsUser> selectListRel(@Param("param") DocsUserParam param);
|
||||
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.docs.mapper.DocsContentMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM docs_content a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.docsId != null">
|
||||
AND a.docs_id = #{param.docsId}
|
||||
</if>
|
||||
<if test="param.title != null">
|
||||
AND a.title LIKE CONCAT('%', #{param.title}, '%')
|
||||
</if>
|
||||
<if test="param.content != null">
|
||||
AND a.content LIKE CONCAT('%', #{param.content}, '%')
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.docs.entity.DocsContent">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.docs.entity.DocsContent">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,67 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.docs.mapper.DocsMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*, b.nickname, b.avatar
|
||||
FROM docs a
|
||||
LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id
|
||||
<where>
|
||||
<if test="param.bookId != null">
|
||||
AND a.book_id = #{param.bookId}
|
||||
</if>
|
||||
<if test="param.name != null">
|
||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||
</if>
|
||||
<if test="param.code != null">
|
||||
AND a.code LIKE CONCAT('%', #{param.code}, '%')
|
||||
</if>
|
||||
<if test="param.photo != null">
|
||||
AND a.photo LIKE CONCAT('%', #{param.photo}, '%')
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.content != null">
|
||||
AND a.content LIKE CONCAT('%', #{param.content}, '%')
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.docs.entity.Docs">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.docs.entity.Docs">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,54 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.docs.mapper.DocsUserMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM docs_user a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.docsId != null">
|
||||
AND a.docs_id = #{param.docsId}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.nickname != null">
|
||||
AND a.nickname LIKE CONCAT('%', #{param.nickname}, '%')
|
||||
</if>
|
||||
<if test="param.avatar != null">
|
||||
AND a.avatar LIKE CONCAT('%', #{param.avatar}, '%')
|
||||
</if>
|
||||
<if test="param.role != null">
|
||||
AND a.role = #{param.role}
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.docs.entity.DocsUser">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.docs.entity.DocsUser">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.gxwebsoft.docs.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 文档内容记录表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-26 09:29:15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "DocsContentParam对象", description = "文档内容记录表查询参数")
|
||||
public class DocsContentParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "文档ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer docsId;
|
||||
|
||||
@Schema(description = "文档标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "文档内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.gxwebsoft.docs.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 知识库查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-26 09:29:15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "DocsParam对象", description = "知识库查询参数")
|
||||
public class DocsParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer bookId;
|
||||
|
||||
@Schema(description = "知识库名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "知识库标识")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "封面图")
|
||||
private String photo;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "文档内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer deleted;
|
||||
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package com.gxwebsoft.docs.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 知识库成员查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-26 09:29:15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "DocsUserParam对象", description = "知识库成员查询参数")
|
||||
public class DocsUserParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "自增ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "应用ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer docsId;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "角色,10体验成员 20开发者成员 30管理员 ")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer role;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1待确认")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.gxwebsoft.docs.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.docs.entity.DocsContent;
|
||||
import com.gxwebsoft.docs.param.DocsContentParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文档内容记录表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-26 09:29:15
|
||||
*/
|
||||
public interface DocsContentService extends IService<DocsContent> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<DocsContent>
|
||||
*/
|
||||
PageResult<DocsContent> pageRel(DocsContentParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<DocsContent>
|
||||
*/
|
||||
List<DocsContent> listRel(DocsContentParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return DocsContent
|
||||
*/
|
||||
DocsContent getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.gxwebsoft.docs.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.docs.entity.Docs;
|
||||
import com.gxwebsoft.docs.param.DocsParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 知识库Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-26 09:29:15
|
||||
*/
|
||||
public interface DocsService extends IService<Docs> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<Docs>
|
||||
*/
|
||||
PageResult<Docs> pageRel(DocsParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<Docs>
|
||||
*/
|
||||
List<Docs> listRel(DocsParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param bookId ID
|
||||
* @return Docs
|
||||
*/
|
||||
Docs getByIdRel(Integer bookId);
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.gxwebsoft.docs.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.docs.entity.DocsUser;
|
||||
import com.gxwebsoft.docs.param.DocsUserParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 知识库成员Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-26 09:29:15
|
||||
*/
|
||||
public interface DocsUserService extends IService<DocsUser> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<DocsUser>
|
||||
*/
|
||||
PageResult<DocsUser> pageRel(DocsUserParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<DocsUser>
|
||||
*/
|
||||
List<DocsUser> listRel(DocsUserParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 自增ID
|
||||
* @return DocsUser
|
||||
*/
|
||||
DocsUser getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.gxwebsoft.docs.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.docs.mapper.DocsContentMapper;
|
||||
import com.gxwebsoft.docs.service.DocsContentService;
|
||||
import com.gxwebsoft.docs.entity.DocsContent;
|
||||
import com.gxwebsoft.docs.param.DocsContentParam;
|
||||
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-03-26 09:29:15
|
||||
*/
|
||||
@Service
|
||||
public class DocsContentServiceImpl extends ServiceImpl<DocsContentMapper, DocsContent> implements DocsContentService {
|
||||
|
||||
@Override
|
||||
public PageResult<DocsContent> pageRel(DocsContentParam param) {
|
||||
PageParam<DocsContent, DocsContentParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<DocsContent> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DocsContent> listRel(DocsContentParam param) {
|
||||
List<DocsContent> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<DocsContent, DocsContentParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocsContent getByIdRel(Integer id) {
|
||||
DocsContentParam param = new DocsContentParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.gxwebsoft.docs.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.docs.mapper.DocsMapper;
|
||||
import com.gxwebsoft.docs.service.DocsService;
|
||||
import com.gxwebsoft.docs.entity.Docs;
|
||||
import com.gxwebsoft.docs.param.DocsParam;
|
||||
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-03-26 09:29:15
|
||||
*/
|
||||
@Service
|
||||
public class DocsServiceImpl extends ServiceImpl<DocsMapper, Docs> implements DocsService {
|
||||
|
||||
@Override
|
||||
public PageResult<Docs> pageRel(DocsParam param) {
|
||||
PageParam<Docs, DocsParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<Docs> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Docs> listRel(DocsParam param) {
|
||||
List<Docs> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<Docs, DocsParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Docs getByIdRel(Integer bookId) {
|
||||
DocsParam param = new DocsParam();
|
||||
param.setBookId(bookId);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.gxwebsoft.docs.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.docs.mapper.DocsUserMapper;
|
||||
import com.gxwebsoft.docs.service.DocsUserService;
|
||||
import com.gxwebsoft.docs.entity.DocsUser;
|
||||
import com.gxwebsoft.docs.param.DocsUserParam;
|
||||
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-03-26 09:29:15
|
||||
*/
|
||||
@Service
|
||||
public class DocsUserServiceImpl extends ServiceImpl<DocsUserMapper, DocsUser> implements DocsUserService {
|
||||
|
||||
@Override
|
||||
public PageResult<DocsUser> pageRel(DocsUserParam param) {
|
||||
PageParam<DocsUser, DocsUserParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<DocsUser> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DocsUser> listRel(DocsUserParam param) {
|
||||
List<DocsUser> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<DocsUser, DocsUserParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocsUser getByIdRel(Integer id) {
|
||||
DocsUserParam param = new DocsUserParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
* 商品文章控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-13 03:38:52
|
||||
* @since 2025-08-13 04:38:36
|
||||
*/
|
||||
@Tag(name = "商品文章管理")
|
||||
@RestController
|
||||
|
||||
@@ -14,7 +14,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 商品文章
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-13 03:38:51
|
||||
* @since 2025-08-13 04:38:36
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@@ -25,7 +25,7 @@ public class ShopMerchant implements Serializable {
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "merchant_id", type = IdType.AUTO)
|
||||
private Integer merchantId;
|
||||
private Long merchantId;
|
||||
|
||||
@Schema(description = "商户名称")
|
||||
private String merchantName;
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
* 商品文章Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-13 03:38:52
|
||||
* @since 2025-08-13 04:38:36
|
||||
*/
|
||||
public interface ShopArticleMapper extends BaseMapper<ShopArticle> {
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 商品文章查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-13 03:38:51
|
||||
* @since 2025-08-13 04:38:35
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
* 商品文章Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-13 03:38:52
|
||||
* @since 2025-08-13 04:38:36
|
||||
*/
|
||||
public interface ShopArticleService extends IService<ShopArticle> {
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
* 商品文章Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-13 03:38:52
|
||||
* @since 2025-08-13 04:38:36
|
||||
*/
|
||||
@Service
|
||||
public class ShopArticleServiceImpl extends ServiceImpl<ShopArticleMapper, ShopArticle> implements ShopArticleService {
|
||||
|
||||
Reference in New Issue
Block a user