|
|
|
@ -29,6 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import javax.validation.constraints.Max;
|
|
|
|
|
import javax.validation.constraints.Min;
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
import javax.validation.constraints.Size;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -50,6 +51,7 @@ public class TopicActivityController {
|
|
|
|
|
static class AddTopicParam {
|
|
|
|
|
@Schema(title = "标题")
|
|
|
|
|
@NotNull(message = "title不能为空")
|
|
|
|
|
@Size(max=64,min = 1,message = "标题长度在不超过64")
|
|
|
|
|
private String title;
|
|
|
|
|
@Schema(title = "副标题")
|
|
|
|
|
private String subtitle;
|
|
|
|
@ -113,6 +115,7 @@ public class TopicActivityController {
|
|
|
|
|
@Schema(title = "动态id")
|
|
|
|
|
private Integer id;
|
|
|
|
|
@Schema(title = "标题")
|
|
|
|
|
@Size(max=64,min = 1,message = "标题长度在不超过64")
|
|
|
|
|
private String title;
|
|
|
|
|
@Schema(title = "副标题")
|
|
|
|
|
private String subtitle;
|
|
|
|
@ -159,6 +162,7 @@ public class TopicActivityController {
|
|
|
|
|
public Result list(@Validated @RequestBody ListTopicParam param) {
|
|
|
|
|
QueryWrapper<TopicActivity> qw = new QueryWrapper<>();
|
|
|
|
|
qw.like(param.getKeyword() != null, "title", param.getKeyword());
|
|
|
|
|
qw.orderByDesc("showAtIndex");
|
|
|
|
|
qw.orderByAsc("sortWeight");
|
|
|
|
|
qw.orderByDesc("updateAt", "creatAt");
|
|
|
|
|
if (param.getShowAtIndex() != null && param.getShowAtIndex() == true) {
|
|
|
|
|