package com.dhcc.finance.main.controller;

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.CwGlFreevalue;
import com.dhcc.finance.main.model.CwGlFreevalueInfo;
import com.dhcc.finance.main.service.CwGlFreevalueService;
import com.github.pagehelper.PageInfo;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

/**
 * 功能描述：辅助标识Controller
 * @author dml
 * @date 2019年3月28日 下午8:15:06
 * @修改日志：
 */
@RestController
@RequestMapping(value = MsConfigConsts.MS_API_PREFIX + CwGlFreevalueController.API_PREFIX, produces = {
		MediaType.APPLICATION_JSON_UTF8_VALUE }, consumes = { MediaType.APPLICATION_JSON_UTF8_VALUE })
@Api(value = "辅助标识controller", tags = { "辅助标识操作接口" })
public class CwGlFreevalueController {
	// 辅助标识操作接口地址前缀
	public static final String API_PREFIX = "/cw_gl_freevalue";
	
	@Autowired
	CwGlFreevalueService cwGlFreevalueService;
	
	/**
	 * 功能描述：查询全部辅助标识
	 * @param pageNum
	 * @param pageSize
	 * @param navigatePages
	 * @return RestfulResponse<PageInfo<CwGlFreevalue>,CurrencyMeta>
	 * @author dml
	 * @date 2019年3月28日 下午8:19:41
	 * @修改日志：
	 */
	@ApiOperation(value = "获取全部辅助标识", notes = "获取全部辅助标识", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.ALL_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")
    }) 
	@RequestMapping(value = { "/searchCwGlFreevalueAllData" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
	public 	RestfulResponse<PageInfo<CwGlFreevalue>, CurrencyMeta> searchCwGlFreevalueAllData(
			@RequestParam("pageNum") int pageNum,
    		@RequestParam("pageSize") int pageSize,
    		@RequestParam("navigatePages") int navigatePages){
		return  cwGlFreevalueService.searchCwGlFreevalueAllData(pageNum, pageSize, navigatePages);
	}
	
	/**
	 * 功能描述：新增辅助标识
	 * @param cwGlFreevalue
	 * @return RestfulResponse<Object,CurrencyMeta>
	 * @author dml
	 * @date 2019年3月28日 下午8:21:14
	 * @修改日志：
	 */
	@ApiOperation(value = "新增辅助标识-传递复杂对象", notes = "新增辅助标识", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	@ApiImplicitParam(name = "cwGlFreevalue", value = "辅助标识对象实体", required = true, dataType = "CwGlFreevalue")
	@RequestMapping(value = "/addCwGlFreevalue", method = RequestMethod.POST)
	public RestfulResponse<Object, CurrencyMeta> addCwGlFreevalue(@RequestBody CwGlFreevalue cwGlFreevalue){
		return cwGlFreevalueService.addCwGlFreevalue(cwGlFreevalue);
	}

	/**
	 * 功能描述：修改辅助标识
	 * @param cwGlFreevalue
	 * @return RestfulResponse<Object,CurrencyMeta>
	 * @author dml
	 * @date 2019年3月28日 下午8:22:55
	 * @修改日志：
	 */
	@ApiOperation(value = "修改辅助标识-传递复杂对象", notes = "修改辅助标识", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	@ApiImplicitParam(name = "cwGlFreevalue", value = "辅助标识对象实体", required = true, dataType = "CwGlFreevalue")
	@RequestMapping(value = "/updateCwGlFreevalueByPk", method = RequestMethod.PUT)
	public 	RestfulResponse<Object, CurrencyMeta> updateCwGlFreevalueByPk(@RequestBody CwGlFreevalue cwGlFreevalue){
		return cwGlFreevalueService.updateCwGlFreevalueByPk(cwGlFreevalue);
	}
	
	/**
	 * 功能描述：逻辑删除辅助标识
	 * @param pkFreevalue
	 * @return RestfulResponse<Object,CurrencyMeta>
	 * @author dml
	 * @date 2019年3月28日 下午8:24:13
	 * @修改日志：
	 */
	@ApiOperation(value = "逻辑删除辅助标识", notes = "删除辅助标识", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	@ApiImplicitParam(name = "pkFreevalue", value = "辅助标识主键", required = true, dataType = "String")
	@RequestMapping(value = "/deleteCwGlFreevalueByPk", method = RequestMethod.DELETE , consumes = MediaType.ALL_VALUE)
	public RestfulResponse<Object, CurrencyMeta> deleteCwGlFreevalueByPk(@RequestParam("pkFreevalue") String pkFreevalue){
		return cwGlFreevalueService.deleteCwGlFreevalueByPk(pkFreevalue);
	}
	
	/**
	 * 功能描述：根据ASSID查询辅助项
	 * @param assid
	 * @param pageNum
	 * @param pageSize
	 * @param navigatePages
	 * @return RestfulResponse<PageInfo<CwGlFreevalueInfo>,CurrencyMeta>
	 * @author dml
	 * @date 2019年8月7日 下午2:31:41
	 * @修改日志：
	 */
	@ApiOperation(value = "根据ASSID查询辅助项", notes = "根据ASSID查询辅助项", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.ALL_VALUE)
	@ApiImplicitParams({
		@ApiImplicitParam(name = "assid", value = "assid", required = true, dataType = "String", paramType="query"),
        @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")
    }) 
	@RequestMapping(value = { "/searchCwGlFreevalueByAssid" }, method = RequestMethod.GET, consumes = MediaType.ALL_VALUE)
	public 	RestfulResponse<PageInfo<CwGlFreevalueInfo>, CurrencyMeta> searchCwGlFreevalueByAssid(
			@RequestParam("assid") String assid,
			@RequestParam("pageNum") int pageNum,
    		@RequestParam("pageSize") int pageSize,
    		@RequestParam("navigatePages") int navigatePages){
		return  cwGlFreevalueService.searchCwGlFreevalueByAssid(assid, pageNum, pageSize, navigatePages);
	}
}
