|
@@ -8,6 +8,7 @@ import com.usky.common.log.enums.BusinessType;
|
|
|
import com.usky.system.domain.MceReceive;
|
|
|
import com.usky.system.service.MceReceiveService;
|
|
|
import io.swagger.models.auth.In;
|
|
|
+import org.apache.ibatis.annotations.Param;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -45,11 +46,10 @@ public class MceReceiveController {
|
|
|
@RequestParam(value = "infoType", required = false) String infoType,
|
|
|
@RequestParam(value = "startTime", required = false) String startTime,
|
|
|
@RequestParam(value = "endTime", required = false) String endTime,
|
|
|
- @RequestParam(value = "id",required = false) Integer id,
|
|
|
+ @RequestParam(value = "id", required = false) Integer id,
|
|
|
@RequestParam(value = "current", required = false, defaultValue = "1") Integer current,
|
|
|
- @RequestParam(value = "size", required = false, defaultValue = "10") Integer size)
|
|
|
- {
|
|
|
- return ApiResult.success(mceReceiveService.mceList(infoTitle, infoType,startTime, endTime, id,current, size));
|
|
|
+ @RequestParam(value = "size", required = false, defaultValue = "10") Integer size) {
|
|
|
+ return ApiResult.success(mceReceiveService.mceList(infoTitle, infoType, startTime, endTime, id, current, size));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -68,9 +68,8 @@ public class MceReceiveController {
|
|
|
@RequestParam(value = "startTime", required = false) String startTime,
|
|
|
@RequestParam(value = "endTime", required = false) String endTime,
|
|
|
@RequestParam(value = "current", required = false, defaultValue = "1") Integer current,
|
|
|
- @RequestParam(value = "size", required = false, defaultValue = "10") Integer size)
|
|
|
- {
|
|
|
- return ApiResult.success(mceReceiveService.mceManageList(infoTitle, infoType,startTime, endTime, current, size));
|
|
|
+ @RequestParam(value = "size", required = false, defaultValue = "10") Integer size) {
|
|
|
+ return ApiResult.success(mceReceiveService.mceManageList(infoTitle, infoType, startTime, endTime, current, size));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -83,9 +82,8 @@ public class MceReceiveController {
|
|
|
@GetMapping("/mceManageById")
|
|
|
public ApiResult<CommonPage<MceReceive>> mceManageById(@RequestParam(value = "id") Integer id,
|
|
|
@RequestParam(value = "current", required = false, defaultValue = "1") Integer current,
|
|
|
- @RequestParam(value = "size", required = false, defaultValue = "10") Integer size)
|
|
|
- {
|
|
|
- return ApiResult.success(mceReceiveService.mceManageById(id,current,size));
|
|
|
+ @RequestParam(value = "size", required = false, defaultValue = "10") Integer size) {
|
|
|
+ return ApiResult.success(mceReceiveService.mceManageById(id, current, size));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -93,8 +91,7 @@ public class MceReceiveController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/mceReceiveStatic")
|
|
|
- public ApiResult<Map<String, Object>> mceReceiveStatic()
|
|
|
- {
|
|
|
+ public ApiResult<Map<String, Object>> mceReceiveStatic() {
|
|
|
return ApiResult.success(mceReceiveService.mceReceiveStatic());
|
|
|
}
|
|
|
|
|
@@ -103,7 +100,7 @@ public class MceReceiveController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PutMapping
|
|
|
- ApiResult<Void> updateMceReceive(@RequestBody MceReceive mceReceive){
|
|
|
+ ApiResult<Void> updateMceReceive(@RequestBody MceReceive mceReceive) {
|
|
|
mceReceiveService.updateMceReceive(mceReceive);
|
|
|
return ApiResult.success();
|
|
|
}
|
|
@@ -114,20 +111,33 @@ public class MceReceiveController {
|
|
|
*/
|
|
|
@Log(title = "新增发布消息", businessType = BusinessType.INSERT)
|
|
|
@PostMapping("/mceAdd")
|
|
|
- ApiResult<Void> add(@RequestBody String mceReceive){
|
|
|
+ ApiResult<Void> add(@RequestBody String mceReceive) {
|
|
|
mceReceiveService.add(mceReceive);
|
|
|
return ApiResult.success();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 删除
|
|
|
+ * 删除消息及内容,并清空所有的消息接收表数据
|
|
|
*/
|
|
|
@Log(title = "删除已发布消息", businessType = BusinessType.DELETE)
|
|
|
- @DeleteMapping("/{id}")
|
|
|
- public ApiResult<Void> removeById(@PathVariable("id") Integer id)
|
|
|
- {
|
|
|
+ @DeleteMapping("/remove/{contentId}")
|
|
|
+ public ApiResult<Void> removeById(@PathVariable("contentId") Integer id) {
|
|
|
mceReceiveService.removeById(id);
|
|
|
return ApiResult.success();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除一条消息
|
|
|
+ **/
|
|
|
+ @Log(title = "删除消息", businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{id}")
|
|
|
+ public ApiResult<Void> deleteById(@PathVariable("id") Integer id) {
|
|
|
+ boolean f = mceReceiveService.deleteById(id);
|
|
|
+ if (f) {
|
|
|
+ return ApiResult.success();
|
|
|
+ } else {
|
|
|
+ return ApiResult.error("删除失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|