/**
* 文件：AttachController.java
* 版本：1.0.0
* 日期：
* Copyright &reg; 
* All right reserved.
*/
package com.mortals.xhx.module.attach.web;


import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.module.attach.model.AttachEntity;
import com.mortals.xhx.module.attach.service.AttachService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * <p>Title: 资料附件表</p>
 * <p>Description: AttachController  </p>
 * <p>Copyright: Copyright &reg;  </p>
 * <p>Company: </p>
 * @author 
 * @version 1.0.0
 */
@RestController
@RequestMapping("attach")
public class AttachController extends BaseCRUDJsonMappingController<AttachService,AttachForm,AttachEntity,Long> {

	@Autowired
	private ParamService paramService;
	public AttachController(){
		super.setFormClass(AttachForm.class);
		super.setModuleDesc("资料附件表");
	}

	@Override
	protected void init(HttpServletRequest request, HttpServletResponse response, AttachForm form, Map<String, Object> model, Context context) {

		this.addDict(model, "attachType", paramService.getParamByFirstOrganize(Constant.Param_MateriaAttachType));

		super.init(request, response, form, model, context);
	}
}