add: 周年纪念日
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.dota.nexus.controller;
|
||||
|
||||
import com.dota.nexus.entity.Anniversary;
|
||||
import com.dota.nexus.entity.R;
|
||||
import com.dota.nexus.service.AnniversaryService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("anniversary")
|
||||
public class AnniversaryController {
|
||||
AnniversaryService anniversaryService;
|
||||
|
||||
public AnniversaryController(AnniversaryService anniversaryService) {
|
||||
this.anniversaryService = anniversaryService;
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R add(Anniversary anniversary) {
|
||||
anniversaryService.save(anniversary);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
public R del(Integer id) {
|
||||
anniversaryService.removeById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R update(Anniversary anniversary) {
|
||||
anniversaryService.saveOrUpdate(anniversary);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user