package com.xinelu.mobile.controller.appletsignpatienttask;

import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.R;
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
import com.xinelu.manage.dto.signpatientmanageroutenode.AppletPatientTaskDto;
import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService;
import com.xinelu.manage.vo.signpatientmanageroutenode.AppletRouteNodeListVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 小程序-患者任务控制器
 * @author: haown
 * @create: 2024-04-17 09:47
 **/
@Api(tags = "小程序-患者任务控制器")
@RestController
@RequestMapping("/postDischarge/signnode")
public class AppletSignPatientTaskController extends BaseController {
	@Resource
	private ISignPatientManageRouteNodeService signNodeService;

	/**
	 * 任务列表
	 */
	@ApiOperation("任务列表")
	@GetMapping("/getTaskList")
	public R<List<AppletRouteNodeListVo>> getAppletTaskList(@Valid AppletPatientTaskDto appletPatientTaskDto) {
		List<AppletRouteNodeListVo> list = signNodeService.getAppletTaskList(appletPatientTaskDto);
		return R.ok(list);
	}

	/**
	 * 任务详情
	 */
	@ApiOperation("任务详情")
	@GetMapping("/getNodeDetail/{id}")
	public R<SignPatientManageRouteNode> getNodeDetail(@PathVariable("id") Long id) {
		return R.ok(signNodeService.selectSignPatientManageRouteNodeById(id));
	}

}
