|
@@ -16,11 +16,9 @@ import org.checkerframework.checker.units.qual.A;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
+import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -38,6 +36,23 @@ public class TNoticeController {
|
|
TAdminService tAdminService;
|
|
TAdminService tAdminService;
|
|
@Autowired
|
|
@Autowired
|
|
TNoticeService noticeService;
|
|
TNoticeService noticeService;
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "添加公告")
|
|
|
|
+ @GetMapping("/addNotice")
|
|
|
|
+ public ResponseModel<?> addNotice(@RequestBody TNotice notice) {
|
|
|
|
+ if(StringUtils.isEmpty(notice.getNote())){
|
|
|
|
+ return R.fail(ResponseCodesEnum.A0001,"内容为空");
|
|
|
|
+ }
|
|
|
|
+ TNotice tNotice = new TNotice();
|
|
|
|
+ tNotice.setCreateDate(new Date());
|
|
|
|
+ tNotice.setModifyDate(new Date());
|
|
|
|
+ tNotice.setTitle(notice.getTitle());
|
|
|
|
+ tNotice.setNote(notice.getNote());
|
|
|
|
+ tNotice.setStatus("0");
|
|
|
|
+ noticeService.save(tNotice);
|
|
|
|
+ return R.ok(tNotice,"添加成功");
|
|
|
|
+ }
|
|
|
|
+
|
|
@ApiOperation(value = "获取公告")
|
|
@ApiOperation(value = "获取公告")
|
|
@GetMapping("/getNotice")
|
|
@GetMapping("/getNotice")
|
|
public ResponseModel<?> getNotice(String adminId) {
|
|
public ResponseModel<?> getNotice(String adminId) {
|