|
@@ -0,0 +1,33 @@
|
|
|
+package thyyxxk.wxservice_server.controller;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+import thyyxxk.wxservice_server.dao.ImportDrugDao;
|
|
|
+import thyyxxk.wxservice_server.entity.ResultVo;
|
|
|
+import thyyxxk.wxservice_server.entity.importdrug.ImportDrugPurchase;
|
|
|
+import thyyxxk.wxservice_server.utils.ResultVoUtil;
|
|
|
+import thyyxxk.wxservice_server.utils.SnowFlakeId;
|
|
|
+
|
|
|
+import java.util.Calendar;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping("/importDrug")
|
|
|
+public class ImportDrugController {
|
|
|
+ private final ImportDrugDao dao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ public ImportDrugController(ImportDrugDao dao) {
|
|
|
+ this.dao = dao;
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/submitNewItem")
|
|
|
+ public ResultVo<String> submitNewItem(@RequestBody ImportDrugPurchase purchase) {
|
|
|
+ purchase.setId(SnowFlakeId.instance().nextId());
|
|
|
+ purchase.setCreateTime(Calendar.getInstance().getTime());
|
|
|
+ dao.insert(purchase);
|
|
|
+ return ResultVoUtil.success("我院近期将与您联系,请保持手机畅通,谢谢。");
|
|
|
+ }
|
|
|
+}
|