|
@@ -9,13 +9,7 @@ import javax.validation.Valid;
|
|
|
|
|
|
import com.free.annotation.PassToken;
|
|
import com.free.annotation.PassToken;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -111,7 +105,7 @@ public class ChatRecordController {
|
|
Long skip = null, limit = null;
|
|
Long skip = null, limit = null;
|
|
Map map = new HashMap();
|
|
Map map = new HashMap();
|
|
QueryWrapper qw = new QueryWrapper<>();
|
|
QueryWrapper qw = new QueryWrapper<>();
|
|
- qw.orderByAsc("time");
|
|
|
|
|
|
+ qw.orderByDesc("time");
|
|
/** 参数处理处理 */
|
|
/** 参数处理处理 */
|
|
for (String key : allParams.keySet()) {
|
|
for (String key : allParams.keySet()) {
|
|
Object value = allParams.get(key);
|
|
Object value = allParams.get(key);
|
|
@@ -152,4 +146,17 @@ public class ChatRecordController {
|
|
return ResponseFormat.success(newData);
|
|
return ResponseFormat.success(newData);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /** 根据id删除数据 , 无删除 */
|
|
|
|
+ @ApiOperation("删除数据")
|
|
|
|
+ @DeleteMapping("/{id}")
|
|
|
|
+ public Object delete(@PathVariable String id) {
|
|
|
|
+ QueryWrapper qw = new QueryWrapper<>();
|
|
|
|
+ qw.eq("id", id);
|
|
|
|
+ Long num = service.count(qw);
|
|
|
|
+ if (num <= 0) {
|
|
|
|
+ throw new CustomizationException(ExceptionEnum.NOT_FOUND);
|
|
|
|
+ }
|
|
|
|
+ service.removeById(id);
|
|
|
|
+ return ResponseFormat.success();
|
|
|
|
+ }
|
|
}
|
|
}
|