Compare commits

..

No commits in common. "96c68ed48557174320b6feab30413f69accbe1af" and "7ded966355e59547aee4f55f27b8280911942cce" have entirely different histories.

7 changed files with 19 additions and 145 deletions

View File

@ -107,6 +107,12 @@
<artifactId>mcwl-pay</artifactId> <artifactId>mcwl-pay</artifactId>
<version>3.8.8</version> <version>3.8.8</version>
</dependency> </dependency>
<!-- 资源中心模块-->
<dependency>
<groupId>com.mcwl</groupId>
<artifactId>mcwl-resource</artifactId>
<version>3.8.8</version>
</dependency>
<!-- 代码生成--> <!-- 代码生成-->
<dependency> <dependency>
<groupId>com.mcwl</groupId> <groupId>com.mcwl</groupId>

View File

@ -17,14 +17,11 @@ import com.mcwl.system.service.ISysEmailService;
import com.mcwl.system.service.ISysToolService; import com.mcwl.system.service.ISysToolService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@ -45,25 +42,12 @@ public class SysToolController {
*/ */
@GetMapping("listTool") @GetMapping("listTool")
@ApiOperation(value = "查询工具列表") @ApiOperation(value = "查询工具列表")
public R<List<ToolVo>> listTool(@ApiParam(value = "工具类型") @RequestParam(required = false) Integer type) { public R<List<ToolVo>> listTool() {
List<SysTool> sysToolList = sysToolService.list(new LambdaQueryWrapper<SysTool>() List<SysTool> sysToolList = sysToolService.list(new LambdaQueryWrapper<SysTool>()
.eq(type != null, SysTool::getType, type)
.orderByDesc(SysTool::getStatus) .orderByDesc(SysTool::getStatus)
.orderByDesc(SysTool::getCreateTime)); .orderByDesc(SysTool::getCreateTime));
List<ToolVo> toolVoList = new ArrayList<>();
for (SysTool sysTool : sysToolList) {
ToolVo toolVo = BeanUtil.toBean(sysTool, ToolVo.class);
if (sysTool.getType() == 0) {
toolVo.setTypeName("文本");
} else if (sysTool.getType() == 1) {
toolVo.setTypeName("图片");
} else if (sysTool.getType() == 2) {
toolVo.setTypeName("视频");
}
toolVoList.add(toolVo);
}
return R.ok(toolVoList); return R.ok(BeanUtil.copyToList(sysToolList, ToolVo.class));
} }
/** /**
@ -73,15 +57,7 @@ public class SysToolController {
@ApiOperation(value = "按id查询工具") @ApiOperation(value = "按id查询工具")
public R<ToolVo> getTool(@Valid @NotNull(message = "工具id不能为空") Long toolId) { public R<ToolVo> getTool(@Valid @NotNull(message = "工具id不能为空") Long toolId) {
SysTool sysTool = sysToolService.getById(toolId); SysTool sysTool = sysToolService.getById(toolId);
ToolVo toolVo = BeanUtil.toBean(sysTool, ToolVo.class); return R.ok(BeanUtil.toBean(sysTool, ToolVo.class));
if (sysTool.getType() == 0) {
toolVo.setTypeName("文本");
} else if (sysTool.getType() == 1) {
toolVo.setTypeName("图片");
} else if (sysTool.getType() == 2) {
toolVo.setTypeName("视频");
}
return R.ok(toolVo);
} }
@PostMapping("addTool") @PostMapping("addTool")
@ -89,7 +65,7 @@ public class SysToolController {
public R<String> addTool(@Valid @RequestBody AddToolRes addToolRes) { public R<String> addTool(@Valid @RequestBody AddToolRes addToolRes) {
SysTool sysTool = BeanUtil.toBean(addToolRes, SysTool.class); SysTool sysTool = BeanUtil.toBean(addToolRes, SysTool.class);
return sysToolService.save(sysTool) ? R.ok(null, "添加成功") : R.fail(null, "添加失败"); return sysToolService.save(sysTool) ? R.ok(null,"添加成功") : R.fail(null,"添加失败");
} }
/** /**
@ -99,7 +75,7 @@ public class SysToolController {
@ApiOperation(value = "编辑工具") @ApiOperation(value = "编辑工具")
public R<String> editTool(@Valid @RequestBody EditToolRes editToolRes) { public R<String> editTool(@Valid @RequestBody EditToolRes editToolRes) {
SysTool sysTool = BeanUtil.toBean(editToolRes, SysTool.class); SysTool sysTool = BeanUtil.toBean(editToolRes, SysTool.class);
return sysToolService.updateById(sysTool) ? R.ok(null, "编辑成功") : R.fail(null, "编辑失败"); return sysToolService.updateById(sysTool) ? R.ok(null,"编辑成功") : R.fail(null,"编辑失败");
} }
/** /**
@ -108,7 +84,7 @@ public class SysToolController {
@GetMapping("delTool") @GetMapping("delTool")
@ApiOperation(value = "删除工具") @ApiOperation(value = "删除工具")
public R<String> delTool(@Valid @NotNull(message = "工具id不能为空") Long toolId) { public R<String> delTool(@Valid @NotNull(message = "工具id不能为空") Long toolId) {
return sysToolService.removeById(toolId) ? R.ok(null, "删除成功") : R.fail(null, "删除失败"); return sysToolService.removeById(toolId) ? R.ok(null,"删除成功") : R.fail(null,"删除失败");
} }

View File

@ -23,6 +23,10 @@ public class CustomTenantHandler implements TenantLineHandler {
static { static {
// 通知表 // 通知表
tables.add("cc_advice"); tables.add("cc_advice");
// 发布评论表
tables.add("cc_comment");
// 评论点赞表
tables.add("cc_comment_like");
// 社区表 // 社区表
tables.add("cc_community"); tables.add("cc_community");
// 社区文件表 // 社区文件表
@ -39,20 +43,12 @@ public class CustomTenantHandler implements TenantLineHandler {
tables.add("cc_publish"); tables.add("cc_publish");
// 收藏表 // 收藏表
tables.add("cc_publish_collect"); tables.add("cc_publish_collect");
// 发布评论表
tables.add("cc_publish_comment");
// 评论点赞表
tables.add("cc_publish_comment_like");
// 发布标签
tables.add("cc_publish_label");
// 发布点赞表 // 发布点赞表
tables.add("cc_publish_like"); tables.add("cc_publish_like");
// 提问表 // 提问表
tables.add("cc_question"); tables.add("cc_question");
// 提问评论表 // 提问评论表
tables.add("cc_question_comment"); tables.add("cc_question_comment");
// 发布举报
tables.add("cc_report");

View File

@ -18,29 +18,17 @@ import lombok.*;
@NoArgsConstructor @NoArgsConstructor
public class SysTool extends BaseEntity { public class SysTool extends BaseEntity {
/**
* id
*/
@TableId @TableId
private Long id; private Long id;
/**
*
*/
private String name;
/** /**
* url * url
*/ */
private String imageUrl; private String imageUrl;
/**
* url
*/
private String toolUrl;
/**
* 0 1 2
*/
private Integer type;
/** /**
* 0 1 * 0 1
*/ */

View File

@ -8,7 +8,6 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern; import javax.validation.constraints.Pattern;
@Data @Data
@ -18,13 +17,6 @@ import javax.validation.constraints.Pattern;
@ApiModel(value = "新增工具请求对象") @ApiModel(value = "新增工具请求对象")
public class AddToolRes { public class AddToolRes {
/**
*
*/
@ApiModelProperty(value = "工具名称", required = true)
@NotBlank(message = "工具名称不能为空")
private String name;
/** /**
* url * url
*/ */
@ -32,29 +24,4 @@ public class AddToolRes {
@NotBlank(message = "图片url不能为空") @NotBlank(message = "图片url不能为空")
private String imageUrl; private String imageUrl;
/**
* url
*/
@ApiModelProperty(value = "工具url", required = true)
@NotBlank(message = "工具url不能为空")
private String toolUrl;
/**
* 0 1 2
*/
@ApiModelProperty(value = "类型 0文本 1图片 2视频", required = true)
@NotNull(message = "类型不能为空")
private Integer type;
/**
* 0 1
*/
@ApiModelProperty(value = "状态 0不可用 1可用")
private Integer status = 1;
/**
*
*/
@ApiModelProperty(value = "备注")
private String remark;
} }

View File

@ -24,14 +24,6 @@ public class EditToolRes {
@NotNull(message = "工具id不能为空") @NotNull(message = "工具id不能为空")
private Long id; private Long id;
/**
*
*/
@ApiModelProperty(value = "工具名称", required = true)
@NotBlank(message = "工具名称不能为空")
private String name;
/** /**
* url * url
*/ */
@ -39,20 +31,6 @@ public class EditToolRes {
@NotBlank(message = "图片url不能为空") @NotBlank(message = "图片url不能为空")
private String imageUrl; private String imageUrl;
/**
* url
*/
@ApiModelProperty(value = "工具url", required = true)
@NotBlank(message = "工具url不能为空")
private String toolUrl;
/**
* 0 1 2
*/
@ApiModelProperty(value = "类型 0文本 1图片 2视频", required = true)
@NotNull(message = "类型不能为空")
private Integer type;
/** /**
* *
*/ */
@ -60,10 +38,4 @@ public class EditToolRes {
@NotNull(message = "状态不能为空") @NotNull(message = "状态不能为空")
private Integer status; private Integer status;
/**
*
*/
@ApiModelProperty(value = "备注")
private String remark;
} }

View File

@ -24,36 +24,12 @@ public class ToolVo {
@ApiModelProperty(value = "工具id") @ApiModelProperty(value = "工具id")
private Long id; private Long id;
/**
*
*/
@ApiModelProperty(value = "工具名称")
private String name;
/** /**
* url * url
*/ */
@ApiModelProperty(value = "图片url") @ApiModelProperty(value = "图片url")
private String imageUrl; private String imageUrl;
/**
* url
*/
@ApiModelProperty(value = "工具url")
private String toolUrl;
/**
* 0 1 2
*/
@ApiModelProperty(value = "类型 0文本 1图片 2视频")
private Integer type;
/**
*
*/
@ApiModelProperty(value = "类型名称")
private String typeName;
/** /**
* 0 1 * 0 1
*/ */
@ -67,11 +43,4 @@ public class ToolVo {
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date createTime; private Date createTime;
/**
*
*/
@ApiModelProperty(value = "备注")
private String remark;
} }