MedicineController
被设计为一个基于Spring MVC框架的RESTful控制器,使用@RestController
注解,表明其直接返回数据而非视图。它继承自BaseController<Medicine>
,通过依赖注入和泛型支持实现常见的CRUD(创建、读取、更新、删除)操作。
完整实现代码:
package com.SmartMed_Connect.controller;
import com.SmartMed_Connect.entity.Medicine;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("medicine")
public class MedicineController extends BaseController<Medicine> {
}