package com.yihu.figure.controller.drug;

import com.yihu.figure.controller.BaseController;
import com.yihu.figure.service.drug.MedicineRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by yeshijie on 2017/3/13.
 */
@Controller
@RequestMapping(value = "/medicine/")
@Api(description = "用药记录接口")
public class MedicineController extends BaseController{

    @Autowired
    private MedicineRecordService medicineRecordService;


    /**
     * 获取基位用药记录
     * @return
     */
    @RequestMapping(value="getJwDrugList" ,method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "获取基位用药记录")
    public String getJwDrugList(){
        try{
            medicineRecordService.getJwDrugList();
            return write(200,"生成成功");
        }catch (Exception e){
            e.printStackTrace();
            return error(-1, "生成失败");
        }
    }


}
