package com.bonus.canteen.core.nutrition.mobile.controller;

import com.bonus.canteen.core.common.page.QueryParseHelper;
import com.bonus.canteen.core.nutrition.common.dto.HealthChronicDto;
import com.bonus.canteen.core.nutrition.common.vo.HealthChronicVo;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.canteen.core.nutrition.common.service.HealthChronicService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping({"/health/mobile/chronic"})
@Api(
   tags = {"mobile-移动端慢性病"}
)
public class HealthMobileChronicController {
   @Autowired
   private HealthChronicService healthChronicService;

//   @ApiOperation("获取慢性病字典")
//   @GetMapping({"/dict-health-chronic"})
//   public AjaxResult dictHealthChronic(String content) {
//      HealthChronicDto paramFromContent = (HealthChronicDto) QueryParseHelper.getParamFromContent(content, HealthChronicDto.class);
//      List<HealthChronicVo> list = this.healthChronicService.dictHealthChronic(paramFromContent);
//      return AjaxResult.success(list);
//   }

   @ApiOperation("获取慢性病字典")
   @PostMapping({"/dict-health-chronic"})
   public AjaxResult dictHealthChronic(@RequestBody HealthChronicDto dto) {
      //HealthChronicDto paramFromContent = (HealthChronicDto) QueryParseHelper.getParamFromContent(content, HealthChronicDto.class);
      List<HealthChronicVo> list = this.healthChronicService.dictHealthChronic(dto);
      return AjaxResult.success(list);
   }

}
