package com.dhcc.finance.main.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.dhcc.common.model.CurrencyMeta;
import com.dhcc.common.model.response.RestfulResponse;
import com.dhcc.finance.constant.MsConfigConsts;
import com.dhcc.finance.main.domain.PmProjectChild;
import com.dhcc.finance.main.service.PmProjectChildService;
import com.github.pagehelper.PageInfo;

import io.netty.util.internal.ObjectUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;

/**  
 * Title: PmProjectChildControler <br/>  
 * Description: TODO 信托项目信息表（子项目）操作接口<br/> 
 * @author lipeng 
 * @date 2019年7月10日 下午2:40:14
 */
@Slf4j
@RestController
@RequestMapping(value = MsConfigConsts.MS_API_PREFIX + PmProjectChildControler.API_PREFIX, produces = {
		MediaType.APPLICATION_JSON_UTF8_VALUE }, consumes = { MediaType.APPLICATION_JSON_UTF8_VALUE })
@Api(value = "信托项目信息表（子项目）操作接口controller", tags = { "信托项目信息表（子项目）操作接口" })
public class PmProjectChildControler {
	     // 凭证信息操作接口地址前缀
		public static final String API_PREFIX = "/pm-project-child";
		
		@Autowired
		PmProjectChildService pmProjectChildService;
		
		/**
		 * Title: searchCwGlVoucherAllData <br/>  
		 * Description: TODO按照信托产品类型和单一集合标志查询信托项目信息表（子项目）信息 <br/>
		 * @author lipeng 
		 * @param pageNum
		 * @param pageSize
		 * @param navigatePages
		 * @param cwGlVoucherAndLike
		 * @return RestfulResponse<PageInfo<CwGlVoucherAndName>,CurrencyMeta>
		 * @date 2019年7月10日 下午2:46:24
		 */
		@ApiOperation(value = "按照信托产品类型和单一集合标志查询信托项目信息表（子项目）信息 ", notes = "按照信托产品类型和单一集合标志查询信托项目信息表（子项目）信息 ", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
		@ApiImplicitParams({
	        @ApiImplicitParam(name = "pageNum", value = "页码", required = true, dataType = "String", paramType="query"),
	        @ApiImplicitParam(name = "pageSize", value = "每页显示数量", required = true, dataType = "String", paramType="query"),
	        @ApiImplicitParam(name = "navigatePages", value = "需要连续显示的页码数量", required = true, dataType = "String", paramType="query"),
	        @ApiImplicitParam(name = "pmProjectChild", value = "凭证信息筛选实体类",required = false, dataType = "PmProjectChild")
	    }) 
		@RequestMapping(value = { "/searchPmProjectChildinfoByCclxAndDyjhb" }, method = RequestMethod.PUT)
		public RestfulResponse<PageInfo<PmProjectChild>, CurrencyMeta> searchPmProjectChildinfoByCclxAndDyjhb(
				@RequestParam("pageNum") int pageNum,
	    		@RequestParam("pageSize") int pageSize,
	    		@RequestParam("navigatePages") int navigatePages,
	    		@RequestBody PmProjectChild pmProjectChild){
			
			return pmProjectChildService.searchPmProjectChildinfoByCclxAndDyjhbz(pmProjectChild, pageNum, pageSize, navigatePages);
		}
		@ApiOperation(value = "查询所有信托项目信息表（子项目）信息 的项目全称", notes = "查询所有信托项目信息表（子项目）信息 的项目全称 ", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
		@RequestMapping(value = { "/searchAllProjectName" }, method = RequestMethod.GET,consumes = MediaType.ALL_VALUE)
		public RestfulResponse<List<String>, CurrencyMeta> searchAllProjectName() {
			
			return   pmProjectChildService.searchAllProjectName();
		}


		
}
