add: 习惯curd
This commit is contained in:
@@ -3,6 +3,7 @@ package com.dota.nexus.controller;
|
||||
import com.dota.nexus.entity.HabitRecord;
|
||||
import com.dota.nexus.entity.R;
|
||||
import com.dota.nexus.service.HabitRecordService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@@ -16,6 +17,14 @@ public class HabitRecordController {
|
||||
this.habitRecordService = habitRecordService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据目标id查询习惯记录
|
||||
*/
|
||||
@GetMapping
|
||||
public R getHabitRecords(Integer id) {
|
||||
return R.ok(habitRecordService.getHabitRecordsByGoalId(id));
|
||||
}
|
||||
|
||||
@PostMapping()
|
||||
public R addHabitRecord(Integer id) {
|
||||
var habit = new HabitRecord();
|
||||
|
||||
Reference in New Issue
Block a user